Phoenix Logo

phoenix_title wx.lib.agw.flatmenu.FlatMenuBase

Base class for generic flat menu derived from PopupWindow.


class_hierarchy Class Hierarchy

Inheritance diagram for class FlatMenuBase:


method_summary Methods Summary

__init__ Default class constructor.
AdjustPosition Adjusts position so the menu will be fully visible on screen.
Dismiss Dismisses the popup window.
GetMenuOwner Returns the menu logical owner, the owner does not necessarly mean the
GetRenderer Returns the renderer for this class.
GetRootMenu Returns the top level menu.
OnChildDismiss Handles children dismiss.
OnDismiss Fires an event EVT_FLAT_MENU_DISMISSED and handle menu dismiss.
Popup Popups menu at the specified point.
ScrollDown Scroll one unit down.
ScrollUp Scroll one unit up.
SetOwnerHeight Sets the menu owner height, this will be used to position the menu below

api Class API



class FlatMenuBase(ShadowPopupWindow)

Base class for generic flat menu derived from PopupWindow.


Methods



__init__(self, parent=None)

Default class constructor.

Parameters:parent – the ShadowPopupWindow parent window.


AdjustPosition(self, pos)

Adjusts position so the menu will be fully visible on screen.

Parameters:pos – an instance of wx.Point specifying the menu position.


Dismiss(self, dismissParent, resetOwner)

Dismisses the popup window.

Parameters:
  • dismissParent (bool) – whether to dismiss the parent menu or not;
  • resetOwner (bool) – True to delete the link between this menu and the owner menu, False otherwise.


GetMenuOwner(self)

Returns the menu logical owner, the owner does not necessarly mean the menu parent, it can also be the window that popped up it.



GetRenderer(self)

Returns the renderer for this class.



GetRootMenu(self)

Returns the top level menu.



OnChildDismiss(self)

Handles children dismiss.



OnDismiss(self)

Fires an event EVT_FLAT_MENU_DISMISSED and handle menu dismiss.



Popup(self, pt, parent)

Popups menu at the specified point.

Parameters:
  • pt – an instance of wx.Point, assumed to be in screen coordinates. However, if parent is not None, pt is translated into the screen coordinates using parent.ClientToScreen();
  • parent – if not None, an instance of wx.Window.


ScrollDown(self)

Scroll one unit down. By default this function is empty, let derived class do something.



ScrollUp(self)

Scroll one unit up. By default this function is empty, let derived class do something.



SetOwnerHeight(self, height)

Sets the menu owner height, this will be used to position the menu below or above the owner.

Parameters:height (integer) – an integer representing the menu owner height.