[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSToolbar implementation committed to CVS...
From: |
Quentin Mathé |
Subject: |
Re: NSToolbar implementation committed to CVS... |
Date: |
Wed, 25 Feb 2004 10:00:27 +0100 |
Le 25 févr. 04, à 04:37, Gregory John Casamento a écrit :
All,
Thanks to Quentin Mathe, NSToolbar's implementation has been completed
and has
been committed to CVS.
Currently the implemention is not complete, there still lot of work to
do, but the basic functionnality is here... What is missing ?
- selected mode
- size mode
- display mode
- possibility to move items in the toolbar
- customization
- some images
- some better way to handle the clipped items
and there is also few bugs I'm aware.
Quick overview of the design :
6 classes :
NSToolbar
NSToolbarItem
GSToolbarView
GSToolbarClippedItemsMark : NSView used to implement a way to use the
items which are clipped by the window resizing
GSToolbarBackView : NSView associated to each NSToolbarItem when there
is a custom view for the NSToolbarItem
GSToolbarButton : NSView associated to each NSToolbarItem when there is
no custom view for the NSToolbarItem (default button with target/action
mode)
1 category :
NSWindow+Toolbar (category on NSWindow which offers Cocoa compatibility
for the toolbar management at the window level and in a way which
leaves NSWindow class untouched)
Warning !
The tradeoffs of this implementation makes the Cocoa methods [NSWindow
contentView] [NSWindow setContentView] [NSWindow contentViewFrame:]
incompatible with GNUstep when a toolbar is used in cocoa way (by
calling [NSWindow+Toolbar setToolbar:]).
To make cocoa applications easier to port, the following methods has
been implemented : [NSWindow+Toolbar contentViewWithoutToolbar]
[NSWindow+Toolbar setContentViewWithoutToolbar] [NSWindow+Toolbar
contentViewFrameWithoutToolbar]. You must use theses methods with a
NSWindow (in place of the normal ones) when there is a toolbar attached
to it in your Cocoa application to have the same result.
Example...
#ifdef GNUSTEP
contentView = [window contentViewWithoutToolbar];
#else
contentView = [window contentView];
#endif
The other supported way (which is GNUstep specific) to use NSToolbar :
insert a GSToolbarView in your content view, create an NSToolbar, and
call setToolbar: on the GSToolbarView with the new toolbar. In a
window, it's possible to have many toolbars created in this way, but
some features are disabled like display mode and size mode. The last
two features only works with a window binded toolbar (attached to the
window by [NSWindow+Toolbar setToolbar:]) which are unique in each
window.
I'm working on the guidelines to use toolbars in GNUstep applications.
Broadcasting :
NSToolbar Cocoa bugs are fixed in my implementation by my broadcasting
solution : everything related to NSToolbar properly synchronizes when
there is a change made in a toolbar.
Warning !
Like in the Cocoa implementation the toolbar items unlike the toolbars
doesn't synchronize between them.
bye,
Quentin
--
Quentin Mathé
qmathe@club-internet.fr