|
|
NSTextArea with subview like address book
|
|
|
|
Registered User
Join Date: Feb 2003
Status:
Offline
|
|
In address book you have a basic template selection of fields inside of a NSTextArea, you can add more fields to the text area by the plus and minus buttons on the left hand side, the question is how did Apple do this. I found this:
http://www.stepwise.com/Articles/Tec...-12-20.01.html
However this is only inside of a NSTableView Rows meaning that all rows are the same height.
What is the best way of doing this, like Apple did or is that the way?
thanks
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status:
Offline
|
|
Originally posted by depolitic:
In address book you have a basic template selection of fields inside of a NSTextArea, you can add more fields to the text area by the plus and minus buttons on the left hand side, the question is how did Apple do this. I found this:
http://www.stepwise.com/Articles/Tec...-12-20.01.html
However this is only inside of a NSTableView Rows meaning that all rows are the same height.
What is the best way of doing this, like Apple did or is that the way?
thanks
I would very much like to know the answer to this question myself (see my thread of a week or so ago, about 2 NSTextView questions).
That is assuming you mean NSTextView not NSTextArea, which doesn't exist as far as I'm aware.
However, I'm not convinced that is actually what Apple are doing in the Address Book application. They may simply be using a whole lot of NSViews with a lot of complicated code to make sure they all stay in the right places and have the right dimensions.
For myself, I need to user to be able to control the layout of a particular type of document that is mostly attribtued string text, but also includes a table, and another block of text. Ideally, I would like to be able to have the table and block withing the main text view "in-line" with the other text. Is this what you mean?
|
|
|
|
|
|
|
|
|
Registered User
Join Date: Feb 2003
Status:
Offline
|
|
NSTextView it is just my Java background coming through. I am surprised that this address book trick is not better documented.
need to user to be able to control the layout of a particular type
YES, and I do agree that possible:
However, I'm not convinced that is actually what Apple are doing in the Address Book application. They may simply be using a whole lot of NSViews with a lot of complicated code to make sure they all stay in the right places and have the right dimensions.
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by Brass:
However, I'm not convinced that is actually what Apple are doing in the Address Book application. They may simply be using a whole lot of NSViews with a lot of complicated code to make sure they all stay in the right places and have the right dimensions.
My guess is it's a custom NSControl. Though I have used an NSView subclass to accomplish basically the same thing before. It's not very difficult or even CPU-intensive to calculate where the fields should go.
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Senior User
Join Date: Aug 2002
Location: Oxford, England
Status:
Offline
|
|
Theres sample code available from WWDC 2003 Session 424: Cocoa Tips and Tricks, called 'RaisedEditor' which demonstrates this. If anyone has this code, I'd be greatful if they'd post, or e-mail it.
|
Luke
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
Techically, that code can't be shared. It makes sense that they embargo the WWDC sample code when it's for a prerelease OS, but Panther's been out for ten months now. </rant>
Anyway, the gist of it... the entire "card" area in Address Book (and the similar area in iCal's drawer) is a single NSTextView subclass, not a collection of fields/popups/etc. The subclass customizes the location and display style of text within it according to mouseMoved events and the text cursor location.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|