• 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 card view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AddressBook card view


  • Subject: Re: AddressBook card view
  • From: Robert Goldsmith <email@hidden>
  • Date: Sun, 23 Jan 2005 05:13:41 +0000

Can anyone hazard a guess as to how the view that displays/edits cards
in AddressBook works?  It looks like more than a matrix of composite
cells.

The view is a custom subclass of NSTextView called ABTextView. It uses custom fields in attributed strings to mark out areas associated with various fields and a combination of NSTextView and NSLayoutManager modifications along with an ABIOController to cope with editing and rendering. The red and green elements in edit and template mode are controlled by a custom NSRuler subclass (ABRuler). The images, popups and tick-boxes are a subclass of NSImage, NSPopupButton and NSButton that are attached to the text using 'NSAttachmentAttributeName' attribute entries in it's attribute dictionary.


I assume an NSTextView was used to allow the most flexible layout possible while still allowing the user to select and copy text from the view as if it was a normal block of text.

Anyhow, it was a bit of a pain to work out but at least this approach made it reasonably easy to inject additional fields .. :D

In case you are wondering, I'm using the Address Book plugin architecture to inject GPG/PGP key viewing/editing controls and the ability to set gpgMail preferences (such as whether to encrypt to a certain email address) on a person by person level :)

Robert Goldsmith

---
GnuPG public key:
http://www.Far-Blue.co.uk

Attachment: PGP.sig
Description: This is a digitally signed message part

 _______________________________________________
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: 
 >AddressBook card view (From: Eric Friedman <email@hidden>)

  • Prev by Date: TableView cell with image?
  • Next by Date: Re: XCode: generate KVC compliant method bodies from header
  • Previous by thread: Re: AddressBook card view
  • Next by thread: NSSplitView Messing Up Custom Views
  • Index(es):
    • Date
    • Thread