1 /*
2    NSPopUpButton.h
3 
4    Popup list class
5 
6    Copyright (C) 1996 Free Software Foundation, Inc.
7 
8    Author:  Scott Christley <scottc@net-community.com>
9    Date: 1996
10    Author:  Michael Hanni <mhanni@sprintmail.com>
11    Date: 1999
12 
13    This file is part of the GNUstep GUI Library.
14 
15    This library is free software; you can redistribute it and/or
16    modify it under the terms of the GNU Lesser General Public
17    License as published by the Free Software Foundation; either
18    version 2 of the License, or (at your option) any later version.
19 
20    This library is distributed in the hope that it will be useful,
21    but WITHOUT ANY WARRANTY; without even the implied warranty of
22    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
23    Lesser General Public License for more details.
24 
25    You should have received a copy of the GNU Lesser General Public
26    License along with this library; see the file COPYING.LIB.
27    If not, see <http://www.gnu.org/licenses/> or write to the
28    Free Software Foundation, 51 Franklin Street, Fifth Floor,
29    Boston, MA 02110-1301, USA.
30 */
31 
32 #ifndef _GNUstep_H_NSPopUpButton
33 #define _GNUstep_H_NSPopUpButton
34 
35 #import <Foundation/NSGeometry.h>
36 
37 #import <AppKit/AppKitDefines.h>
38 #import <AppKit/NSButton.h>
39 #import <AppKit/NSMenuItem.h>
40 
41 @class NSString;
42 @class NSArray;
43 
44 
45 @interface NSPopUpButton : NSButton
46 {
47 }
48 
49 //
50 // Initializing an NSPopUpButton
51 //
52 - (id)initWithFrame:(NSRect)frameRect
53 	  pullsDown:(BOOL)flag;
54 
55 - (void)setPullsDown:(BOOL)flag;
56 - (BOOL)pullsDown;
57 - (void)setAutoenablesItems:(BOOL)flag;
58 - (BOOL)autoenablesItems;
59 - (void)addItemWithTitle:(NSString *)title;
60 - (void)addItemsWithTitles:(NSArray *)itemTitles;
61 - (void)insertItemWithTitle:(NSString *)title
62                     atIndex:(NSInteger)index;
63 - (void)removeAllItems;
64 - (void)removeItemWithTitle:(NSString *)title;
65 - (void)removeItemAtIndex:(NSInteger)index;
66 - (id <NSMenuItem>)selectedItem;
67 - (NSString *)titleOfSelectedItem;
68 - (NSInteger)indexOfSelectedItem;
69 - (void)selectItem:(id <NSMenuItem>)anObject;
70 - (void)selectItemAtIndex:(NSInteger)index;
71 - (void)selectItemWithTitle:(NSString *)title;
72 #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
73 - (BOOL) selectItemWithTag: (NSInteger)tag;
74 #endif
75 - (NSInteger)numberOfItems;
76 - (NSArray *)itemArray;
77 - (id <NSMenuItem>)itemAtIndex:(NSInteger)index;
78 - (NSString *)itemTitleAtIndex:(NSInteger)index;
79 - (NSArray *)itemTitles;
80 - (id <NSMenuItem>)itemWithTitle:(NSString *)title;
81 - (id <NSMenuItem>)lastItem;
82 - (NSInteger)indexOfItem:(id <NSMenuItem>)anObject;
83 - (NSInteger)indexOfItemWithTag:(NSInteger)tag;
84 - (NSInteger)indexOfItemWithTitle:(NSString *)title;
85 - (NSInteger)indexOfItemWithRepresentedObject:(id)anObject;
86 - (NSInteger)indexOfItemWithTarget:(id)target
87                    andAction:(SEL)actionSelector;
88 - (void)setPreferredEdge:(NSRectEdge)edge;
89 - (NSRectEdge)preferredEdge;
90 - (void)setTitle:(NSString *)aString;
91 - (void)synchronizeTitleAndSelectedItem;
92 @end
93 
94 APPKIT_EXPORT NSString *NSPopUpButtonWillPopUpNotification;
95 
96 #endif // _GNUstep_H_NSPopUpButton
97