Design Q: custom control or Matrix?
Design Q: custom control or Matrix?
- Subject: Design Q: custom control or Matrix?
- From: Ken Tabb <email@hidden>
- Date: Fri, 2 Apr 2004 16:30:41 +0100
Hi folks,
I'm after a bit of advice. I'm implementing an NSControl subclass which
acts not unlike a simplified version of GarageBand's track view (the
bit that takes up most of the window, where you move / resize loops).
The control has multiple cells, each cell being a 'row' in the control.
Each cell's visual appearance is a rounded rect which occupies a part
of its row (i.e. there is only one rounded rect per row). The control /
matrix itself needs to be scrollable both horizontally (as the width of
each row needs to be extendable) and vertically (as the number of rows
will change programmatically).
Within a row, the rounded rect needs to be selectable, movable
(horizontally along its row) and resizable (i.e. the rounded rect's
width changes). In addition, multiple rows need to be selectable (so
the control needs to coordinate multiple selections).
I read the NSMatrix docs, including the Cocoa Programming (Scott
Anguish et al.) sections on it, and it seemed initially as though this
wasn't suitable for my task. I wish I could remember why now, as it
would make my argument sound a whole lot more watertight. So I
undertook writing my own NSControl subclass, which manages mouse events
/ cell selection etc. However, this seems to be rather more work than I
was hoping (OK so I have become overly dependent on Foundation & AppKit
to do all the hard work for me!). Now that I re-read the NSMatrix stuff
it seems I might have previously been unwise in not choosing it as the
basis for my control! I'm now at the stage where I'd be happy
re-implementing it all as an NSMatrix if I knew it was suitable, but I
don't want to potentially rip up what I've done and explore NSMatrix
just to find out that it wasn't suitable after all and that I have to
go back to the custom control route.
I'd welcome any thoughts you have on the matter, whether using a matrix
would limit me, or conversely whether it would enable me to do a load
of stuff better. If anything needs making clearer, let me know.
Thanks in advance for any tips,
Ken
- - - - - - - - - -
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.