mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 12:30:47 +00:00
fix problem of pulldown action not being called for correct cell, and being called twice on Windows
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31213 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
26c6942f2d
commit
ae51e23b36
3 changed files with 21 additions and 0 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2010-08-30 Doug Simons <doug.simons@testplant.com>
|
||||||
|
|
||||||
|
* Source/NSPopUpButtonCell.m:
|
||||||
|
Fix problem of pulldown action not being called with correct cell
|
||||||
|
selected (possibly only a problem for Mac nib files?).
|
||||||
|
* Source/NSMenuView.m:
|
||||||
|
Fix problem of pulldown action getting invoked twice on Windows.
|
||||||
|
|
||||||
2010-08-30 Wolfgang Lux <wolfgang.lux@gmail.com>
|
2010-08-30 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
* Source/NSTableView.m (computeNewSelection): Fix bug where the
|
* Source/NSTableView.m (computeNewSelection): Fix bug where the
|
||||||
|
|
|
@ -1452,6 +1452,13 @@ static NSMapTable *viewInfo = 0;
|
||||||
NSEvent *original;
|
NSEvent *original;
|
||||||
NSEventType type;
|
NSEventType type;
|
||||||
NSEventType end;
|
NSEventType end;
|
||||||
|
NSPopUpButtonCell *bcell = nil;
|
||||||
|
SEL bcellAction = NULL;
|
||||||
|
if([_attachedMenu _ownedByPopUp])
|
||||||
|
{
|
||||||
|
bcell = [_attachedMenu _owningPopUp];
|
||||||
|
bcellAction = [bcell action];
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The original event is unused except to determine whether the method
|
* The original event is unused except to determine whether the method
|
||||||
|
@ -1656,11 +1663,13 @@ static NSMapTable *viewInfo = 0;
|
||||||
lastLocation = location;
|
lastLocation = location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[bcell setAction:NULL]; // block actions while fetching an event (this is a problem on Windows)
|
||||||
event = [NSApp nextEventMatchingMask: eventMask
|
event = [NSApp nextEventMatchingMask: eventMask
|
||||||
untilDate: theDistantFuture
|
untilDate: theDistantFuture
|
||||||
inMode: NSEventTrackingRunLoopMode
|
inMode: NSEventTrackingRunLoopMode
|
||||||
dequeue: YES];
|
dequeue: YES];
|
||||||
type = [event type];
|
type = [event type];
|
||||||
|
[bcell setAction:bcellAction]; // restore the popUpButtonCell's action
|
||||||
}
|
}
|
||||||
while (type != end || shouldFinish == NO);
|
while (type != end || shouldFinish == NO);
|
||||||
|
|
||||||
|
|
|
@ -1304,6 +1304,10 @@ static NSImage *_pbc_image[5];
|
||||||
*/
|
*/
|
||||||
- (void) _popUpItemAction: (id)sender
|
- (void) _popUpItemAction: (id)sender
|
||||||
{
|
{
|
||||||
|
// first, if sender is one of our items, set it as our selected item
|
||||||
|
int index = [_menu indexOfItem:sender];
|
||||||
|
if (index != NSNotFound)
|
||||||
|
[self selectItemAtIndex:index];
|
||||||
[NSApp sendAction: [self action] to: [self target] from: self];
|
[NSApp sendAction: [self action] to: [self target] from: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue