Newbie design Q: Info palettes & controllers
Newbie design Q: Info palettes & controllers
- Subject: Newbie design Q: Info palettes & controllers
- From: Ken Tabb <email@hidden>
- Date: Fri, 11 Jun 2004 15:15:26 +0100
Hi folks,
I'm just (finally) getting started with controllers, now that I have
some spare time (and want to get used to controllers enough to
understand anything that's said about them at WWDC). Forgive me if the
rest of the mail makes false assumptions about how much work I could
get controllers to do for me!
I have an application that is not unlike a drawing app, in the sense
there are different graphical objects in the same view (of a document)
which can be selected individually or together. And I'd like to
implement an inspector palette to display the properties of those
objects when they're selected.
I've looked at Sketch, but it seems to be geared up to every type of
object having the same features (eg. colour, width / height etc.),
therefore the same set of fields on the palette work across all
objects.
My object types will each have different characteristics from each
other, and there are a sufficient number of different types of object
that, were I to end up with (using a drawing app analogy) a tab for
circle's attributes, another for square's, another for line's... then
I'd have over 25 tabs in the inspector (which even if it was controlled
via a popup menu would be a bit unwieldy). Therefore I'd like the
inspector to show only those tabs which are pertinent to the selected
object(s) type(s); there should only be 5-6 that are relevant at any
one point in time (which seems a bit more wieldy). Furthermore it seems
that using controllers to auto-synch the properties would be
beneficial, and save a whole lot of glue that I'd otherwise have to
write.
So I have a couple of questions about this:
[1] If my document has an array of the graphical objects, and my
palette needs to display things about a single object, or group of
objects, that are selected, do I need an ArrayController instead of an
ObjectController?
[2] When a different object has been selected, would I still inform the
palette that a new selection has been made using Notifications, or
would the controller make it easier to update the values (and available
tabs) in the palette automagically?
[3] Ditto to [2] but with different document windows becoming selected
(it's a document based app)
[4] I'd like a group of selected objects to show the union of features
in the palette, therefore if a circle and square are selected, I'd like
to show all the circle tabs and all the square tabs, as well as any
tabs which both types of object use. How is this most easily achieved?
[5] I'd also like to be able to disable the tabs and or on-screen
checkboxes etc. if they're irrelevant to the currently selected
object(s). Is there some way controllers can be used to say "this
object doesn't have a key called foobarAttribute, so I'll disable the
foobarAttributeCheckbox"?
[6] Is it reasonable to load the palette class with every type of
object's attribute views (the things that display in tabs on the
palette), or should each type of object supply their own views to be
shown, eg. a circle would keep a view allowing "diameter, radius,
circumference etc." on it?
Thanks in advance for any help you can give; I'm not expecting code,
just to be pointed in the right direction. But hey I wouldn't turn down
code either 8^)
Cheers,
Ken
- - - - - - - - - -
Dr. Ken Tabb
Mac & UNIX Technical bloke (C, C++, Obj-C, Java) - Health & Human
Sciences
Machine Vision & Neural Network researcher bloke - Computer Science Dept
University of Hertfordshire, UK
http://www.health.herts.ac.uk/ken/
Certified non-Microsoft Solution Provider
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.