mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
Copy change from -gui to Gorm which swaps the meaning of NSMinYEdge
and NSMaxYEdge for attaching a pull down menu to its button. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@30840 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b192a466d7
commit
fa3445b7c7
2 changed files with 26 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
2010-06-24 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Palettes/2Controls/GormPopUpButtonEditor.m
|
||||
(-attachPopUpWithFrame:inView:): Copy change from -gui which swaps
|
||||
the meaning of NSMinYEdge and NSMaxYEdge.
|
||||
|
||||
2010-06-24 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Palettes/2Controls/GormPopUpButtonAttributesInspector.h
|
||||
|
|
|
@ -84,6 +84,7 @@ Class _gormnspopupbuttonCellClass = 0;
|
|||
- (void) attachPopUpWithFrame: (NSRect)cellFrame
|
||||
inView: (NSView *)controlView
|
||||
{
|
||||
NSRectEdge preferredEdge = _pbcFlags.preferredEdge;
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
NSWindow *cvWin = [controlView window];
|
||||
NSMenuView *mr = [[self menu] menuRepresentation];
|
||||
|
@ -101,18 +102,34 @@ Class _gormnspopupbuttonCellClass = 0;
|
|||
|
||||
if (_pbcFlags.pullsDown)
|
||||
selectedItem = -1;
|
||||
else
|
||||
selectedItem = [self indexOfSelectedItem];
|
||||
else
|
||||
{
|
||||
selectedItem = [self indexOfSelectedItem];
|
||||
if (selectedItem = -1)
|
||||
selectedItem = 0;
|
||||
}
|
||||
|
||||
if (selectedItem > 0)
|
||||
{
|
||||
[mr setHighlightedItemIndex: selectedItem];
|
||||
}
|
||||
|
||||
if ([controlView isFlipped])
|
||||
{
|
||||
if (preferredEdge == NSMinYEdge)
|
||||
{
|
||||
preferredEdge = NSMaxYEdge;
|
||||
}
|
||||
else if (preferredEdge == NSMaxYEdge)
|
||||
{
|
||||
preferredEdge = NSMinYEdge;
|
||||
}
|
||||
}
|
||||
|
||||
// Ask the MenuView to attach the menu to this rect
|
||||
[mr setWindowFrameForAttachingToRect: cellFrame
|
||||
onScreen: [cvWin screen]
|
||||
preferredEdge: _pbcFlags.preferredEdge
|
||||
preferredEdge: preferredEdge
|
||||
popUpSelectedItem: selectedItem];
|
||||
|
||||
// Set to be above the main window
|
||||
|
|
Loading…
Reference in a new issue