Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 80 lines (66 sloc) 3.137 kb
720b0e7 @uliwitness Added licensing information to the source files.
authored
1 //
2 // UKPrefsPanel.h
3 // Shovel
4 //
5 // Created by Uli Kusterer on 30.6.2003.
6 // Copyright 2003 Uli Kusterer.
7 //
8 // This software is provided 'as-is', without any express or implied
9 // warranty. In no event will the authors be held liable for any damages
10 // arising from the use of this software.
11 //
12 // Permission is granted to anyone to use this software for any purpose,
13 // including commercial applications, and to alter it and redistribute it
14 // freely, subject to the following restrictions:
15 //
16 // 1. The origin of this software must not be misrepresented; you must not
17 // claim that you wrote the original software. If you use this software
18 // in a product, an acknowledgment in the product documentation would be
19 // appreciated but is not required.
20 //
21 // 2. Altered source versions must be plainly marked as such, and must not be
22 // misrepresented as being the original software.
23 //
24 // 3. This notice may not be removed or altered from any source
25 // distribution.
26 //
dc5be1c Initial check-in.
uli authored
27
720b0e7 @uliwitness Added licensing information to the source files.
authored
28 /*
29 A class that creates a simple Safari-like Preferences window with a
dc5be1c Initial check-in.
uli authored
30 toolbar at the top.
31
32 UKPrefsPanel is ridiculously easy to use: Create a tabless NSTabView,
33 where the name of each tab is the name for the toolbar item, and the
34 identifier of each tab is the identifier to be used for the toolbar
35 item to represent it. Then create image files with the identifier as
36 their names to be used as icons in the toolbar.
37
38 Finally, drag UKPrefsPanel.h into the NIB with the NSTabView,
39 instantiate a UKPrefsPanel and connect its tabView outlet to your
40 NSTabView. When you open the window, the UKPrefsPanel will
41 automatically add a toolbar to the window with all tabs represented by
42 a toolbar item, and clicking an item will switch between the tab view's
720b0e7 @uliwitness Added licensing information to the source files.
authored
43 items.
44 */
dc5be1c Initial check-in.
uli authored
45
46 /* -----------------------------------------------------------------------------
47 Headers:
48 -------------------------------------------------------------------------- */
49
50 #import <Foundation/Foundation.h>
51
52
53 /* -----------------------------------------------------------------------------
54 Classes:
55 -------------------------------------------------------------------------- */
56
57 @interface UKPrefsPanel : NSObject
58 {
59 IBOutlet NSTabView* tabView; ///< The tabless tab-view that we're a switcher for.
60 NSMutableDictionary* itemsList; ///< Auto-generated from tab view's items.
61 NSString* baseWindowName; ///< Auto-fetched at awakeFromNib time. We append a colon and the name of the current page to the actual window title.
62 NSString* autosaveName; ///< Identifier used for saving toolbar state and current selected page of prefs window.
63 }
64
65 /// Mutator for specifying the tab view: (you should just hook this up in IB)
66 -(void) setTabView: (NSTabView*)tv;
67 -(NSTabView*) tabView; ///< Accessor for tab view containing the different pref panes.
68
69 -(void) setAutosaveName: (NSString*)name;
70 -(NSString*) autosaveName;
71
72 // Action for hooking up this object and the menu item:
73 -(IBAction) orderFrontPrefsPanel: (id)sender;
74
75 // You don't have to care about these:
76 -(void) mapTabsToToolbar;
77 -(IBAction) changePanes: (id)sender;
78
79 @end
Something went wrong with that request. Please try again.