mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:10:48 +00:00
Extension of drawing functions and corrections for combo box.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@19430 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6f6e65c79f
commit
c58c1924d8
5 changed files with 122 additions and 69 deletions
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
||||||
|
2004-05-31 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Headers/Additions/GNUstepGUI/GSDrawFunctions.h:
|
||||||
|
* Source/GSDrawFunctions.m: (-drawDarkButton::) New
|
||||||
|
method. Changed all methods to return the interior rectangle.
|
||||||
|
based on patch by Nicolas Roard <nicolas@roard.com>.
|
||||||
|
* Source/NSComboBoxCell.m: (-_selectCompleted) new method to
|
||||||
|
handle completion of selection in data source case correctly.
|
||||||
|
(-popUpForComboBoxCell:) use this method and also clear
|
||||||
|
selection at the end, so a new popup starts without selection.
|
||||||
|
(-selectItemAtIndex:) simplified and return when invalid
|
||||||
|
index is given. (-_loadButtonCell) always use image name
|
||||||
|
"NSComboArrow" and removed force arrow variable.
|
||||||
|
* Images/nsmapping.strings: mapping "NSComboArrow" to
|
||||||
|
"common_ComboBoxEllipsis".
|
||||||
|
|
||||||
2004-05-29 Quentin Mathe <qmathe@lub-internet.fr>
|
2004-05-29 Quentin Mathe <qmathe@lub-internet.fr>
|
||||||
|
|
||||||
* Source/NSComboBoxCell.m: Fixed problems related to decoding an encoded
|
* Source/NSComboBoxCell.m: Fixed problems related to decoding an encoded
|
||||||
|
|
|
@ -35,13 +35,14 @@
|
||||||
|
|
||||||
@interface GSDrawFunctions : NSObject
|
@interface GSDrawFunctions : NSObject
|
||||||
|
|
||||||
+ (void) drawButton: (NSRect)border : (NSRect)clip;
|
+ (NSRect) drawButton: (NSRect)border : (NSRect)clip;
|
||||||
+ (void) drawDarkBezel: (NSRect)border : (NSRect)clip;
|
+ (NSRect) drawDarkButton: (NSRect)border : (NSRect)clip;
|
||||||
+ (void) drawLightBezel: (NSRect) border : (NSRect)clip;
|
+ (NSRect) drawDarkBezel: (NSRect)border : (NSRect)clip;
|
||||||
+ (void) drawGrayBezel: (NSRect)border : (NSRect)clip;
|
+ (NSRect) drawLightBezel: (NSRect)border : (NSRect)clip;
|
||||||
+ (void) drawWhiteBezel: (NSRect) border : (NSRect)clip;
|
+ (NSRect) drawGrayBezel: (NSRect)border : (NSRect)clip;
|
||||||
+ (void) drawGroove: (NSRect)border : (NSRect)clip;
|
+ (NSRect) drawWhiteBezel: (NSRect)border : (NSRect)clip;
|
||||||
+ (void) drawFramePhoto: (NSRect)border : (NSRect)clip;
|
+ (NSRect) drawGroove: (NSRect)border : (NSRect)clip;
|
||||||
|
+ (NSRect) drawFramePhoto: (NSRect)border : (NSRect)clip;
|
||||||
|
|
||||||
+ (NSRect) drawGradientBorder: (NSGradientType)gradientType
|
+ (NSRect) drawGradientBorder: (NSGradientType)gradientType
|
||||||
inRect: (NSRect)border
|
inRect: (NSRect)border
|
||||||
|
|
|
@ -9,4 +9,5 @@ NSHighlightedRadioButton = common_RadioOn;
|
||||||
AppleMenuImage = GNUstepMenuImage;
|
AppleMenuImage = GNUstepMenuImage;
|
||||||
NSMenuCheckmark = common_2DCheckMark;
|
NSMenuCheckmark = common_2DCheckMark;
|
||||||
NSMenuArrow = common_3DArrowRight;
|
NSMenuArrow = common_3DArrowRight;
|
||||||
NSMenuMixedState = common_2DDash;
|
NSMenuMixedState = common_2DDash;
|
||||||
|
NSComboArrow = common_ComboBoxEllipsis;
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
@implementation GSDrawFunctions
|
@implementation GSDrawFunctions
|
||||||
|
|
||||||
/** Draw a button border */
|
/** Draw a button border */
|
||||||
+ (void) drawButton: (NSRect)border : (NSRect)clip
|
+ (NSRect) drawButton: (NSRect)border : (NSRect)clip
|
||||||
{
|
{
|
||||||
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge,
|
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge,
|
||||||
NSMinXEdge, NSMaxYEdge,
|
NSMinXEdge, NSMaxYEdge,
|
||||||
|
@ -68,16 +68,38 @@
|
||||||
|
|
||||||
if ([[NSView focusView] isFlipped] == YES)
|
if ([[NSView focusView] isFlipped] == YES)
|
||||||
{
|
{
|
||||||
NSDrawColorTiledRects(border, clip, dn_sides, colors, 6);
|
return NSDrawColorTiledRects(border, clip, dn_sides, colors, 6);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSDrawColorTiledRects(border, clip, up_sides, colors, 6);
|
return NSDrawColorTiledRects(border, clip, up_sides, colors, 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Draw a "dark" button border (used in tableviews) */
|
||||||
|
+ (NSRect) drawDarkButton: (NSRect)border : (NSRect)clip
|
||||||
|
{
|
||||||
|
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge,
|
||||||
|
NSMinXEdge, NSMaxYEdge};
|
||||||
|
NSRectEdge dn_sides[] = {NSMaxXEdge, NSMaxYEdge,
|
||||||
|
NSMinXEdge, NSMinYEdge};
|
||||||
|
// These names are role names not the actual colours
|
||||||
|
NSColor *black = [NSColor controlDarkShadowColor];
|
||||||
|
NSColor *white = [NSColor controlHighlightColor];
|
||||||
|
NSColor *colors[] = {black, black, white, white};
|
||||||
|
|
||||||
|
if ([[NSView focusView] isFlipped] == YES)
|
||||||
|
{
|
||||||
|
return NSDrawColorTiledRects(border, clip, dn_sides, colors, 4);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NSDrawColorTiledRects(border, clip, up_sides, colors, 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Draw a dark bezel border */
|
/** Draw a dark bezel border */
|
||||||
+ (void) drawDarkBezel: (NSRect)border : (NSRect)clip
|
+ (NSRect) drawDarkBezel: (NSRect)border : (NSRect)clip
|
||||||
{
|
{
|
||||||
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge,
|
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge,
|
||||||
NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge};
|
NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge};
|
||||||
|
@ -90,10 +112,11 @@
|
||||||
NSColor *white = [NSColor controlLightHighlightColor];
|
NSColor *white = [NSColor controlLightHighlightColor];
|
||||||
NSColor *colors[] = {white, white, dark, dark,
|
NSColor *colors[] = {white, white, dark, dark,
|
||||||
black, black, light, light};
|
black, black, light, light};
|
||||||
|
NSRect rect;
|
||||||
|
|
||||||
if ([[NSView focusView] isFlipped] == YES)
|
if ([[NSView focusView] isFlipped] == YES)
|
||||||
{
|
{
|
||||||
NSDrawColorTiledRects(border, clip, dn_sides, colors, 8);
|
rect = NSDrawColorTiledRects(border, clip, dn_sides, colors, 8);
|
||||||
|
|
||||||
[dark set];
|
[dark set];
|
||||||
PSrectfill(NSMinX(border) + 1., NSMinY(border) - 2., 1., 1.);
|
PSrectfill(NSMinX(border) + 1., NSMinY(border) - 2., 1., 1.);
|
||||||
|
@ -101,16 +124,17 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSDrawColorTiledRects(border, clip, up_sides, colors, 8);
|
rect = NSDrawColorTiledRects(border, clip, up_sides, colors, 8);
|
||||||
|
|
||||||
[dark set];
|
[dark set];
|
||||||
PSrectfill(NSMinX(border) + 1., NSMinY(border) + 1., 1., 1.);
|
PSrectfill(NSMinX(border) + 1., NSMinY(border) + 1., 1., 1.);
|
||||||
PSrectfill(NSMaxX(border) - 2., NSMaxY(border) - 2., 1., 1.);
|
PSrectfill(NSMaxX(border) - 2., NSMaxY(border) - 2., 1., 1.);
|
||||||
}
|
}
|
||||||
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Draw a light bezel border */
|
/** Draw a light bezel border */
|
||||||
+ (void) drawLightBezel: (NSRect) border : (NSRect)clip
|
+ (NSRect) drawLightBezel: (NSRect)border : (NSRect)clip
|
||||||
{
|
{
|
||||||
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge,
|
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge,
|
||||||
NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge};
|
NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge};
|
||||||
|
@ -125,16 +149,16 @@
|
||||||
|
|
||||||
if ([[NSView focusView] isFlipped] == YES)
|
if ([[NSView focusView] isFlipped] == YES)
|
||||||
{
|
{
|
||||||
NSDrawColorTiledRects(border, clip, dn_sides, colors, 8);
|
return NSDrawColorTiledRects(border, clip, dn_sides, colors, 8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSDrawColorTiledRects(border, clip, up_sides, colors, 8);
|
return NSDrawColorTiledRects(border, clip, up_sides, colors, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Draw a white bezel border */
|
/** Draw a white bezel border */
|
||||||
+ (void) drawWhiteBezel: (NSRect) border : (NSRect)clip
|
+ (NSRect) drawWhiteBezel: (NSRect)border : (NSRect)clip
|
||||||
{
|
{
|
||||||
NSRectEdge up_sides[] = {NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge,
|
NSRectEdge up_sides[] = {NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge,
|
||||||
NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge};
|
NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge};
|
||||||
|
@ -149,16 +173,16 @@
|
||||||
|
|
||||||
if ([[NSView focusView] isFlipped] == YES)
|
if ([[NSView focusView] isFlipped] == YES)
|
||||||
{
|
{
|
||||||
NSDrawColorTiledRects(border, clip, dn_sides, colors, 8);
|
return NSDrawColorTiledRects(border, clip, dn_sides, colors, 8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSDrawColorTiledRects(border, clip, up_sides, colors, 8);
|
return NSDrawColorTiledRects(border, clip, up_sides, colors, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Draw a grey bezel border */
|
/** Draw a grey bezel border */
|
||||||
+ (void) drawGrayBezel: (NSRect) border : (NSRect)clip
|
+ (NSRect) drawGrayBezel: (NSRect)border : (NSRect)clip
|
||||||
{
|
{
|
||||||
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge,
|
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge,
|
||||||
NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge};
|
NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge};
|
||||||
|
@ -171,25 +195,27 @@
|
||||||
NSColor *white = [NSColor controlLightHighlightColor];
|
NSColor *white = [NSColor controlLightHighlightColor];
|
||||||
NSColor *colors[] = {white, white, dark, dark,
|
NSColor *colors[] = {white, white, dark, dark,
|
||||||
light, light, black, black};
|
light, light, black, black};
|
||||||
|
NSRect rect;
|
||||||
|
|
||||||
if ([[NSView focusView] isFlipped] == YES)
|
if ([[NSView focusView] isFlipped] == YES)
|
||||||
{
|
{
|
||||||
NSDrawColorTiledRects(border, clip, dn_sides, colors, 8);
|
rect = NSDrawColorTiledRects(border, clip, dn_sides, colors, 8);
|
||||||
[dark set];
|
[dark set];
|
||||||
PSrectfill(NSMinX(border) + 1., NSMaxY(border) - 2., 1., 1.);
|
PSrectfill(NSMinX(border) + 1., NSMaxY(border) - 2., 1., 1.);
|
||||||
PSrectfill(NSMaxX(border) - 2., NSMinY(border) + 1., 1., 1.);
|
PSrectfill(NSMaxX(border) - 2., NSMinY(border) + 1., 1., 1.);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSDrawColorTiledRects(border, clip, up_sides, colors, 8);
|
rect = NSDrawColorTiledRects(border, clip, up_sides, colors, 8);
|
||||||
[dark set];
|
[dark set];
|
||||||
PSrectfill(NSMinX(border) + 1., NSMinY(border) + 1., 1., 1.);
|
PSrectfill(NSMinX(border) + 1., NSMinY(border) + 1., 1., 1.);
|
||||||
PSrectfill(NSMaxX(border) - 2., NSMaxY(border) - 2., 1., 1.);
|
PSrectfill(NSMaxX(border) - 2., NSMaxY(border) - 2., 1., 1.);
|
||||||
}
|
}
|
||||||
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Draw a groove border */
|
/** Draw a groove border */
|
||||||
+ (void) drawGroove: (NSRect)border : (NSRect)clip
|
+ (NSRect) drawGroove: (NSRect)border : (NSRect)clip
|
||||||
{
|
{
|
||||||
// go clockwise from the top twice -- makes the groove come out right
|
// go clockwise from the top twice -- makes the groove come out right
|
||||||
NSRectEdge up_sides[] = {NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge,
|
NSRectEdge up_sides[] = {NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge,
|
||||||
|
@ -204,16 +230,16 @@
|
||||||
|
|
||||||
if ([[NSView focusView] isFlipped] == YES)
|
if ([[NSView focusView] isFlipped] == YES)
|
||||||
{
|
{
|
||||||
NSDrawColorTiledRects(border, clip, dn_sides, colors, 8);
|
return NSDrawColorTiledRects(border, clip, dn_sides, colors, 8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSDrawColorTiledRects(border, clip, up_sides, colors, 8);
|
return NSDrawColorTiledRects(border, clip, up_sides, colors, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Draw a frame photo border. Used in NSImageView. */
|
/** Draw a frame photo border. Used in NSImageView. */
|
||||||
+ (void) drawFramePhoto: (NSRect) border : (NSRect)clip
|
+ (NSRect) drawFramePhoto: (NSRect)border : (NSRect)clip
|
||||||
{
|
{
|
||||||
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge,
|
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge,
|
||||||
NSMinXEdge, NSMaxYEdge,
|
NSMinXEdge, NSMaxYEdge,
|
||||||
|
@ -229,11 +255,11 @@
|
||||||
|
|
||||||
if ([[NSView focusView] isFlipped] == YES)
|
if ([[NSView focusView] isFlipped] == YES)
|
||||||
{
|
{
|
||||||
NSDrawColorTiledRects(border, clip, dn_sides, colors, 6);
|
return NSDrawColorTiledRects(border, clip, dn_sides, colors, 6);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSDrawColorTiledRects(border, clip, up_sides, colors, 6);
|
return NSDrawColorTiledRects(border, clip, up_sides, colors, 6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,6 @@
|
||||||
|
|
||||||
static NSNotificationCenter *nc;
|
static NSNotificationCenter *nc;
|
||||||
static const BOOL ForceBrowser = NO;
|
static const BOOL ForceBrowser = NO;
|
||||||
static const BOOL ForceArrowIcon = NO;
|
|
||||||
|
|
||||||
|
|
||||||
@interface GSFirstMouseTableView : NSTableView
|
@interface GSFirstMouseTableView : NSTableView
|
||||||
{
|
{
|
||||||
|
@ -107,6 +105,7 @@ static const BOOL ForceArrowIcon = NO;
|
||||||
- (NSRect) _textCellFrame;
|
- (NSRect) _textCellFrame;
|
||||||
- (void) _setSelectedItem: (int)index;
|
- (void) _setSelectedItem: (int)index;
|
||||||
- (void) _loadButtonCell;
|
- (void) _loadButtonCell;
|
||||||
|
- (void) _selectCompleted;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
// ---
|
// ---
|
||||||
|
@ -369,24 +368,16 @@ static GSComboWindow *gsWindow = nil;
|
||||||
|
|
||||||
- (void) popUpForComboBoxCell: (NSComboBoxCell *)comboBoxCell
|
- (void) popUpForComboBoxCell: (NSComboBoxCell *)comboBoxCell
|
||||||
{
|
{
|
||||||
NSString *more;
|
_cell = comboBoxCell;
|
||||||
unsigned int index = NSNotFound;
|
|
||||||
|
|
||||||
_cell = comboBoxCell;
|
|
||||||
|
|
||||||
[self positionWithComboBoxCell: _cell];
|
[self positionWithComboBoxCell: _cell];
|
||||||
more = [_cell completedString: [_cell stringValue]];
|
[_cell _selectCompleted];
|
||||||
index = [[_cell objectValues] indexOfObject: more];
|
|
||||||
if (index != NSNotFound)
|
|
||||||
{
|
|
||||||
[_cell _setSelectedItem: index];
|
|
||||||
}
|
|
||||||
|
|
||||||
[self reloadData];
|
[self reloadData];
|
||||||
[self enableKeyEquivalentForDefaultButtonCell];
|
[self enableKeyEquivalentForDefaultButtonCell];
|
||||||
[self runModalPopUpWithComboBoxCell: _cell];
|
[self runModalPopUpWithComboBoxCell: _cell];
|
||||||
|
|
||||||
_cell = nil;
|
_cell = nil;
|
||||||
|
[self deselectItemAtIndex: 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) runModalPopUpWithComboBoxCell: (NSComboBoxCell *)comboBoxCell
|
- (void) runModalPopUpWithComboBoxCell: (NSComboBoxCell *)comboBoxCell
|
||||||
|
@ -811,25 +802,15 @@ numberOfRowsInColumn: (int)column
|
||||||
{
|
{
|
||||||
// Method called by GSComboWindow when a selection is done in the table view or
|
// Method called by GSComboWindow when a selection is done in the table view or
|
||||||
// the browser
|
// the browser
|
||||||
|
|
||||||
NSText *textObject = [[[self controlView] window] fieldEditor: YES
|
|
||||||
forObject: self];
|
|
||||||
if ([self usesDataSource])
|
|
||||||
{
|
|
||||||
if ([self numberOfItems] <= index)
|
|
||||||
; // raise exception
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ([_popUpList count] <= index)
|
|
||||||
; // raise exception
|
|
||||||
}
|
|
||||||
|
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
; // rais exception
|
return; // raise exception?
|
||||||
|
if ([self numberOfItems] <= index)
|
||||||
|
return; // raise exception?
|
||||||
|
|
||||||
if (_selectedItem != index)
|
if (_selectedItem != index)
|
||||||
{
|
{
|
||||||
|
NSText *textObject = [[[self controlView] window] fieldEditor: YES
|
||||||
|
forObject: self];
|
||||||
_selectedItem = index;
|
_selectedItem = index;
|
||||||
|
|
||||||
[_popup selectItemAtIndex: index];
|
[_popup selectItemAtIndex: index];
|
||||||
|
@ -1504,17 +1485,8 @@ static inline NSRect buttonCellFrameFromRect(NSRect cellRect)
|
||||||
|
|
||||||
- (void) _loadButtonCell
|
- (void) _loadButtonCell
|
||||||
{
|
{
|
||||||
if (!ForceArrowIcon)
|
_buttonCell = [[NSButtonCell alloc] initImageCell:
|
||||||
{
|
[NSImage imageNamed: @"NSComboArrow"]];
|
||||||
_buttonCell = [[NSButtonCell alloc] initImageCell:
|
|
||||||
[NSImage imageNamed: @"common_ComboBoxEllipsis"]];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_buttonCell = [[NSButtonCell alloc] initImageCell:
|
|
||||||
[NSImage imageNamed: @"NSComboArrow"]];
|
|
||||||
}
|
|
||||||
|
|
||||||
[_buttonCell setImagePosition: NSImageOnly];
|
[_buttonCell setImagePosition: NSImageOnly];
|
||||||
[_buttonCell setButtonType: NSMomentaryPushButton];
|
[_buttonCell setButtonType: NSMomentaryPushButton];
|
||||||
[_buttonCell setHighlightsBy: NSPushInCellMask];
|
[_buttonCell setHighlightsBy: NSPushInCellMask];
|
||||||
|
@ -1523,4 +1495,41 @@ static inline NSRect buttonCellFrameFromRect(NSRect cellRect)
|
||||||
[_buttonCell setAction: @selector(_didClickWithinButton:)];
|
[_buttonCell setAction: @selector(_didClickWithinButton:)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) _selectCompleted
|
||||||
|
{
|
||||||
|
NSString *more;
|
||||||
|
unsigned int index = NSNotFound;
|
||||||
|
|
||||||
|
more = [self completedString: [self stringValue]];
|
||||||
|
if (_usesDataSource)
|
||||||
|
{
|
||||||
|
if (!_dataSource)
|
||||||
|
{
|
||||||
|
NSLog(@"%@: A DataSource should be specified", self);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ([_dataSource respondsToSelector:
|
||||||
|
@selector(comboBoxCell:indexOfItemWithStringValue:)])
|
||||||
|
{
|
||||||
|
index = [_dataSource comboBoxCell: self
|
||||||
|
indexOfItemWithStringValue: more];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
index = [[self objectValues] indexOfObject: more];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index != NSNotFound)
|
||||||
|
{
|
||||||
|
[self _setSelectedItem: index];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[self _setSelectedItem: -1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue