Package wx :: Package lib :: Package agw :: Module flatmenu :: Class FlatMenuBar
[frames | no frames]

Type FlatMenuBar

object --+                
         |                
    Object --+            
             |            
    EvtHandler --+        
                 |        
            Window --+    
                     |    
                 Panel --+
                         |
                        FlatMenuBar


Implements the generic owner-drawn menu bar for FlatMenu.
Method Summary
  __init__(self, parent, id, iconSize, spacer, options)
Default class constructor.
  ActivateMenu(self, menuInfo)
Activates menu which its info is menuInfo.
  ActivateNextMenu(self)
Activates next menu and make sure all other are non-active.
  ActivatePreviousMenu(self)
Activates previous menu and make sure all other are non-active.
  AddCheckTool(self, toolId, label, bitmap1, bitmap2, shortHelp, longHelp)
Adds a new check (or toggle) tool to the toolbar.
  AddControl(self, control)
Adds any control to the toolbar, typically e.g.
  AddRadioTool(self, toolId, label, bitmap1, bitmap2, shortHelp, longHelp)
Adds a new radio tool to the toolbar.
  AddSeparator(self)
Adds a separator for spacing groups of tools in toolbar.
  AddTool(self, toolId, label, bitmap1, bitmap2, kind, shortHelp, longHelp)
Adds a tool to the toolbar.
  Append(self, menu, title)
Adds the item to the end of the menu bar.
  AppendToolbarItem(self, item)
Deprecated since version 0.9.
  ClearBitmaps(self, start)
Restores a wx.NullBitmap for the menu.
  CreateMoreMenu(self)
Creates the drop down menu and populate it.
  DoGiveHelp(self, hit)
Gives tooltips and help in StatusBar.
  DoMouseMove(self, pt, leftIsDown)
Handles mouse move event.
  DoToolbarAction(self, idx)
Performs a toolbar button pressed.
  DrawAll(self, dc)
  DrawMoreButton(self, dc, fr, state)
Draws 'more' button to the right side of the menu bar.
  DrawToolbar(self, dc, rect)
Draws the toolbar with the given dc & rect.
  DrawToolbarItem(self, dc, idx, state)
Draws a toolbar item button.
  FindMenu(self, title)
Returns the index of the menu with the given title or wx.NOT_FOUND if no such menu exists in this menubar.
  FindMenuItem(self, id)
Returns a FlatMenuItem according to its id.
  GetActiveToolbarItem(self)
Returns the active toolbar item.
  GetInvisibleMenuItemCount(self)
Returns number of invisible menu items.
  GetInvisibleToolbarItemCount(self)
Returns number of invisible toolbar items.
  GetLastVisibleMenu(self)
Returns the index of the last visible menu on the menu bar.
  GetMenu(self, menuIdx)
Returns the menu at menuIndex (zero-based), user must not release this menu!.
  GetMoreMenuButtonRect(self)
Returns a rectangle surrounding the menu button.
  HitTest(self, pt)
HitTest method for FlatMenuBar.
  Insert(self, pos, menu, title)
Inserts the menu at the given position into the menu bar.
  OnAccelCmd(self, event)
Single function to handle any accelerator key used inside the menubar.
  OnCustimizeDlg(self, event)
Handles the customize dialog here.
  OnEraseBg(self, event)
Handles the wx.EVT_ERASE_BACKGROUND event for FlatMenuBar.
  OnIdle(self, event)
Handles the wx.EVT_IDLE event for FlatMenuBar.
  OnLeaveMenuBar(self, event)
Handles mouse leave event for FlatMenuBar.
  OnLeaveWindow(self, event)
Handles the wx.EVT_LEAVE_WINDOW event for FlatMenuBar (GTK Only).
  OnLeftDown(self, event)
Handles the wx.EVT_LEFT_DOWN event for FlatMenuBar.
  OnLeftUp(self, event)
Handles the wx.EVT_LEFT_UP event for FlatMenuBar.
  OnMenuDismissed(self, event)
Handles menu dismiss event.
  OnMouseMove(self, event)
Handles mouse move event.
  OnPaint(self, event)
Handles the wx.EVT_PAINT event for FlatMenuBar.
  OnSize(self, event)
Handles the wx.EVT_SIZE event for FlatMenuBar.
  OnStatusBarTimer(self)
Handles the timer expiring to delete the longHelp in the StatusBar.
  PopupMoreMenu(self)
