Re: NSRuleEditor: Criteria for new row

2009-12-23 Thread Houdah - ML Pierre Bernard
I was able to fake it by subclassing a private method:

- (void)_addOptionFromSlice:(id)slice ofRowType:(unsigned int)type
{
int rowIndex = [(NSRuleEditorViewSlice*)slice rowIndex];

NSArray *criteriaForRow = [self criteriaForRow:rowIndex];
NSArray *displayValuesForRow = [self displayValuesForRow:rowIndex];

self.template = [NSArray arrayWithObjects:criteriaForRow, 
displayValuesForRow, nil];

[super _addOptionFromSlice:slice ofRowType:type];
}

- (void)insertRowAtIndex:(NSInteger)rowIndex 
withType:(NSRuleEditorRowType)rowType asSubrowOfRow:(NSInteger)parentRow 
animate:(BOOL)shouldAnimate
{
[super insertRowAtIndex:rowIndex withType:rowType 
asSubrowOfRow:parentRow animate:shouldAnimate];

NSArray *template = self.template;

if (template != nil) {
[self setCriteria:[template objectAtIndex:0] 
andDisplayValues:[template objectAtIndex:1] forRowAtIndex:rowIndex];
}
}

Pierre

On Dec 23, 2009, at 12:37 AM, Peter Ammon wrote:

 
 On Dec 22, 2009, at 10:57 AM, Houdah - ML Pierre Bernard wrote:
 
 When I hit the + button on a row in NSRuleEditor, a new row is created. 
 How can I take influence on the criteria used for that row.
 
 It seems NSRuleEditor defaults to selecting the first criterion sequentially 
 from the list of possible values. I would much rather have the new row match 
 the row where the + was clicked.
 
 Pierre
 
 Sorry, this isn't possible right now.
 

- - -
Houdah Software s. à r. l.
http://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Powerful Spotlight frontend




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSRuleEditor: Criteria for new row

2009-12-22 Thread Houdah - ML Pierre Bernard
When I hit the + button on a row in NSRuleEditor, a new row is created. How 
can I take influence on the criteria used for that row.

It seems NSRuleEditor defaults to selecting the first criterion sequentially 
from the list of possible values. I would much rather have the new row match 
the row where the + was clicked.

Pierre

- - -
Houdah Software s. à r. l.
http://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Powerful Spotlight frontend




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSRuleEditor: Criteria for new row

2009-12-22 Thread Peter Ammon

On Dec 22, 2009, at 10:57 AM, Houdah - ML Pierre Bernard wrote:

 When I hit the + button on a row in NSRuleEditor, a new row is created. How 
 can I take influence on the criteria used for that row.
 
 It seems NSRuleEditor defaults to selecting the first criterion sequentially 
 from the list of possible values. I would much rather have the new row match 
 the row where the + was clicked.
 
 Pierre

Sorry, this isn't possible right now.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com