2003-07-31 23:52:10 +00:00
|
|
|
/*
|
|
|
|
NSComboBox.h
|
|
|
|
|
|
|
|
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Author: Gerrit van Dyk <gerritvd@decillion.net>
|
|
|
|
Date: 1999
|
|
|
|
|
|
|
|
This file is part of the GNUstep GUI Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2019-12-09 23:45:15 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
2003-07-31 23:52:10 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2019-12-09 23:45:15 +00:00
|
|
|
Lesser General Public License for more details.
|
2003-07-31 23:52:10 +00:00
|
|
|
|
2019-12-09 23:45:15 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2003-07-31 23:52:10 +00:00
|
|
|
License along with this library; see the file COPYING.LIB.
|
|
|
|
If not, write to the Free Software Foundation,
|
2006-11-06 13:58:37 +00:00
|
|
|
51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA.
|
2003-07-31 23:52:10 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GNUstep_H_NSComboBox
|
|
|
|
#define _GNUstep_H_NSComboBox
|
2006-11-06 13:58:37 +00:00
|
|
|
#import <GNUstepBase/GSVersionMacros.h>
|
2003-07-31 23:52:10 +00:00
|
|
|
|
2010-03-24 22:41:21 +00:00
|
|
|
#import <AppKit/NSTextField.h>
|
2003-07-31 23:52:10 +00:00
|
|
|
|
2010-03-24 22:41:21 +00:00
|
|
|
@class NSArray;
|
2004-05-29 13:17:21 +00:00
|
|
|
@class NSString;
|
|
|
|
@class NSNotification;
|
|
|
|
|
2003-07-31 23:52:10 +00:00
|
|
|
@interface NSComboBox : NSTextField
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL) hasVerticalScroller;
|
|
|
|
- (void) setHasVerticalScroller: (BOOL)flag;
|
|
|
|
|
|
|
|
- (NSSize) intercellSpacing;
|
|
|
|
- (void) setIntercellSpacing: (NSSize)aSize;
|
|
|
|
|
2013-02-17 00:49:04 +00:00
|
|
|
- (CGFloat) itemHeight;
|
|
|
|
- (void) setItemHeight: (CGFloat)itemHeight;
|
2003-07-31 23:52:10 +00:00
|
|
|
|
2013-01-30 12:43:27 +00:00
|
|
|
- (NSInteger) numberOfVisibleItems;
|
|
|
|
- (void) setNumberOfVisibleItems: (NSInteger)visibleItems;
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
- (void) reloadData;
|
|
|
|
- (void) noteNumberOfItemsChanged;
|
|
|
|
|
|
|
|
- (BOOL) usesDataSource;
|
|
|
|
- (void) setUsesDataSource: (BOOL)flag;
|
|
|
|
|
2013-01-30 12:43:27 +00:00
|
|
|
- (void) scrollItemAtIndexToTop: (NSInteger)index;
|
|
|
|
- (void) scrollItemAtIndexToVisible: (NSInteger)index;
|
2003-07-31 23:52:10 +00:00
|
|
|
|
2013-01-30 12:43:27 +00:00
|
|
|
- (void) selectItemAtIndex: (NSInteger)index;
|
|
|
|
- (void) deselectItemAtIndex: (NSInteger)index;
|
|
|
|
- (NSInteger) indexOfSelectedItem;
|
|
|
|
- (NSInteger) numberOfItems;
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
/* These two methods can only be used when usesDataSource is YES */
|
|
|
|
- (id) dataSource;
|
|
|
|
- (void) setDataSource: (id)aSource;
|
|
|
|
|
|
|
|
/* These methods can only be used when usesDataSource is NO */
|
|
|
|
- (void) addItemWithObjectValue: (id)object;
|
|
|
|
- (void) addItemsWithObjectValues: (NSArray *)objects;
|
2013-01-30 12:43:27 +00:00
|
|
|
- (void) insertItemWithObjectValue: (id)object atIndex:(NSInteger)index;
|
2003-07-31 23:52:10 +00:00
|
|
|
- (void) removeItemWithObjectValue: (id)object;
|
2013-01-30 12:43:27 +00:00
|
|
|
- (void) removeItemAtIndex: (NSInteger)index;
|
2003-07-31 23:52:10 +00:00
|
|
|
- (void) removeAllItems;
|
|
|
|
- (void) selectItemWithObjectValue: (id)object;
|
2013-01-30 12:43:27 +00:00
|
|
|
- (id) itemObjectValueAtIndex: (NSInteger)index;
|
2003-07-31 23:52:10 +00:00
|
|
|
- (id) objectValueOfSelectedItem;
|
2013-01-30 12:43:27 +00:00
|
|
|
- (NSInteger) indexOfItemWithObjectValue: (id)object;
|
2003-07-31 23:52:10 +00:00
|
|
|
- (NSArray *) objectValues;
|
|
|
|
|
2006-11-06 13:58:37 +00:00
|
|
|
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
2003-07-31 23:52:10 +00:00
|
|
|
/* text completion */
|
|
|
|
- (void) setCompletes: (BOOL)completes;
|
|
|
|
- (BOOL) completes;
|
|
|
|
#endif
|
2007-07-31 21:42:30 +00:00
|
|
|
|
|
|
|
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
|
|
|
- (BOOL) isButtonBordered;
|
|
|
|
- (void) setButtonBordered:(BOOL)flag;
|
|
|
|
#endif
|
2003-07-31 23:52:10 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface NSObject (NSComboBoxDataSource)
|
2013-01-30 12:43:27 +00:00
|
|
|
- (NSInteger) numberOfItemsInComboBox: (NSComboBox *)aComboBox;
|
|
|
|
- (id) comboBox: (NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index;
|
|
|
|
- (NSUInteger) comboBox: (NSComboBox *)aComboBox
|
2004-05-29 13:17:21 +00:00
|
|
|
indexOfItemWithStringValue: (NSString *)string;
|
2006-11-06 13:58:37 +00:00
|
|
|
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
2003-07-31 23:52:10 +00:00
|
|
|
/* text completion */
|
|
|
|
- (NSString *) comboBox: (NSComboBox *)aComboBox
|
|
|
|
completedString: (NSString *)aString;
|
|
|
|
#endif
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface NSObject (NSComboBoxNotifications)
|
|
|
|
- (void) comboBoxWillPopUp: (NSNotification *)notification;
|
|
|
|
- (void) comboBoxWillDismiss: (NSNotification *)notification;
|
|
|
|
- (void) comboBoxSelectionDidChange: (NSNotification *)notification;
|
|
|
|
- (void) comboBoxSelectionIsChanging: (NSNotification *)notification;
|
|
|
|
@end
|
|
|
|
|
|
|
|
APPKIT_EXPORT NSString *NSComboBoxWillPopUpNotification;
|
|
|
|
APPKIT_EXPORT NSString *NSComboBoxWillDismissNotification;
|
|
|
|
APPKIT_EXPORT NSString *NSComboBoxSelectionDidChangeNotification;
|
|
|
|
APPKIT_EXPORT NSString *NSComboBoxSelectionIsChangingNotification;
|
|
|
|
|
|
|
|
#endif /* _GNUstep_H_NSComboBox */
|