Re: NSPredicateEditorRowTemplate and dynamic templateViews

2010-03-30 Thread Dave DeLong
I'm still struggling with this. Does anyone know how I can either: 1. Use custom comparators in an NSPredicateEditorRowTemplate or 2. Have two templates with the same left expression and operator, but different right expression types? Thanks, Dave On Mar 12, 2010, at 7:29 PM, Dave D

Re: NSPredicateEditorRowTemplate and dynamic templateViews

2010-03-12 Thread Dave DeLong
re's very very little in there about how to use that from within an NSPredicateEditorRowTemplate. Can that operator type be used in a EditorRowTemplate (my attempts to do so have resulted in HIToolbox generating an Unknown Predicate Type exception)? If not, how can I have two different ki

Re: NSPredicateEditorRowTemplate and dynamic templateViews

2010-03-12 Thread Dave DeLong
This seems so obvious in retrospect that I can't believe I didn't think of that. Thank you so much! Dave On Mar 12, 2010, at 2:57 PM, Peter Ammon wrote: > What you want to do here is to create two separate templates. One "looks > like" this: > > [Creation Date, Modification Date]

Re: NSPredicateEditorRowTemplate and dynamic templateViews

2010-03-12 Thread Peter Ammon
On Mar 12, 2010, at 1:47 PM, Dave DeLong wrote: > Hi everyone, > > I'm trying to build a custom predicate editor row template that lets me do > predicates like "in the last 30 days" or "since {aDate}". For the simple > date comparison, I'm returning an NSDatePicker as the third view in my >

NSPredicateEditorRowTemplate and dynamic templateViews

2010-03-12 Thread Dave DeLong
Hi everyone, I'm trying to build a custom predicate editor row template that lets me do predicates like "in the last 30 days" or "since {aDate}". For the simple date comparison, I'm returning an NSDatePicker as the third view in my templateViews. My problem is that I only want to return the NS

NSPredicateEditorRowTemplate and CoreData

