Address Book style card view
Address Book style card view
- Subject: Address Book style card view
- From: Nik Youdale <email@hidden>
- Date: Mon, 16 Jan 2006 00:17:53 +1100
Hi,
I know that this topic has come up many time before, as i have been
reading the archive to try and find a solution to my question.
Basically i need a view in which the text can be edited in distinct
cells (lines in my case) and then laid out like an ordinary textView.
What im trying to do is to create this view in such a way, so that it
looks and behaves like a textview, so i dont need any border around
the text cells when editing, or the shadow.
Now you may ask why not just use a TextView? It accomplishes exactly
what you want, so why re-invent the wheel!!! Well, the text on each
line, must be aligned with some other views, and each line also has
its own attributes, methods and variables, so instead of trying to
figure out what text is on each line, and then aligning my other
views with these lines, i thought i would create a custom view which
contains a textView and several other views as a class that i could
reuse. This custom view is used as a 'line' in a larger encapsulating
view which manages the creation and display of these subviews.
Now, I have got it displaying and editing like a textView when you
just use the keyboard. So you can type, press return to create a new
line, move around with the arrow keys, delete text and lines, etc...
But one element of functionality still remains.. and that is
selection - with the mouse and with the keyboard.
how do i select the text accross multiple lines with the mouse?? I Is
there some NSRect created when you click and drag, where you can tell
which objects lie underneath when you select them?
And also, if you select the text in one textView and then move on to
select the text a second textview, won't the first textView's
selection grey out as it loses first responder status?
Will it be neccessary to create my own selection mechanism
programmatically in the drawRect method of the encapsulating view, by
drawing a semi transparent blue rectangle over the top of the view?
From what I've read, this is a different approach to what Apple used
in their Address book, however this line based system that i
mentioned is paramount. As i only started with cocoa 2 months ago, my
idea of how to do this may not be completely logical to an
experienced programmer, however with my current level of knowledge it
appears to be the most logical thing to do.
Any help or suggestion would be very much appreciated, or even a
suggestion on how else i could achieve the same task. Please ask if
anything needs further clarification.
Cheers
- Nik
_______________________________________________
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