mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 23:40:48 +00:00
* Source/NSRulerMarker.m: Changes suggested by Doug Simons for
allowing markers to be set on an NSMouseDown event. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28188 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6b3ab20fe5
commit
6addac1c7c
2 changed files with 21 additions and 6 deletions
|
@ -227,7 +227,7 @@
|
|||
- (BOOL)trackMouse:(NSEvent *)theEvent adding:(BOOL)adding
|
||||
{
|
||||
NSView *client = [_rulerView clientView];
|
||||
NSEvent *newEvent;
|
||||
NSEvent *newEvent = nil;
|
||||
int eventMask = NSLeftMouseDraggedMask | NSLeftMouseUpMask;
|
||||
BOOL isFar = NO;
|
||||
BOOL askedCanRemove = NO;
|
||||
|
@ -341,12 +341,22 @@
|
|||
/* loop processing events until mouse up */
|
||||
while (_isDragging)
|
||||
{
|
||||
newEvent = [NSApp nextEventMatchingMask: eventMask
|
||||
untilDate: [NSDate distantFuture]
|
||||
inMode: NSEventTrackingRunLoopMode
|
||||
dequeue: YES];
|
||||
if(newEvent == nil)
|
||||
{
|
||||
newEvent = theEvent;
|
||||
previousMousePositionInWindow = NSMakePoint(0,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
newEvent = [NSApp nextEventMatchingMask: eventMask
|
||||
untilDate: [NSDate distantFuture]
|
||||
inMode: NSEventTrackingRunLoopMode
|
||||
dequeue: YES];
|
||||
}
|
||||
|
||||
switch ([newEvent type])
|
||||
{
|
||||
{
|
||||
case NSLeftMouseDown:
|
||||
case NSLeftMouseDragged:
|
||||
/* take mouse position from outside of event stream
|
||||
and ignore event if in same position as previous event,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue