From 13f8324f106f6e09d675e3df04f0d5e56fec80da Mon Sep 17 00:00:00 2001 From: FredKiefer Date: Mon, 9 Apr 2001 21:24:53 +0000 Subject: [PATCH] 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 --- Headers/gnustep/gui/NSComboBox.h | 11 +++++++++++ Headers/gnustep/gui/NSComboBoxCell.h | 12 ++++++++++++ Source/NSComboBoxCell.m | 18 ++++++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/Headers/gnustep/gui/NSComboBox.h b/Headers/gnustep/gui/NSComboBox.h index 1358809b8..8bb342161 100644 --- a/Headers/gnustep/gui/NSComboBox.h +++ b/Headers/gnustep/gui/NSComboBox.h @@ -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) diff --git a/Headers/gnustep/gui/NSComboBoxCell.h b/Headers/gnustep/gui/NSComboBoxCell.h index 08b3eb08c..217093cff 100644 --- a/Headers/gnustep/gui/NSComboBoxCell.h +++ b/Headers/gnustep/gui/NSComboBoxCell.h @@ -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 */ diff --git a/Source/NSComboBoxCell.m b/Source/NSComboBoxCell.m index 039739234..c1f817a97 100644 --- a/Source/NSComboBoxCell.m +++ b/Source/NSComboBoxCell.m @@ -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