2 // DBPrefsWindowController.h
4 // Created by Dave Batton
5 // http://www.Mere-Mortal-Software.com/blog/
7 // Documentation for this class is available here:
8 // http://www.mere-mortal-software.com/blog/details.php?d=2007-03-11
10 // Copyright 2007. Some rights reserved.
11 // This work is licensed under a Creative Commons license:
12 // http://creativecommons.org/licenses/by/3.0/
14 // 11 March 2007 : Initial 1.0 release
15 // 15 March 2007 : Version 1.1
16 // Resizing is now handled along with the cross-fade by
17 // the NSViewAnimation routine.
18 // Cut the fade time in half to speed up the window resize.
19 // -setupToolbar is now called each time the window opens so
20 // you can configure it differently each time if you want.
21 // Holding down the shift key will now slow down the animation.
22 // This can be disabled by using the new -setShiftSlowsAnimation:
24 // 23 March 2007 : Version 1.1.1
25 // The initial first responder now gets set when the view is
26 // swapped so that the user can tab to the objects displayed
28 // Also added a work-around to Cocoa's insistance on drawing
29 // a focus ring around the first toolbar icon when going from
30 // a view with a focusable item to a view without a focusable item.
32 // 31 May 2007 : Version 1.1.2
33 // The window's title bar and toolbar heights are now calculated at
34 // runtime, rather than being hard-coded.
35 // Fixed a redraw problem and a window placement problem associated
36 // with large preference windows.
37 // Added some code to supress compiler warnings from unused parameters.
38 // Fixed a couple of objects that weren't being properly released.
42 #import <Cocoa/Cocoa.h>
45 @interface DBPrefsWindowController
: NSWindowController
{
46 NSMutableArray
*toolbarIdentifiers
;
47 NSMutableDictionary
*toolbarViews
;
48 NSMutableDictionary
*toolbarItems
;
51 BOOL _shiftSlowsAnimation
;
53 NSView
*contentSubview
;
54 NSViewAnimation
*viewAnimation
;
56 NSString
*currentPaneIdentifier
;
60 + (DBPrefsWindowController
*)sharedPrefsWindowController
;
61 + (NSString
*)nibName
;
64 - (void)addView
:(NSView
*)view label
:(NSString
*)label
;
65 - (void)addView
:(NSView
*)view label
:(NSString
*)label image
:(NSImage
*)image
;
68 - (void)setCrossFade
:(BOOL
)fade
;
69 - (BOOL
)shiftSlowsAnimation
;
70 - (void)setShiftSlowsAnimation
:(BOOL
)slows
;
72 - (void)displayViewForIdentifier
:(NSString
*)identifier animate
:(BOOL
)animate
;
73 - (void)crossFadeView
:(NSView
*)oldView withView
:(NSView
*)newView
;
74 - (NSRect
)frameForView
:(NSView
*)view
;