2010-01-25 Thread Carmen Cerino Jr.
*templates = [NSPredicateEditorRowTemplate templatesWithAttributeKeyPaths:[NSArray arrayWithObjects:@"name", @"age", nil] inEntityDescription:descrip]; [ibPredicateEditor setRowTemplates: templates]; NSPredicate *p = [NSPredicate predica

Re: set the label for the left hand expression / popup in an NSPredicateEditorRowTemplate?

2010-01-13 Thread Peter Ammon
On Jan 13, 2010, at 3:46 PM, Mike Chambers wrote: > [...] > I then add this to the NSPredicateEditor, and it works as expect. > However, the left column in the editor for this row shows > "professions" (the key value). I want it to show "Profession". If I > was using IB this would be very simple,

set the label for the left hand expression / popup in an NSPredicateEditorRowTemplate?

2010-01-13 Thread Mike Chambers
I am looking for some input on how to set the label for the left hand expression / popup in an NSPredicateEditorRowTemplate. I need to programmatically create a NSPredicateEditorRowTemplate so I can populate the right side expression / drop down with dynamically generated values. In my subclass

Re: Customizing left expression title in NSPredicateEditorRowTemplate

2009-12-28 Thread Mike Chambers
ple NSPredicateEditorRowTemplate instance that > I instantiate like so: > > > NSMutableArray *seriesExpressions = [NSMutableArray > arrayWithCapacity:[series count]]; > for(NSString *s in series) > { >        [seriesExpressions addObject:[NSExpression >

Customizing left expression title in NSPredicateEditorRowTemplate

2009-12-28 Thread Mike Chambers
I have am creating a simple NSPredicateEditorRowTemplate instance that I instantiate like so: NSMutableArray *seriesExpressions = [NSMutableArray arrayWithCapacity:[series count]]; for(NSString *s in series) { [seriesExpressions addObject:[NSExpression

Re: NSPredicateEditorRowTemplate and dynamic popups

2009-11-13 Thread Jim Turner
and a third popup button that's populated with a list of possible > values. > > This is very similar to a regular row template, except that the list of > possible values is computed at runtime and can change periodically based on > system events. > > I've tried sub

NSPredicateEditorRowTemplate and dynamic popups

2009-11-13 Thread Dave DeLong
lated with a list of possible values. This is very similar to a regular row template, except that the list of possible values is computed at runtime and can change periodically based on system events. I've tried subclassing NSPredicateEditorRowTemplate, overriding -templateViews, and retur

Re: NSPredicateEditorRowTemplate, NSPopupButton and bindings

2009-05-26 Thread Peter Ammon
ot; Implementing this is straightforward enough, but I the wrinkle is that want the right hand side of the expression to come from a core data entity. So, no problem, when I create the NSPopUpButton (in my custom NSPredicateEditorRowTemplate class) I simply fill the menuitems from the app

Re: NSPredicateEditorRowTemplate, NSPopupButton and bindings

2009-05-25 Thread Martin Stanley
ough, but I the wrinkle is that want the right hand side of the expression to come from a core data entity. So, no problem, when I create the NSPopUpButton (in my custom NSPredicateEditorRowTemplate class) I simply fill the menuitems from the appropriate array controller, which in turn gets it

Re: NSPredicateEditorRowTemplate, NSPopupButton and bindings

2009-05-22 Thread Peter Ammon
, when I create the NSPopUpButton (in my custom NSPredicateEditorRowTemplate class) I simply fill the menuitems from the appropriate array controller, which in turn gets its data from the Core Data entity. After much learning and experimenting, this now works. All is well. So, then I real

NSPredicateEditorRowTemplate, NSPopupButton and bindings

2009-05-22 Thread Martin Stanley
n (in my custom NSPredicateEditorRowTemplate class) I simply fill the menuitems from the appropriate array controller, which in turn gets its data from the Core Data entity. After much learning and experimenting, this now works. All is well. So, then I realize that if (in another window) the user edits the Cor

NSPredicateEditorRowTemplate and switching views

2009-05-04 Thread Arved von Brasch
Hi Cocoa list, I have noticed a strange bug in my NSPredicateEditorRowTemplate implementation. I have implemented a Pop-Up Pop-Up Level-Indicator template row to allow users to sort by rating. The relevant code is below: @synthesize levelIndicator; - (id)copyWithZone: (NSZone *)zone

Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate

2009-03-06 Thread Peter Ammon
On Mar 6, 2009, at 6:42 AM, David Hoerl wrote: [following up to a Jan 08 thread] > is it possible to modify the width of the NSTextField representing a "Number" in a NSPredicateEditorRowTemplate ? Yes, but not yet in Interface Builder. To do so programatically, get the

Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate

2009-03-06 Thread David Hoerl
[following up to a Jan 08 thread] > is it possible to modify the width of the NSTextField representing a "Number" in a NSPredicateEditorRowTemplate ? Yes, but not yet in Interface Builder. To do so programatically, get the row template, get the text field as the last memb

Re: NSPredicateEditorRowTemplate and NSTokenField

2009-01-30 Thread Vitaly Ovchinnikov
I finally found a solution that seems to work. I subclassed NSTokenField: == @implementation MyTokenField - (void) notifyTarget: (id) sender { NSControl *t = [self target]; [t sendAction:nil to:t]; } - (void)textDidEndEditing:(NSNotification *)aNotification { [sup

NSPredicateEditorRowTemplate and NSTokenField

2009-01-30 Thread Vitaly Ovchinnikov
Hello all, that's me again with my predicate editor problems :) I subclassed predicate editor's row and replaced default text editor with my NSTokenField in -templateViews. Predicates, that match my template, look like: ANY Tags IN {"tag1", "tag2", "tag3"} In -setPredicate I fill token field wit

Re: NSPredicateEditorRowTemplate for NSDate

2009-01-19 Thread Vitaly Ovchinnikov
t; You'll need to subclass NSPredicateEditorRowTemplate and provide the > views and logic you want to use in your template. > > I did a presentation for the local CocoaHeads a while back on > NSPredicateEditor and my sample code does show a basic "Date is within > N days/w

Re: NSPredicateEditorRowTemplate for NSDate

2009-01-19 Thread Peter Ammon
Hello Vitaly, The Cocoa frameworks do not yet have any classes for specifying a relative date, so you will have to handle this yourself with a subclass of NSPredicateEditorRowTemplate. You can leverage the superclass to do much of the work for you: your responsibility is limited to

Re: NSPredicateEditorRowTemplate for NSDate

2009-01-19 Thread Markus Spoettl
for your object NSPredicateEditorRowTemplate *dateTemplate = [[[NSPredicateEditorRowTemplate alloc] initWithLeftExpressions:expressions rightExpressionAttributeType:NSDateAttributeType modifier:NSDirectPredicateModifier ope

Re: NSPredicateEditorRowTemplate for NSDate

2009-01-19 Thread Jim Turner
The miracle is over. The out-of-the-box templates in IB only provide three-view templates (left expression, operator, right expression). You'll need to subclass NSPredicateEditorRowTemplate and provide the views and logic you want to use in your template. I did a presentation for the

Re: NSPredicateEditorRowTemplate for NSDate

2009-01-19 Thread Vitaly Ovchinnikov
Hey, boys and girls? Am I the first, who use NSPredicateEditor? I just found that there is no default template for time values... Please somebody confirm that miracle is over and I need to code all this data/time stuff myself :( On Sun, Jan 18, 2009 at 7:22 PM, Vitaly Ovchinnikov wrote: > Hello

NSPredicateEditorRowTemplate for NSDate

2009-01-18 Thread Vitaly Ovchinnikov
Hello list, When I add a row template that edits date to predicate editor, it allows to perform simple comparisons. Like less or greater or equal etc. Smart folders in Finder allow to add clauses like "Date is within last X weeks". I can't find a simple way to do the same. It seems that the only w

Re: Live updating NSPredicateEditorRowTemplate?

2008-12-13 Thread Guy Umbright
ditor setCriteria:[NSArray array] andDisplayValues:[NSArray array] forRowAtIndex: 1]; On Dec 8, 2008, at 8:58 PM, Peter Ammon wrote: On Dec 8, 2008, at 6:37 PM, Guy Umbright wrote: I am trying to create an NSPredicateEditorRowTemplate with its last view a popup that contains a list of things (else

Re: Live updating NSPredicateEditorRowTemplate?

2008-12-11 Thread Peter Ammon
Guy On Dec 8, 2008, at 8:58 PM, Peter Ammon wrote: On Dec 8, 2008, at 6:37 PM, Guy Umbright wrote: I am trying to create an NSPredicateEditorRowTemplate with its last view a popup that contains a list of things (elsewhere in the window) that can be updated while the editor is being displa

Re: Live updating NSPredicateEditorRowTemplate?

2008-12-10 Thread Guy Umbright
uot;2008-12-10 20:49:41.050 prededit[12581:813] In 0x126340>, different number of items (2) than values (3)" Guy On Dec 8, 2008, at 8:58 PM, Peter Ammon wrote: On Dec 8, 2008, at 6:37 PM, Guy Umbright wrote: I am trying to create an NSPredicateEditorRowTemplate with its last view a p

Re: Live updating NSPredicateEditorRowTemplate?

2008-12-08 Thread Peter Ammon
On Dec 8, 2008, at 6:37 PM, Guy Umbright wrote: I am trying to create an NSPredicateEditorRowTemplate with its last view a popup that contains a list of things (elsewhere in the window) that can be updated while the editor is being displayed. I can get it so that I can add an instance

Live updating NSPredicateEditorRowTemplate?

2008-12-08 Thread Guy Umbright
I am trying to create an NSPredicateEditorRowTemplate with its last view a popup that contains a list of things (elsewhere in the window) that can be updated while the editor is being displayed. I can get it so that I can add an instance of the template, update the list of items and add

Re: NSPredicateEditorRowTemplate and CoreData

2008-10-16 Thread Peter Ammon
#x27;m expecting to parse the predicate tree when I want to use it to replace the object instance with its name attribute. That part is relatively easy to set up in a NSPredicateEditorRowTemplate subclass. I'm using an IBOutlet link to an NSArrayController which has all the ite

NSPredicateEditorRowTemplate and CoreData

2008-10-16 Thread Arved von Brasch
to use it to replace the object instance with its name attribute. That part is relatively easy to set up in a NSPredicateEditorRowTemplate subclass. I'm using an IBOutlet link to an NSArrayController which has all the items to populate the list with. Overriding templateViews to p

Re: NSPredicateEditorRowTemplate and ANY predicate

2008-07-23 Thread Peter Ammon
me this sort of predicate. I don't find a way to do it in IB without subclassing NSPredicateEditorRowTemplate. Perhaps I have not see it. For info, I tried the subclassing and it works. Ok, thanks for clarifying your question. As you guessed this isn't yet possible in IB. -P

Re: NSPredicateEditorRowTemplate and ANY predicate

2008-07-23 Thread [EMAIL PROTECTED]
ant a NSPredicateEditor to give me this sort of predicate. I don't find a way to do it in IB without subclassing NSPredicateEditorRowTemplate. Perhaps I have not see it. For info, I tried the subclassing and it works. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.c

Re: NSPredicateEditorRowTemplate and ANY predicate

2008-07-22 Thread Peter Ammon
On Jul 22, 2008, at 12:05 PM, Frédéric Testuz wrote: Hello, Is it possible to prepare a row template for a NSPredicateEditor in IB for a predicate like "ANY keyPath == 'aValue'" ? I'm not sure I understand your question. How is this different than just a normal OR type compound predic

NSPredicateEditorRowTemplate and ANY predicate

2008-07-22 Thread Frédéric Testuz
Hello, Is it possible to prepare a row template for a NSPredicateEditor in IB for a predicate like "ANY keyPath == 'aValue'" ? Otherwise I found this : If I can't do it in IB, I think it will be the simplest solution : - (N

NSPredicateEditorRowTemplate

2008-07-04 Thread Chris
I have a custom view in a NSPredicateEditorRowTemplate. It seems like the NSPredicateEditor isn't aware when I change the state of the custom view, because when I ask it for the predicate it just returns the old one without even calling predicateWithSubPredicates on my template

Re: NSPredicateEditorRowTemplate

2008-06-24 Thread Chris
When you create your template and insert your custom view, make sure to keep a reference to that specific object so you can query it later on. @interface CustomPredicateEditorRowTemplate : NSPredicateEditorRowTemplate { CustomTextField *myTextField; } -(CustomTextField *) myTextField; @

Re: NSPredicateEditorRowTemplate

2008-06-24 Thread Jim Turner
your template and insert your custom view, make sure to keep a reference to that specific object so you can query it later on. @interface CustomPredicateEditorRowTemplate : NSPredicateEditorRowTemplate { CustomTextField *myTextField; } -(CustomTextField *) myTextField; @end @impl

Re: NSPredicateEditorRowTemplate

2008-06-24 Thread Chris
Hi! This is very interesting information. Wish it was in the doco! I have a custom view which wasn't responding to setObjectValue / objectValue. When I add those methods I find that on startup it does indeed copy the values from object "C" to object "B". This means that when I retrieve

Re: NSPredicateEditorRowTemplate

2008-06-24 Thread Jim Turner
On Tue, Jun 24, 2008 at 2:02 AM, Chris <[EMAIL PROTECTED]> wrote: > When the user clicks ok, then I call objectValue on the NSPredicateEditor > and it calls predicateWithSubpredicates not on object "C", but on object > "B", which is always going to be blank, because it is in fact object "C" > which

NSPredicateEditorRowTemplate

2008-06-24 Thread Chris
I've got a NSPredicateEditor and I'm inheriting from NSPredicateEditorRowTemplate to make a custom template. It implements copyWithZone as the doco seems to imply I should. In Interface builder I have a number of standard row templates, and I've added my custom one at the end by se

Re: NSPredicateEditorRowTemplate: Custom templateView state

2008-06-04 Thread Mario Fischer
Hi Peter, yes of course, thanks! Am 04.06.2008 um 22:27 schrieb Peter Ammon: On Jun 3, 2008, at 12:05 PM, Mario Fischer wrote: Hi - - I use the NSPredicateEditor with a custom NSPredicateEditorRowTemplate - This custom component should implement something like this: [Filesize

Re: NSPredicateEditorRowTemplate: Custom templateView state

2008-06-04 Thread Peter Ammon
On Jun 3, 2008, at 12:05 PM, Mario Fischer wrote: Hi - - I use the NSPredicateEditor with a custom NSPredicateEditorRowTemplate - This custom component should implement something like this: [Filesize] - [is smaller/greater than] - [Textfield] - [KB/MB/GB] By overriding

NSPredicateEditorRowTemplate: Custom templateView state

2008-06-03 Thread Mario Fischer
Hi - - I use the NSPredicateEditor with a custom NSPredicateEditorRowTemplate - This custom component should implement something like this: [Filesize] - [is smaller/greater than] - [Textfield] - [KB/MB/GB] By overriding templateViews I'm able to add an additional NSPopupButton t

Re: Custom NSPredicateEditorRowTemplate with Single Item

2008-05-20 Thread Steven Huey
e added to the predicate editor. If you subclass NSPredicateEditorRowTemplate and add a view to it, you must ensure that each copy has a new instance of the view. I wasn't aware of that, but will keep that in mind since I have a few other custom templates to build. However, there

Re: Custom NSPredicateEditorRowTemplate with Single Item

2008-05-19 Thread Peter Ammon
On May 19, 2008, at 12:05 PM, Steven Huey wrote: Hello, I'm trying to create a custom NSPredicateEditorRowTemplate subclass that has a single view, an NSPopUpButton with a single item and am having some trouble. Basically what I'm trying to do is create a predicate like the on

Custom NSPredicateEditorRowTemplate with Single Item

2008-05-19 Thread Steven Huey
Hello, I'm trying to create a custom NSPredicateEditorRowTemplate subclass that has a single view, an NSPopUpButton with a single item and am having some trouble. Basically what I'm trying to do is create a predicate like the one in Apple Mail when creating a rule for handling

Re: NSPredicateEditorRowTemplate and templateView delegates

2008-04-28 Thread Peter Ammon
d by the editor and I wonder if the delegate isn't getting copied as well. Is there a better way of setting the delegate of a text field in a NSPredicateEditorRowTemplate? Hi Jim, As you surmised, delegates are not propagated by copy. NSPredicateEditor posts NSControlTextDidChangeNotific

NSPredicateEditorRowTemplate and templateView delegates

2008-04-28 Thread Jim Turner
except my controlTextDidChange: never gets called. I'm setting the delegate in my view controller's awakeFromNib: as such: for( NSPredicateEditorRowTemplate *template in [predicateEditor rowTemplates] ) { for( NSView *aView in [template templateViews] ) { if(