Popups the 'more' menu.
  PositionAUI(self, mgr, fixToolbar)
Positions the control inside wxAUI frame manager.
  ProcessMouseMoveFromMenu(self, pt)
This function is called from child menus, this allow a child menu to pass the mouse movement event to the menu bar.
  Remove(self, pos)
Removes the menu from the menu bar and returns the menu object - the caller is responsible for deleting it.
  RemoveHelp(self)
Removes the tooltips and statusbar help (if any) for a button.
  ResetToolbarItems(self)
Used internally.
  SetLCDMonitor(self, lcd)
Sets whether the PC monitor is an LCD or not.
  SetUpdateInterval(self, interval)
Sets the updateUI interval for toolbar items.
  ShowCustomize(self, show)
Shows/hides the drop-down arrow which allows customization of FlatMenu.
  UpdateAcceleratorTable(self)
Updates the parent accelerator table.
  UpdateItem(self, item)
An item with ID was modified.

Property Summary

Instance Method Details

__init__(self, parent, id=-1, iconSize=16, spacer=3, options=5)
(Constructor)

Default class constructor. Parameters: @param parent menu bar parent
Parameters:
id - window id

iconSize - size of the icons in the toolbar (see Resources.py)

options -
  • FM_OPT_IS_LCD - not sure what it is :) gotta ask Andrea.
  • FM_OPT_MINIBAR - use this if you plan to use toolbar only.
  • FM_OPT_SHOW_CUSTOMIZE - show "customize link" in MoreMenu, you will need to write your own handler. See demo.
  • FM_OPT_SHOW_TOOLBAR - set this option is you are planing to use the toolbar.

Overrides:
wx.Panel.__init__

ActivateMenu(self, menuInfo)

Activates menu which its info is menuInfo.

ActivateNextMenu(self)

Activates next menu and make sure all other are non-active.

ActivatePreviousMenu(self)

Activates previous menu and make sure all other are non-active.

AddCheckTool(self, toolId, label='', bitmap1=<wx._gdi.Bitmap; proxy of <Swig Object of type 'wxBitmap ..., bitmap2=<wx._gdi.Bitmap; proxy of <Swig Object of type 'wxBitmap ..., shortHelp='', longHelp='')

Adds a new check (or toggle) tool to the toolbar. See FlatMenuBar.AddTool for parameter descriptions.

AddControl(self, control)

Adds any control to the toolbar, typically e.g. a combobox.

@param control The control to be added.

AddRadioTool(self, toolId, label='', bitmap1=<wx._gdi.Bitmap; proxy of <Swig Object of type 'wxBitmap ..., bitmap2=<wx._gdi.Bitmap; proxy of <Swig Object of type 'wxBitmap ..., shortHelp='', longHelp='')

Adds a new radio tool to the toolbar. Consecutive radio tools form a radio group such that exactly one button in the group is pressed at any moment, in other words whenever a button in the group is pressed the previously pressed button is automatically released. You should avoid having the radio groups of only one element as it would be impossible for the user to use such button.

By default, the first button in the radio group is initially pressed, the others are not. See FlatMenuBar.AddTool for parameter descriptions.

AddSeparator(self)

Adds a separator for spacing groups of tools in toolbar.

AddTool(self, toolId, label='', bitmap1=<wx._gdi.Bitmap; proxy of <Swig Object of type 'wxBitmap ..., bitmap2=<wx._gdi.Bitmap; proxy of <Swig Object of type 'wxBitmap ..., kind=0, shortHelp='', longHelp='')

Adds a tool to the toolbar.

@param toolId An integer by which the tool may be identified in subsequent operations. @param kind May be wxITEM_NORMAL for a normal button (default), wxITEM_CHECK for a checkable tool (such tool stays pressed after it had been toggled) or wxITEM_RADIO for a checkable tool which makes part of a radio group of tools each of which is automatically unchecked whenever another button in the group is checked @param bitmap1 The primary tool bitmap. @param bitmap2 The bitmap used when the tool is disabled. If it is equal to wxNullBitmap, the disabled bitmap is automatically generated by greing the normal one. @param shortHelpString This string is used for the tools tooltip @param longHelpString This string is shown in the statusbar (if any) of the parent frame when the mouse pointer is inside the tool

Append(self, menu, title)

Adds the item to the end of the menu bar.

AppendToolbarItem(self, item)

Deprecated since version 0.9.

ClearBitmaps(self, start)

