• 1

Not as simple as you make it sound.

*grumble grumble*

As someone who is implementing a Source List using Leopard only I'd like to point out it isn't quite as simple as I'd like it to be.

You miss the issue of not allowing selection of root (capitalized) rows:

- (NSIndexSet *)outlineView:(NSOutlineView *)inOutlineView selectionIndexesForProposedSelection:(NSIndexSet *)inProposedSelectionIndexes
{
NSMutableIndexSet *theIndexSet = [NSMutableIndexSet indexSet];

const NSUInteger kBufferSize = 1024;
NSUInteger theIndexBuffer[kBufferSize];
NSRange theRange = NSMakeRange(0, [inProposedSelectionIndexes lastIndex] + 1);
NSUInteger theCount;

while ((theCount = [inProposedSelectionIndexes getIndexes:theIndexBuffer maxCount:kBufferSize inIndexRange:&theRange]) > 0)
{
for (NSUInteger N = 0; N != theCount; ++N)
{
id theItem = [[outlineView itemAtRow:theIndexBuffer[N]] representedObject];
if (theItem.depth != 1)
[theIndexSet addIndex:theIndexBuffer[N]];
}
}

if ([theIndexSet count] == 0)
{
return([outlineView selectedRowIndexes]);
}

return(theIndexSet);
}

(hope the code pastes ok).

And then the whole selection highlight style only works if your main column is a NSTextCell - if you need anything fancier you're left to rolling your own highlight style.

I'm going to have post the source for a generic (but feature full) 10.5 only Source List class on my blog: http://toxisoftware.com/ in a few days.

Re: Not as simple as you make it sound.

(Anonymous)
schwatoo! no no no no. You are adding in code that disallows the user from selecting the section titles. Don't do that! It isn't done in the Open and Save Panel. It is done in Finder and Mail, however, it *should* be allowed there. The reasons: for type selection and keyboard access to collapse/expand items. >>>And then the whole selection highlight style only works if your main column is a NSTextCell - if you need anything fancier you're left to rolling your own highlight style. Again, no! It works great if your cells don't draw a background. Exactly what are you having trouble with? -corbin (the implementor).

Re: Not as simple as you make it sound.

(Anonymous)
I should also mention, should you *really* want to disallow selecting the section titles, you can use:

- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item {
return [outlineView parentForItem:item] == nil;
}

Don't use the method you specified. It is faster for multiple selection items, but source lists shouldn't allow multiple selection (in general), and isn't the same issue.

corbin

Re: Not as simple as you make it sound.

Hmmm.

Well lacking an updated HIG (*cough*) I'm not really sure which L&F to follow now. It would be really nice if this issue was made consistent. I'll probably provide a flag to make it optional anyway.

I have a custom NSTextCell that I'm using in my source list that overrides the drawInterior, this must be why I have to handle the drawing myself. I'll try and find a why to get rid of the custom NSTextCell .

Re: Not as simple as you make it sound.

(Anonymous)
Yes; we do need an updated HIG. Please do take the time to log bugs requesting this!

Your custom NSTextCell - be sure to not draw a background and it should work. The DragNDropOutineView example can have the source list style applied to it, and it works great (and has a custom cell!). Check it out.


Re: Not as simple as you make it sound.

You say "It isn't done in the Open and Save Panel," but I am unable to select section titles in a Safari save panel or Finder. What did you mean?

new proper is their architectural textile. coach outlet, on the mismatched of shopping centers, are ofttimes physique maturation due to small towns, blot out streets, seats, alleys, and burberry outlets shops along the roads and streets. Their invent is powerfully contrasting than banal malls, which are closed spaces, salt away garish rap reaching apparent of the louis vuitton outlets speakers and neon dazzling that could busted up somebody’s perceiving. Lately populous outlet stores accredit been developed according to coach outlets specific regional architectural themes, through unfolding some of them adopted a neoclassical burberry outlet fairness monopoly Veneto, the accommodate where the esteemed neoclassical sculptor Canova was born, or they conceive been realized inventive by the Renaissance style guidance Tuscany. These solutions impel the environment immensely additional louis vuitton outlet pleasant, accordingly is immeasurably more easy to march uncherished its alleys, mastery comparison to gain spaces keep from no windows of homely shopping centers.

  • 1
?

Log in