Re: Photoshop style palettes, layers & UI
Re: Photoshop style palettes, layers & UI
- Subject: Re: Photoshop style palettes, layers & UI
- From: John Hörnkvist <email@hidden>
- Date: Fri, 28 Sep 2001 21:10:59 +0200
On Friday, September 28, 2001, at 08:52 PM, Brian Hook wrote:
I'm starting work on my first document based application, and it's
fairly large. Hey, gotta learn somehow =)
In short, it's a kind of image editing software, where I'll have two
views onto a piece of data (a 2D and a 3D view), along with multiple
tool palettes. This is very similar to Photoshop where you have a
single window per image, and a set of panels with various functionality:
- Tool selection, which looks like it could be done as an NSMatrix of
NSButtonCells in radio button mode.
- Info panel, which shows various information like the X,Y of the
cursor, W/H of the selection, etc.
- Tool options toolbar: This changes depending on the currently active
tool, and is a dockable toolbar in the application window (I'm looking
at my Win32 Photoshop 6.0 so I'm not sure how this is handled in
MacOS/OS X).
Why not use the standard toolbar?
- Layers/Channels/Paths panel
I think I have a pretty good idea of the basics of doing a multiple
document app, but some questions have already popped up:
1. Should each panel have its own NIB, or should they all just go into
the Main.Nib?
Put each window in a separate NIB, usually owned by an
NSWindowController subclass.
2. I'm assuming that the document's NIB will have both of the windows
in it.
I'd split it over two nibs NIB files and two window controllers.
Regard the document (NSDocument subclass) as a model (or
model-controller) class, and don't turn it into a view-controller.
3. What's the right way to change the appearance (drastically) of an
existing panel? For example, say I have a panel that is context
sensitive to the currently selected tool. Would I programmatically just
remove and add controls, or would I just have two separate panels and
have them hide/unhide appropriately?
NSTabView is pretty good for this. For more flexibility, you can add and
remove views, but that requires more care.
4. For the layer view, there is a stack of cells that basically show
the operations that you've done and in what order. You can remove
cells, or drag and drop cells to re-order them. Is this something that
should be a subclass of NSMatrix, or will I need to do something even
more customized? Does NSMatrix require all of its cells to be of the
same type? Unfortunately, each layer cell that I'm envisioning may have
a slightly different appearance (or even subcontrols) depending on how
that layer was created.
It sound like it could be done with NSMatrix. Sometimes it's easier to
just write your own view class, though.
Regards,
John Hornkvist
--
ToastedMarshmallow, the perfect Cocoa companion
http://www.toastedmarshmallow.com