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:
Scott Christley 1997-08-06 20:29:07 +00:00
parent 351111bf67
commit 433204b18a
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>
* Images/common_ArrowLeftH.tiff: New file.

View file

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

View file

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

View file

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

View file

@ -94,7 +94,7 @@
{
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,
point.x, point.y);

View file

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

View file

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

View file

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