AGW Logo

agw_title FlatMenuBase

Base class for generic flat menu derived from wx.PopupWindow.

hierarchy Inheritance Diagram

Inheritance diagram for: FlatMenuBase

Inheritance diagram of FlatMenuBase


subclasses Known Subclasses


supclasses Known Superclasses


method_summary Methods Summary

__init__Default class constructor.
AdjustPositionAdjusts position so the menu will be fully visible on screen.
DismissDismisses the popup window.
GetMenuOwnerReturns the menu logical owner, the owner does not necessarly mean the
GetRendererReturns the renderer for this class.
GetRootMenuReturns the top level menu.
OnChildDismissHandles children dismiss.
OnDismissFires an event EVT_FLAT_MENU_DISMISSED and handle menu dismiss.
PopupPopups menu at the specified point.
ScrollDownScroll one unit down.
ScrollUpScroll one unit up.
SetOwnerHeightSets the menu owner height, this will be used to position the menu below or above the owner.

API Class API

class FlatMenuBase(ShadowPopupWindow)[source]

Base class for generic flat menu derived from wx.PopupWindow.



__init__(parent=None)[source]

Default class constructor.

Parameters:parent – the ShadowPopupWindow parent window.


AdjustPosition(pos)[source]

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

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


Dismiss(dismissParent, resetOwner)[source]

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()[source]

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()[source]

Returns the renderer for this class.



GetRootMenu()[source]

Returns the top level menu.



OnChildDismiss()[source]

Handles children dismiss.



OnDismiss()[source]

Fires an event EVT_FLAT_MENU_DISMISSED and handle menu dismiss.



Popup(pt, parent)[source]

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()[source]

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



ScrollUp()[source]

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



SetOwnerHeight(height)[source]

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.
Tree

Table Of Contents

Previous topic

FlatMenuBar

Next topic

FlatMenuButton