Re: doubling up a NSCell for an NSTableColumn
Re: doubling up a NSCell for an NSTableColumn
- Subject: Re: doubling up a NSCell for an NSTableColumn
- From: Joshua Moody <email@hidden>
- Date: Wed, 15 Nov 2006 23:32:31 -0800
Darrin Cardani, <email_removed>, wrote:
I've done something like it. I made a single cell that has both a
text field and a stepper (little arrow controls). The way I did it
was to create a subclass of NSActionCell that contained both an
NSStepperCell and an NSTextFieldCell.
I've followed your suggestion and subclassed NSActionCell as you
suggested, but I'm struggling with the details.
If you need more details, let me know.
Could you provide an example? The drawing, editing, and selecting
portions are where I am having trouble.
Many thanks,
jjm
FROM : Jonathan 'Wolf' Rentzsch
DATE : Sun Jun 13 05:32:53 2004
Darrin Cardani, <email_removed>, wrote:
I've done something like it. I made a single cell that has both a
text field and a stepper (little arrow controls). The way I did it
was to create a subclass of NSActionCell that contained both an
NSStepperCell and an NSTextFieldCell.
Ah yes. I remember telling you that's what you'd need to do at the
last
PSIG :-)
The main functions I had to
override were -drawWithFrame:inView:,
-editWithFrame:inView:editor:delegate:event:, and the tracking
methods. You might not need the tracking methods, I'm not sure. In
-editWithFrame:..., I always have it call the text field's
-editWithFrame:... method, though you'll probably need to check the
mouse coords in the event to see which one it should call. I also had
to modify the rectangle I sent to the text field's edit method and
draw methods to only draw (or edit) in half the cell.
I also had to override -setObjectValue: and -objectValue, of course,
and don't forget to implement -copyWithZone:. That one bit me hard,
because NSOutlineView likes to make lots of copies of the cell. If
you need more details, let me know.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden