Bugs removed from NSButton and NSDPSContext.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2374 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
netcrep 1997-08-06 20:29:07 +00:00
parent f8fcd3088c
commit 72921c6e77
8 changed files with 43 additions and 16 deletions

View file

@ -1,3 +1,19 @@
Wed Aug 6 13:27:53 1997 Ovidiu Predescu <ovidiu@net-community.com>
* Source/NSApplication (-nextEventMatchingMask:untilDate:inMode:
dequeue:): Restored the old behavior of getting time events from the
queue because otherwise the scroll view class works slowly; I have to
find some other way to put such events on the events queue.
* Source/NSButton.m (mouseDown:): Don't send the action to the target
since it is already done in trackMouse:inRect:ofView:untilMouseUp:.
* Source/NSCell.m (getPeriodicDelay:interval:): Set the delay to 0.05.
* Source/NSDPSContext.m (+initialize): Create a retained dictionary
for GNU_CONTEXT_THREAD_DICT instead of an autoreleased one.
* Source/NSClipView.m: Turned NSLog into NSDebugLog.
* Source/NSScrollView.m: Likewise.
* Source/NSScroller.m (drawParts): Set the scroller buttons delay and
repeat interval.
Tue Aug 5 14:39:29 1997 Ovidiu Predescu <ovidiu@net-community.com> Tue Aug 5 14:39:29 1997 Ovidiu Predescu <ovidiu@net-community.com>
* Images/common_ArrowLeftH.tiff: New file. * Images/common_ArrowLeftH.tiff: New file.

View file

@ -413,6 +413,9 @@ static BOOL gnustep_gui_app_is_in_dealloc;
NSEvent *event; NSEvent *event;
BOOL done = NO; BOOL done = NO;
if (!expiration)
expiration = [NSDate distantFuture];
event = [self _eventMatchingMask:mask]; event = [self _eventMatchingMask:mask];
if (event) if (event)
done = YES; done = YES;
@ -421,8 +424,9 @@ static BOOL gnustep_gui_app_is_in_dealloc;
while (!done) { while (!done) {
NSDate* limitDate = [currentLoop limitDateForMode:mode]; NSDate* limitDate = [currentLoop limitDateForMode:mode];
if (!expiration) event = [self _eventMatchingMask:mask];
expiration = [NSDate distantFuture]; if (event)
break;
if (limitDate) if (limitDate)
limitDate = [expiration earlierDate:limitDate]; limitDate = [expiration earlierDate:limitDate];
@ -433,7 +437,7 @@ static BOOL gnustep_gui_app_is_in_dealloc;
event = [self _eventMatchingMask:mask]; event = [self _eventMatchingMask:mask];
if (event) if (event)
done = YES; break;
} }
type = [event type]; type = [event type];

View file

@ -289,6 +289,7 @@ id gnustep_gui_nsbutton_class = nil;
NSEvent *e; NSEvent *e;
unsigned int event_mask = NSLeftMouseDownMask | NSLeftMouseUpMask | unsigned int event_mask = NSLeftMouseDownMask | NSLeftMouseUpMask |
NSMouseMovedMask | NSLeftMouseDraggedMask | NSRightMouseDraggedMask; NSMouseMovedMask | NSLeftMouseDraggedMask | NSRightMouseDraggedMask;
// int oldActionMask = [cell sendActionOn:0];
NSDebugLog(@"NSButton mouseDown\n"); NSDebugLog(@"NSButton mouseDown\n");
@ -335,9 +336,12 @@ id gnustep_gui_nsbutton_class = nil;
} }
[self unlockFocus]; [self unlockFocus];
/* Restore the old action mask */
// [cell sendActionOn:oldActionMask];
// Have the target perform the action // Have the target perform the action
if (mouseUp) // if (mouseUp)
[self sendAction:[self action] to:[self target]]; // [self sendAction:[self action] to:[self target]];
} }
- (void)performClick:(id)sender - (void)performClick:(id)sender

View file

@ -591,7 +591,7 @@
- (void)getPeriodicDelay:(float *)delay - (void)getPeriodicDelay:(float *)delay
interval:(float *)interval interval:(float *)interval
{ {
*delay = 0.0; *delay = 0.05;
*interval = 0.05; *interval = 0.05;
} }
@ -719,7 +719,7 @@
// Did the mouse go up? // Did the mouse go up?
if (eventType == NSLeftMouseUp) { if (eventType == NSLeftMouseUp) {
NSLog(@"NSCell mouse went up\n"); NSDebugLog(@"NSCell mouse went up\n");
mouseWentUp = YES; mouseWentUp = YES;
done = YES; done = YES;
if ((action_mask & NSLeftMouseUpMask)) if ((action_mask & NSLeftMouseUpMask))

View file

@ -94,7 +94,7 @@
{ {
NSPoint currentPoint = [self bounds].origin; NSPoint currentPoint = [self bounds].origin;
NSLog (@"scrollToPoint: current point (%f, %f), point (%f, %f)", NSDebugLog (@"scrollToPoint: current point (%f, %f), point (%f, %f)",
currentPoint.x, currentPoint.y, currentPoint.x, currentPoint.y,
point.x, point.y); point.x, point.y);

View file

@ -69,7 +69,7 @@ static BOOL GNU_CONTEXT_SYNCHRONIZED = NO;
// Allocate dictionary for maintaining // Allocate dictionary for maintaining
// mapping of threads to contexts // mapping of threads to contexts
GNU_CONTEXT_THREAD_DICT = [NSMutableDictionary dictionary]; GNU_CONTEXT_THREAD_DICT = [NSMutableDictionary new];
// Create lock for serializing access to dictionary // Create lock for serializing access to dictionary
GNU_CONTEXT_LOCK = [[NSRecursiveLock alloc] init]; GNU_CONTEXT_LOCK = [[NSRecursiveLock alloc] init];

View file

@ -197,7 +197,7 @@ static Class rulerViewClass = nil;
NSPoint point; NSPoint point;
BOOL wasAScrollerButton = YES; BOOL wasAScrollerButton = YES;
NSLog (@"_doScroll: float value = %f", floatValue); NSDebugLog (@"_doScroll: float value = %f", floatValue);
if (hitPart == NSScrollerIncrementLine) if (hitPart == NSScrollerIncrementLine)
amount = _lineScroll; amount = _lineScroll;
@ -225,7 +225,7 @@ static Class rulerViewClass = nil;
if (![_contentView isFlipped]) if (![_contentView isFlipped])
amount = -amount; amount = -amount;
NSLog (@"increment/decrement: amount = %f, flipped = %d", NSDebugLog (@"increment/decrement: amount = %f, flipped = %d",
amount, [_contentView isFlipped]); amount, [_contentView isFlipped]);
point.y = clipViewBounds.origin.y + amount; point.y = clipViewBounds.origin.y + amount;
} }
@ -266,7 +266,7 @@ static Class rulerViewClass = nil;
/ (documentRect.size.width - newClipViewBounds.size.width); / (documentRect.size.width - newClipViewBounds.size.width);
[_horizScroller setFloatValue:floatValue]; [_horizScroller setFloatValue:floatValue];
[_horizScroller display]; [_horizScroller display];
NSLog (@"new horiz float value %f", floatValue); NSDebugLog (@"new horiz float value %f", floatValue);
} }
if (newClipViewBounds.origin.x != clipViewBounds.origin.y) { if (newClipViewBounds.origin.x != clipViewBounds.origin.y) {
@ -279,7 +279,7 @@ static Class rulerViewClass = nil;
floatValue = 1 - floatValue; floatValue = 1 - floatValue;
[_vertScroller setFloatValue:floatValue]; [_vertScroller setFloatValue:floatValue];
[_vertScroller display]; [_vertScroller display];
NSLog (@"new vert float value %f", floatValue); NSDebugLog (@"new vert float value %f", floatValue);
} }
} }
} }
@ -291,7 +291,7 @@ static Class rulerViewClass = nil;
float floatValue; float floatValue;
float knobProportion; float knobProportion;
NSLog (@"reflectScrolledClipView:"); NSDebugLog (@"reflectScrolledClipView:");
if (_hasVertScroller) { if (_hasVertScroller) {
if (documentRect.size.height < clipViewBounds.size.height) if (documentRect.size.height < clipViewBounds.size.height)

View file

@ -114,6 +114,7 @@ static NSButtonCell* knobCell = nil;
[upCell setAlternateImage:[NSImage imageNamed:@"common_ArrowUpH"]]; [upCell setAlternateImage:[NSImage imageNamed:@"common_ArrowUpH"]];
[upCell setImagePosition:NSImageOnly]; [upCell setImagePosition:NSImageOnly];
[upCell setContinuous:YES]; [upCell setContinuous:YES];
[upCell setPeriodicDelay:0.05 interval:0.05];
downCell = [NSButtonCell new]; downCell = [NSButtonCell new];
[downCell setHighlightsBy:NSChangeBackgroundCellMask|NSContentsCellMask]; [downCell setHighlightsBy:NSChangeBackgroundCellMask|NSContentsCellMask];
@ -121,6 +122,7 @@ static NSButtonCell* knobCell = nil;
[downCell setAlternateImage:[NSImage imageNamed:@"common_ArrowDownH"]]; [downCell setAlternateImage:[NSImage imageNamed:@"common_ArrowDownH"]];
[downCell setImagePosition:NSImageOnly]; [downCell setImagePosition:NSImageOnly];
[downCell setContinuous:YES]; [downCell setContinuous:YES];
[downCell setPeriodicDelay:0.05 interval:0.05];
leftCell = [NSButtonCell new]; leftCell = [NSButtonCell new];
[leftCell setHighlightsBy:NSChangeBackgroundCellMask|NSContentsCellMask]; [leftCell setHighlightsBy:NSChangeBackgroundCellMask|NSContentsCellMask];
@ -128,6 +130,7 @@ static NSButtonCell* knobCell = nil;
[leftCell setAlternateImage:[NSImage imageNamed:@"common_ArrowLeftH"]]; [leftCell setAlternateImage:[NSImage imageNamed:@"common_ArrowLeftH"]];
[leftCell setImagePosition:NSImageOnly]; [leftCell setImagePosition:NSImageOnly];
[leftCell setContinuous:YES]; [leftCell setContinuous:YES];
[leftCell setPeriodicDelay:0.05 interval:0.05];
rightCell = [NSButtonCell new]; rightCell = [NSButtonCell new];
[rightCell setHighlightsBy:NSChangeBackgroundCellMask|NSContentsCellMask]; [rightCell setHighlightsBy:NSChangeBackgroundCellMask|NSContentsCellMask];
@ -135,6 +138,7 @@ static NSButtonCell* knobCell = nil;
[rightCell setAlternateImage:[NSImage imageNamed:@"common_ArrowRightH"]]; [rightCell setAlternateImage:[NSImage imageNamed:@"common_ArrowRightH"]];
[rightCell setImagePosition:NSImageOnly]; [rightCell setImagePosition:NSImageOnly];
[rightCell setContinuous:YES]; [rightCell setContinuous:YES];
[rightCell setPeriodicDelay:0.05 interval:0.05];
knobCell = [NSButtonCell new]; knobCell = [NSButtonCell new];
[knobCell setButtonType:NSMomentaryChangeButton]; [knobCell setButtonType:NSMomentaryChangeButton];
@ -399,8 +403,7 @@ static NSButtonCell* knobCell = nil;
if (eventType != NSPeriodic) if (eventType != NSPeriodic)
point = [self convertPoint:[theEvent locationInWindow] fromView:nil]; point = [self convertPoint:[theEvent locationInWindow] fromView:nil];
else if (point.x != knobRect.origin.x else if (point.x != knobRect.origin.x || point.y != knobRect.origin.y) {
|| point.y != knobRect.origin.y) {
float floatValue = [self _floatValueForMousePoint:point]; float floatValue = [self _floatValueForMousePoint:point];
if (floatValue != oldFloatValue) { if (floatValue != oldFloatValue) {