• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AddressBook-like TextFields?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: AddressBook-like TextFields? (From: Jiri Volejnik <email@hidden>)
 >Re: AddressBook-like TextFields? (From: Corbin Dunn <email@hidden>)
 >Re: AddressBook-like TextFields? (From: Jiri Volejnik <email@hidden>)
 >Re: AddressBook-like TextFields? (From: Corbin Dunn <email@hidden>)

  • Prev by Date: Online Help Creation in XCODE
  • Next by Date: Re: Can an object's relationship point to itself?
  • Previous by thread: Re: AddressBook-like TextFields?
  • Next by thread: Re: AddressBook-like TextFields?
  • Index(es):
    • Date
    • Thread