mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
Added aditional methods for text completion
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@9541 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
503a6b6715
commit
7630d53c8a
3 changed files with 41 additions and 0 deletions
|
@ -77,6 +77,12 @@
|
|||
- (int)indexOfItemWithObjectValue:(id)object;
|
||||
- (NSArray *)objectValues;
|
||||
|
||||
#ifndef STRICT_OPENSTEP
|
||||
/* text completion */
|
||||
- (void)setCompletes:(BOOL)completes;
|
||||
- (BOOL)completes;
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (NSComboBoxDataSource)
|
||||
|
@ -84,6 +90,11 @@
|
|||
- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)index;
|
||||
- (unsigned int)comboBox:(NSComboBox *)aComboBox
|
||||
indexOfItemWithStringValue:(NSString *)string;
|
||||
#ifndef STRICT_OPENSTEP
|
||||
/* text completion */
|
||||
- (NSString *)comboBox:(NSComboBox *)aComboBox
|
||||
completedString:(NSString *)aString;
|
||||
#endif
|
||||
@end
|
||||
|
||||
@interface NSObject (NSComboBoxNotifications)
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
NSMutableArray *_popUpList;
|
||||
BOOL _usesDataSource;
|
||||
BOOL _hasVerticalScroller;
|
||||
BOOL _completes;
|
||||
int _visibleItems;
|
||||
NSSize _intercellSpacing;
|
||||
float _itemHeight;
|
||||
|
@ -95,6 +96,12 @@
|
|||
- (int)indexOfItemWithObjectValue:(id)object;
|
||||
- (NSArray *)objectValues;
|
||||
|
||||
#ifndef STRICT_OPENSTEP
|
||||
/* text completion */
|
||||
- (NSString *)completedString:(NSString *)substring;
|
||||
- (void)setCompletes:(BOOL)completes;
|
||||
- (BOOL)completes;
|
||||
#endif
|
||||
@end
|
||||
|
||||
@interface NSObject (NSComboBoxCellDataSource)
|
||||
|
@ -103,6 +110,11 @@
|
|||
objectValueForItemAtIndex:(int)index;
|
||||
- (unsigned int)comboBoxCell:(NSComboBoxCell *)aComboBoxCell
|
||||
indexOfItemWithStringValue:(NSString *)string;
|
||||
#ifndef STRICT_OPENSTEP
|
||||
/* text completion */
|
||||
- (NSString *)comboBoxCell:(NSComboBoxCell *)aComboBoxCell
|
||||
completedString:(NSString *)uncompletedString;
|
||||
#endif
|
||||
@end
|
||||
|
||||
#endif /* _GNUstep_H_NSComboBoxCell */
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
//_buttonCell = nil;
|
||||
_popUpList = [[NSMutableArray alloc] init];
|
||||
//_usesDataSource = NO;
|
||||
//_completes = NO;
|
||||
_visibleItems = 10;
|
||||
_intercellSpacing = NSZeroSize;
|
||||
_itemHeight = 14;
|
||||
|
@ -296,6 +297,23 @@
|
|||
return _popUpList;
|
||||
}
|
||||
|
||||
// Text completion
|
||||
- (NSString *)completedString:(NSString *)substring
|
||||
{
|
||||
// FIXME
|
||||
return substring;
|
||||
}
|
||||
|
||||
- (void)setCompletes:(BOOL)completes
|
||||
{
|
||||
_completes = completes;
|
||||
}
|
||||
|
||||
- (BOOL)completes
|
||||
{
|
||||
return _completes;
|
||||
}
|
||||
|
||||
- (void)performPopUsingSelector:(SEL)aSelector
|
||||
inRect:(NSRect)cellFrame
|
||||
ofView:(NSView *)controlView
|
||||
|
|
Loading…
Reference in a new issue