mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-09 04:07:12 +00:00
timer support for drag-scrolling
This commit is contained in:
@@ -118,7 +118,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
|
||||
BOOL _drawCaret;
|
||||
CPTimer _caretTimer;
|
||||
CPTimer _scollingTimer;
|
||||
CPTimer _scrollingTimer;
|
||||
CGRect _caretRect;
|
||||
|
||||
BOOL _scrollingDownward;
|
||||
@@ -791,6 +791,13 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
}
|
||||
|
||||
[self setSelectedRange:setRange affinity:0 stillSelecting:YES];
|
||||
|
||||
_scrollingTimer = [CPTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(_supportScrolling:) userInfo:nil repeats:YES]; // fixme: only start if we are in the scrolling areas
|
||||
}
|
||||
|
||||
- (void)_supportScrolling:(CPTimer)aTimer
|
||||
{
|
||||
[self mouseDragged:[CPApp currentEvent]];
|
||||
}
|
||||
|
||||
- (void)_clearRange:(CPRange)range
|
||||
@@ -864,6 +871,11 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
var point = [_layoutManager locationForGlyphAtIndex:[self selectedRange].location];
|
||||
_stickyXLocation = point.x;
|
||||
_startTrackingLocation = _selectionRange.location;
|
||||
|
||||
if (_scrollingTimer)
|
||||
{ [_scrollingTimer invalidate];
|
||||
_scrollingTimer = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)moveDown:(id)sender
|
||||
|
||||
Reference in New Issue
Block a user