Restores a wx.NullBitmap for the menu.

CreateMoreMenu(self)

Creates the drop down menu and populate it.

DoGiveHelp(self, hit)

Gives tooltips and help in StatusBar.

DoMouseMove(self, pt, leftIsDown)

Handles mouse move event.

DoToolbarAction(self, idx)

Performs a toolbar button pressed.

DrawMoreButton(self, dc, fr, state)

Draws 'more' button to the right side of the menu bar.

DrawToolbar(self, dc, rect)

Draws the toolbar with the given dc & rect.

DrawToolbarItem(self, dc, idx, state)

Draws a toolbar item button.

FindMenu(self, title)

Returns the index of the menu with the given title or wx.NOT_FOUND if no such menu exists in this menubar. The title parameter may specify either the menu title (with accelerator characters, i.e. "&File") or just the menu label ("File") indifferently.

FindMenuItem(self, id)

Returns a FlatMenuItem according to its id.

GetActiveToolbarItem(self)

Returns the active toolbar item.

GetInvisibleMenuItemCount(self)

Returns number of invisible menu items. Valid only after wx.EVT_PAINT has been processed after resize.

GetInvisibleToolbarItemCount(self)

Returns number of invisible toolbar items. Valid only after wx.EVT_PAINT has been processed after resize.

GetLastVisibleMenu(self)

Returns the index of the last visible menu on the menu bar.

GetMenu(self, menuIdx)

Returns the menu at menuIndex (zero-based), user must not release this menu!.

GetMoreMenuButtonRect(self)

Returns a rectangle surrounding the menu button.

HitTest(self, pt)

HitTest method for FlatMenuBar.
Overrides:
wx.Window.HitTest

Insert(self, pos, menu, title)

Inserts the menu at the given position into the menu bar. Inserting menu at position 0 will insert it in the very beginning of it, inserting at position GetMenuCount() is the same as calling Append().

OnAccelCmd(self, event)

Single function to handle any accelerator key used inside the menubar.

OnCustimizeDlg(self, event)

Handles the customize dialog here.

OnEraseBg(self, event)

Handles the wx.EVT_ERASE_BACKGROUND event for FlatMenuBar.

OnIdle(self, event)

Handles the wx.EVT_IDLE event for FlatMenuBar.

OnLeaveMenuBar(self, event)

Handles mouse leave event for FlatMenuBar.

OnLeaveWindow(self, event)

Handles the wx.EVT_LEAVE_WINDOW event for FlatMenuBar (GTK Only).

OnLeftDown(self, event)

Handles the wx.EVT_LEFT_DOWN event for FlatMenuBar.

OnLeftUp(self, event)

Handles the wx.EVT_LEFT_UP event for FlatMenuBar.

OnMenuDismissed(self, event)

Handles menu dismiss event.

OnMouseMove(self, event)

Handles mouse move event.

OnPaint(self, event)

Handles the wx.EVT_PAINT event for FlatMenuBar.

OnSize(self, event)

Handles the wx.EVT_SIZE event for FlatMenuBar.

OnStatusBarTimer(self)

Handles the timer expiring to delete the longHelp in the StatusBar.

PopupMoreMenu(self)

Popups the 'more' menu.

PositionAUI(self, mgr, fixToolbar=True)

Positions the control inside wxAUI frame manager.

ProcessMouseMoveFromMenu(self, pt)

This function is called from child menus, this allow a child menu to pass the mouse movement event to the menu bar.

Remove(self, pos)

Removes the menu from the menu bar and returns the menu object - the caller is responsible for deleting it. This function may be used together with FlatMenuBar.Insert to change the menubar dynamically.

RemoveHelp(self)

Removes the tooltips and statusbar help (if any) for a button.

ResetToolbarItems(self)

Used internally.

SetLCDMonitor(self, lcd=True)

Sets whether the PC monitor is an LCD or not.

SetUpdateInterval(self, interval)

Sets the updateUI interval for toolbar items. All UpdateUI events are sent from within OnIdle() handler, the default is 20 milliseconds.

ShowCustomize(self, show=True)

Shows/hides the drop-down arrow which allows customization of FlatMenu.

UpdateAcceleratorTable(self)

Updates the parent accelerator table.

UpdateItem(self, item)

An item with ID was modified. This function is called by FlatMenu in case an item was modified directly and not via updateUI event.

Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:54:01 2009 http://epydoc.sf.net