mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Major rewrites of both classes so that they behave like they should
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11269 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5011e9feee
commit
c035933889
2 changed files with 6 additions and 26 deletions
|
@ -178,6 +178,9 @@ id _nsstepperCellClass = nil;
|
|||
BOOL isDirectionUp;
|
||||
BOOL autorepeat = [_cell autorepeat];
|
||||
|
||||
if([_cell isEnabled] == NO)
|
||||
return;
|
||||
|
||||
if([event type] != NSLeftMouseDown)
|
||||
return;
|
||||
|
||||
|
@ -325,6 +328,7 @@ id _nsstepperCellClass = nil;
|
|||
else
|
||||
[_cell setDoubleValue: newValue];
|
||||
}
|
||||
[self sendAction: [self action] to: [self target]];
|
||||
}
|
||||
|
||||
- (void)_decrement
|
||||
|
@ -354,6 +358,7 @@ id _nsstepperCellClass = nil;
|
|||
else
|
||||
[_cell setDoubleValue: newValue];
|
||||
}
|
||||
[self sendAction: [self action] to: [self target]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
//
|
||||
- (id) init
|
||||
{
|
||||
[self initTextCell: @"0"];
|
||||
[self setIntValue: 0];
|
||||
[super setAlignment: NSRightTextAlignment];
|
||||
[super setWraps: NO];
|
||||
_autorepeat = YES;
|
||||
|
@ -61,15 +61,6 @@
|
|||
return self;
|
||||
}
|
||||
|
||||
- (id) initTextCell: (NSString *)aString
|
||||
{
|
||||
[super initTextCell: aString];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (double) maxValue
|
||||
{
|
||||
return _maxValue;
|
||||
|
@ -256,30 +247,15 @@ inline void HighlightDownButton(NSRect aRect)
|
|||
PSstroke();
|
||||
}
|
||||
|
||||
- (void)_drawText: (NSRect)aRect
|
||||
{
|
||||
NSDrawWhiteBezel(aRect, NSZeroRect);
|
||||
aRect.size.width -= 6;
|
||||
aRect.size.height -= 4;
|
||||
aRect.origin.x += 3;
|
||||
aRect.origin.y += 2;
|
||||
[super _drawText: _contents inFrame: aRect];
|
||||
}
|
||||
|
||||
- (void) drawInteriorWithFrame: (NSRect)cellFrame
|
||||
inView: (NSView*)controlView
|
||||
{
|
||||
NSRect textFrame;
|
||||
NSRect upRect;
|
||||
NSRect downRect;
|
||||
NSRect twoButtons;
|
||||
NSGraphicsContext *ctxt;
|
||||
[controlView lockFocus];
|
||||
ctxt = GSCurrentContext();
|
||||
textFrame = cellFrame;
|
||||
textFrame.origin.y ++;
|
||||
textFrame.size.height -= 2;
|
||||
textFrame.size.width -= 18;
|
||||
|
||||
{
|
||||
upRect = [self upButtonRectWithFrame: cellFrame];
|
||||
|
@ -309,7 +285,6 @@ inline void HighlightDownButton(NSRect aRect)
|
|||
}
|
||||
}
|
||||
|
||||
[self _drawText: textFrame];
|
||||
[controlView unlockFocus];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue