Re: AddressBook-like TextFields?
Re: AddressBook-like TextFields?
- Subject: Re: AddressBook-like TextFields?
- From: Justin Fagnani <email@hidden>
- Date: Fri, 20 May 2005 19:50:49 -0700
Thanks for all the replies. I just got back to my computer so it took
a little bit to digest everything.
On May 20, 2005, at 3:16 PM, Jiri Volejnik wrote:
AddressBook is probably using NSLayoutManager directly and some
custom subclass of NSView to layout and display the text. The text
field for editing appears on-demand only. It has been discussed
some time ago, so search the archives.
Cool, I just did and found a bunch of unanswered questions, and then
a reference to a WWDC 2003 presentation and some suggestions on how
it was done.
It seems like the form might just be one big TextView with drawRect,
and mouseDown (among others) overridden. Then maybe there's a table
that tracks each field in the record and it's associated indices in
the text. When the user clicks in a range that belongs to a field the
view selects the whole field and draws the border and drop shadow.
When a field is added or removed the text is updated accordingly.
Fields are probably separated by something as simple as a carriage
return.
If this is correct it seems both elegant and a hack (but I guess good
hacks are elegant). I would have thought there would be at least
separate cells for the fields, which would be a little more object-
oriented way to keep track of the data. This way might be easier to
get up and going, so I'll try and see how far I get. I'm not too
familiar with the text capabilities of Cocoa, but it looks like I'm
about to be.
here's the relevant thread:
http://www.cocoabuilder.com/archive/message/cocoa/2004/3/5/100879
-Justin
_______________________________________________
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