mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 17:52:42 +00:00
* Headers/Additions/GNUstepGUI/GSTheme.h: Added method
displayPopUpMenu:... to handle the display of the popup menus for themes. * Source/GSThemeMenu.m: Added default implementation. * Source/NSPopUpButtonCell.m: Call the displayPopUpMenu:... method in the method attachPopUpWithFrame:inView:. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30433 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fe5c6189cf
commit
70ab53498d
4 changed files with 43 additions and 11 deletions
|
@ -1,3 +1,12 @@
|
|||
2010-05-20 04:14-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Headers/Additions/GNUstepGUI/GSTheme.h: Added method
|
||||
displayPopUpMenu:... to handle the display of the popup menus for
|
||||
themes.
|
||||
* Source/GSThemeMenu.m: Added default implementation.
|
||||
* Source/NSPopUpButtonCell.m: Call the displayPopUpMenu:... method
|
||||
in the method attachPopUpWithFrame:inView:.
|
||||
|
||||
2010-05-19 Quentin Mathe <quentin.mathe@gmail.com>
|
||||
|
||||
* Headers/AppKit/NSColorPicking.h: Removed Protocol.h import to
|
||||
|
|
|
@ -1061,6 +1061,15 @@ withRepeatedImage: (NSImage*)image
|
|||
- (void) rightMouseDisplay: (NSMenu *)menu
|
||||
forEvent: (NSEvent *)theEvent;
|
||||
|
||||
/**
|
||||
* Display popup menu item.
|
||||
*/
|
||||
- (void) displayPopUpMenu: (NSMenuView *)mr
|
||||
withCellFrame: (NSRect)cellFrame
|
||||
controlViewWindow: (NSWindow *)cvWin
|
||||
preferredEdge: (NSRectEdge)edge
|
||||
selectedItem: (int)selectedItem;
|
||||
|
||||
/**
|
||||
* Processes menu events for the theme. The default implementation
|
||||
* does nothing.
|
||||
|
|
|
@ -91,6 +91,25 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void) displayPopUpMenu: (NSMenuView *)mr
|
||||
withCellFrame: (NSRect)cellFrame
|
||||
controlViewWindow: (NSWindow *)cvWin
|
||||
preferredEdge: (NSRectEdge)edge
|
||||
selectedItem: (int)selectedItem
|
||||
{
|
||||
// Ask the MenuView to attach the menu to this rect
|
||||
[mr setWindowFrameForAttachingToRect: cellFrame
|
||||
onScreen: [cvWin screen]
|
||||
preferredEdge: edge
|
||||
popUpSelectedItem: selectedItem];
|
||||
|
||||
// Set to be above the main window
|
||||
[cvWin addChildWindow: [mr window] ordered: NSWindowAbove];
|
||||
|
||||
// Last, display the window
|
||||
[[mr window] orderFrontRegardless];
|
||||
}
|
||||
|
||||
- (void) processCommand: (void *)context
|
||||
{
|
||||
// this is only implemented when we handle native menus.
|
||||
|
|
|
@ -838,17 +838,12 @@ static NSImage *_pbc_image[5];
|
|||
[mr setHighlightedItemIndex: selectedItem];
|
||||
}
|
||||
|
||||
// Ask the MenuView to attach the menu to this rect
|
||||
[mr setWindowFrameForAttachingToRect: cellFrame
|
||||
onScreen: [cvWin screen]
|
||||
preferredEdge: _pbcFlags.preferredEdge
|
||||
popUpSelectedItem: selectedItem];
|
||||
|
||||
// Set to be above the main window
|
||||
[cvWin addChildWindow: [mr window] ordered: NSWindowAbove];
|
||||
|
||||
// Last, display the window
|
||||
[[mr window] orderFrontRegardless];
|
||||
// display the menu item...
|
||||
[[GSTheme theme] displayPopUpMenu: mr
|
||||
withCellFrame: cellFrame
|
||||
controlViewWindow: cvWin
|
||||
preferredEdge: _pbcFlags.preferredEdge
|
||||
selectedItem: selectedItem];
|
||||
|
||||
[nc addObserver: self
|
||||
selector: @selector(_handleNotification:)
|
||||
|
|
Loading…
Reference in a new issue