Easy Question / Complicated buttons
Easy Question / Complicated buttons
- Subject: Easy Question / Complicated buttons
- From: Ken Tabb <email@hidden>
- Date: Fri, 27 Jul 2001 17:08:28 +0100
Hello again,
I'd like to make an 'up/down/left/right button' in my Cocoa app which
takes the form of a circle split into 4 segments (like a circle with an X
drawn in it to separate off the 4 buttons, and kind of like the
WebObjects 5 EOModeller icon but without the yellow centre). When the
user presses one of the 4 directions, I'd like that quarter to look like
it's been pressed (i.e. go dark grey / Aqua / Graphite), but the other
3/4 remain their previous shade (i.e. untouched).
Would this be 4 buttons or one single button with a sort of imagemap
event handler for mousepresses? If it's 4 buttons:
[1] Bearing in mind the 4 buttons' bounding rects will overlap (as the
buttons need to form a circle), how do I define an irregularly shaped
button (each of which consists of a triangle with an arc instead of a
line for the 3rd side (to form the circle's edge))? Or are mouseclick
regions based on transparency (in which case it won't matter that each
buttons' bounding rect overlaps with other buttons)?
If on the other hand it's the single button / imagemap solution:
[1] How do you define the imagemap boundaries, and which methods do you
override in order to determine which area the mouseclick was in?
[2] Do I decide which 'button depressed' image to show for the
meta-button on the fly (based on which quadrant the click was in)? If not
how do I provide the set of possible 'button depressed' images (one for
button-up clicked, one for button-down clicked etc).
I couldn't find mention of such buttons in the Aqua HIG (even the May
2001 final version) but I could be looking in all the wrong places. Or
hey maybe Apple think they look terrible and shouldn't be encouraged.
Pah, as if! 8^)
Yours puzzledly,
Ken
---------
Ken Tabb.
Mac & UNIX C/C++/Java developer (Health & Human Sciences),
Machine Vision researcher/programmer (Computer Science),
University of Hertfordshire, England
http://www.health.herts.ac.uk/ken/
Certified non-Microsoft Solution Provider