.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2020 by Total Control Software License: wxWindows License .. include:: headings.inc .. currentmodule:: wx.lib.agw.flatmenu .. highlight:: python .. _wx.lib.agw.flatmenu.FlatMenuBar: ========================================================================================================================================== |phoenix_title| **wx.lib.agw.flatmenu.FlatMenuBar** ========================================================================================================================================== Implements the generic owner-drawn menu bar for :class:`FlatMenu`. | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class FlatMenuBar:
| |appearance| Control Appearance =============================== | .. figure:: _static/images/widgets/fullsize/wxmsw/wx.lib.agw.flatmenu.flatmenubar.png :alt: wxMSW :figclass: floatleft **wxMSW** .. figure:: _static/images/widgets/fullsize/wxmac/../no_appearance.png :alt: wxMAC :figclass: floatright **wxMAC** .. figure:: _static/images/widgets/fullsize/wxgtk/../no_appearance.png :alt: wxGTK :figclass: floatcenter **wxGTK** | |super_classes| Known Superclasses ================================== :class:`wx.Panel` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.__init__` Default class constructor. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.ActivateMenu` Activates a menu. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.ActivateNextMenu` Activates next menu and make sure all others are non-active. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.ActivatePreviousMenu` Activates previous menu and make sure all others are non-active. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.AddCheckTool` Adds a new check (or toggle) tool to the toolbar. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.AddControl` Adds any control to the toolbar, typically e.g. a combobox. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.AddRadioTool` Adds a new radio tool to the toolbar. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.AddSeparator` Adds a separator for spacing groups of tools in toolbar. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.AddTool` Adds a tool to the toolbar. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.Append` Adds the item to the end of the menu bar. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.AppendToolbarItem` Appends a tool to the :class:`FlatMenuBar`. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.ClearBitmaps` Restores a :class:`NullBitmap` for all the items in the menu. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.CreateMoreMenu` Creates the drop down menu and populate it. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.DoGiveHelp` Gives tooltips and help in :class:`StatusBar`. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.DoMouseMove` Handles mouse move event. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.DoToolbarAction` Performs a toolbar button pressed action. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.DrawMoreButton` Draws 'more' button to the right side of the menu bar. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.DrawToolbar` Draws the toolbar (if present). :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.DrawToolbarItem` Draws a toolbar item button. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.FindMenu` Returns the index of the menu with the given title or ``wx.NOT_FOUND`` if :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.FindMenuItem` Finds the menu item object associated with the given menu item identifier. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.GetActiveToolbarItem` Returns the active toolbar item. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.GetBackgroundColour` Returns the menu bar background colour. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.GetInvisibleMenuItemCount` Returns the number of invisible menu items. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.GetInvisibleToolbarItemCount` Returns the number of invisible toolbar items. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.GetLastVisibleMenu` Returns the index of the last visible menu on the menu bar. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.GetMenu` Returns the menu at the specified index `menuIdx` (zero-based). :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.GetMenuCount` Returns the number of menus in the menubar. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.GetMoreMenuButtonRect` Returns a rectangle region, as an instance of :class:`wx.Rect`, surrounding the menu button. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.GetOptions` Returns the :class:`FlatMenuBar` options, whether to show a toolbar, to use LCD screen settings etc... :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.GetRenderer` Returns the renderer associated with this instance. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.GetRendererManager` Returns the :class:`FlatMenuBar` renderer manager. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.HitTest` HitTest method for :class:`FlatMenuBar`. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.Insert` Inserts the menu at the given position into the menu bar. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.OnAccelCmd` Single function to handle any accelerator key used inside the menubar. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.OnCustomizeDlg` Handles the customize dialog here. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.OnEraseBackground` Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`FlatMenuBar`. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.OnIdle` Handles the ``wx.EVT_IDLE`` event for :class:`FlatMenuBar`. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.OnLeaveMenuBar` Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`FlatMenuBar`. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.OnLeaveWindow` Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`FlatMenuBar`. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.OnLeftDown` Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`FlatMenuBar`. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.OnLeftUp` Handles the ``wx.EVT_LEFT_UP`` event for :class:`FlatMenuBar`. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.OnMenuDismissed` Handles the ``EVT_FLAT_MENU_DISMISSED`` event for :class:`FlatMenuBar`. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.OnMouseMove` Handles the ``wx.EVT_MOTION`` event for :class:`FlatMenuBar`. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.OnPaint` Handles the ``wx.EVT_PAINT`` event for :class:`FlatMenuBar`. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.OnSize` Handles the ``wx.EVT_SIZE`` event for :class:`FlatMenuBar`. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.OnStatusBarTimer` Handles the timer expiring to delete the `longHelp` string in the :class:`StatusBar`. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.PopupMoreMenu` Pops up the 'more' menu. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.PositionAUI` Positions the control inside a wxAUI / PyAUI frame manager. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.ProcessMouseMoveFromMenu` This function is called from child menus, this allow a child menu to :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.Remove` Removes the menu from the menu bar and returns the menu object - the :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.RemoveHelp` Removes the tooltips and statusbar help (if any) for a button. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.ResetToolbarItems` Used internally. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.SetBackgroundColour` Sets the menu bar background colour. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.SetBarHeight` Recalculates the :class:`FlatMenuBar` height when its settings change. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.SetLCDMonitor` Sets whether the PC monitor is an LCD or not. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.SetMargin` Sets the margin above and below the menu bar text. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.SetOptions` Sets the :class:`FlatMenuBar` options, whether to show a toolbar, to use LCD screen settings etc... :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.SetSpacing` Sets the spacing between the menubar items. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.SetToolbarMargin` Sets the margin around the toolbar. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.SetToolbarSpacing` Sets the spacing between the toolbar tools. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.SetUpdateInterval` Sets the UpdateUI interval for toolbar items. All UpdateUI events are :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.ShowCustomize` Shows/hides the drop-down arrow which allows customization of :class:`FlatMenu`. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.UpdateAcceleratorTable` Updates the parent accelerator table. :meth:`~wx.lib.agw.flatmenu.FlatMenuBar.UpdateItem` An item was modified. This function is called by :class:`FlatMenu` in case ================================================================================ ================================================================================ | |api| Class API =============== .. class:: FlatMenuBar(wx.Panel) Implements the generic owner-drawn menu bar for :class:`FlatMenu`. .. method:: __init__(self, parent, id=wx.ID_ANY, iconSize=SmallIcons, spacer=SPACER, options=FM_OPT_SHOW_CUSTOMIZE|FM_OPT_IS_LCD) Default class constructor. :param `parent`: the menu bar parent, must not be ``None``; :param integer `id`: the window identifier. If ``wx.ID_ANY``, will automatically create an identifier; :param integer `iconSize`: size of the icons in the toolbar. This can be one of the following values (in pixels): ==================== ======= ============================= `iconSize` Bit Value Description ==================== ======= ============================= ``LargeIcons`` 32 Use large 32x32 icons ``SmallIcons`` 16 Use standard 16x16 icons ==================== ======= ============================= :param integer `spacer`: the space between the menu bar text and the menu bar border; :param integer `options`: a combination of the following bits: ========================= ========= ============================= `options` Bit Hex Value Description ========================= ========= ============================= ``FM_OPT_IS_LCD`` 0x1 Use this style if your computer uses a LCD screen ``FM_OPT_MINIBAR`` 0x2 Use this if you plan to use toolbar only ``FM_OPT_SHOW_CUSTOMIZE`` 0x4 Show "customize link" in more menus, you will need to write your own handler. See demo. ``FM_OPT_SHOW_TOOLBAR`` 0x8 Set this option is you are planing to use the toolbar ========================= ========= ============================= .. method:: ActivateMenu(self, menuInfo) Activates a menu. :param `menuInfo`: an instance of :class:`wx.MenuEntryInfo`. .. method:: ActivateNextMenu(self) Activates next menu and make sure all others are non-active. .. method:: ActivatePreviousMenu(self) Activates previous menu and make sure all others are non-active. .. method:: AddCheckTool(self, toolId, label="", bitmap1=wx.NullBitmap, bitmap2=wx.NullBitmap, shortHelp="", longHelp="") Adds a new check (or toggle) tool to the toolbar. .. seealso:: :meth:`~FlatMenuBar.AddTool` for parameter descriptions. .. method:: AddControl(self, control) Adds any control to the toolbar, typically e.g. a combobox. :param `control`: the control to be added, a subclass of :class:`wx.Window` (but no :class:`TopLevelWindow`). .. method:: AddRadioTool(self, toolId, label= "", bitmap1=wx.NullBitmap, bitmap2=wx.NullBitmap, 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. .. seealso:: :meth:`~FlatMenuBar.AddTool` for parameter descriptions. .. method:: AddSeparator(self) Adds a separator for spacing groups of tools in toolbar. .. method:: AddTool(self, toolId, label="", bitmap1=wx.NullBitmap, bitmap2=wx.NullBitmap, kind=wx.ITEM_NORMAL, shortHelp="", longHelp="") Adds a tool to the toolbar. :param integer `toolId`: an integer by which the tool may be identified in subsequent operations; :param string `label`: the tool label string; :param integer `kind`: may be ``wx.ITEM_NORMAL`` for a normal button (default), ``wx.ITEM_CHECK`` for a checkable tool (such tool stays pressed after it had been toggled) or ``wx.ITEM_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, an instance of :class:`wx.Bitmap`; :param `bitmap2`: the bitmap used when the tool is disabled. If it is equal to :class:`NullBitmap`, the disabled bitmap is automatically generated by greing out the normal one; :param string `shortHelp`: a string used for the tools tooltip; :param string `longHelp`: this string is shown in the :class:`StatusBar` (if any) of the parent frame when the mouse pointer is inside the tool. .. method:: Append(self, menu, title) Adds the item to the end of the menu bar. :param `menu`: the menu to which we are appending a new item, an instance of :class:`FlatMenu`; :param string `title`: the menu item label, must not be empty. .. seealso:: :meth:`~FlatMenuBar.Insert`. .. method:: AppendToolbarItem(self, item) Appends a tool to the :class:`FlatMenuBar`. .. deprecated:: 0.9.5 This method is now deprecated. .. seealso:: :meth:`~FlatMenuBar.AddTool` .. method:: ClearBitmaps(self, start=0) Restores a :class:`NullBitmap` for all the items in the menu. :param integer `start`: the index at which to start resetting the bitmaps. .. method:: CreateMoreMenu(self) Creates the drop down menu and populate it. .. method:: DoGiveHelp(self, hit) Gives tooltips and help in :class:`StatusBar`. :param `hit`: the toolbar tool currently hovered by the mouse. .. method:: DoMouseMove(self, pt, leftIsDown) Handles mouse move event. :param `pt`: an instance of :class:`wx.Point`; :param bool `leftIsDown`: ``True`` is the left mouse button is down, ``False`` otherwise. .. method:: DoToolbarAction(self, idx) Performs a toolbar button pressed action. :param integer `idx`: the tool index in the toolbar. .. method:: DrawMoreButton(self, dc, state) Draws 'more' button to the right side of the menu bar. :param `dc`: an instance of :class:`wx.DC`; :param integer `state`: the 'more' button state. .. seealso:: :meth:`wx.MenuEntryInfo.SetState() ` for a list of valid menu states. .. method:: DrawToolbar(self, dc, rect) Draws the toolbar (if present). :param `dc`: an instance of :class:`wx.DC`; :param `rect`: the toolbar client rectangle, an instance of :class:`wx.Rect`. .. method:: DrawToolbarItem(self, dc, idx, state) Draws a toolbar item button. :param `dc`: an instance of :class:`wx.DC`; :param integer `idx`: the tool index in the toolbar; :param integer `state`: the button state. .. seealso:: :meth:`wx.MenuEntryInfo.SetState() ` for a list of valid menu states. .. method:: 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. :param string `title`: may specify either the menu title (with accelerator characters, i.e. "&File") or just the menu label ("File") indifferently. .. method:: FindMenuItem(self, id) Finds the menu item object associated with the given menu item identifier. :param integer `id`: the identifier for the sought :class:`FlatMenuItem`. :return: The found menu item object, or ``None`` if one was not found. .. method:: GetActiveToolbarItem(self) Returns the active toolbar item. .. method:: GetBackgroundColour(self) Returns the menu bar background colour. .. method:: GetInvisibleMenuItemCount(self) Returns the number of invisible menu items. .. note:: Valid only after the :class:`PaintEvent` has been processed after a resize. .. method:: GetInvisibleToolbarItemCount(self) Returns the number of invisible toolbar items. .. note:: Valid only after the :class:`PaintEvent` has been processed after a resize. .. method:: GetLastVisibleMenu(self) Returns the index of the last visible menu on the menu bar. .. method:: GetMenu(self, menuIdx) Returns the menu at the specified index `menuIdx` (zero-based). :param integer `menuIdx`: the index of the sought menu. :return: The found menu item object, or ``None`` if one was not found. .. method:: GetMenuCount(self) Returns the number of menus in the menubar. .. method:: GetMoreMenuButtonRect(self) Returns a rectangle region, as an instance of :class:`wx.Rect`, surrounding the menu button. .. method:: GetOptions(self) Returns the :class:`FlatMenuBar` options, whether to show a toolbar, to use LCD screen settings etc... .. seealso:: :meth:`~FlatMenuBar.SetOptions` for a list of valid options. .. method:: GetRenderer(self) Returns the renderer associated with this instance. .. method:: GetRendererManager(self) Returns the :class:`FlatMenuBar` renderer manager. .. method:: HitTest(self, pt) HitTest method for :class:`FlatMenuBar`. :param `pt`: an instance of :class:`wx.Point`, specifying the hit test position. :return: A tuple representing one of the following combinations: ========================= ================================================== Return Tuple Description ========================= ================================================== (-1, 0) The :meth:`~FlatMenuBar.HitTest` method didn't find any item with the specified input point `pt` (``NoWhere`` = 0) (`integer`, 1) A menu item has been hit, its position specified by the tuple item `integer` (``MenuItem`` = 1) (`integer`, 2) A toolbar item has ben hit, its position specified by the tuple item `integer` (``ToolbarItem`` = 2) (-1, 3) The drop-down area button has been hit (``DropDownArrowButton`` = 3) ========================= ================================================== .. method:: Insert(self, pos, menu, title) Inserts the menu at the given position into the menu bar. :param integer `pos`: the position of the new menu in the menu bar; :param `menu`: the menu to add, an instance of :class:`FlatMenu`. :class:`FlatMenuBar` owns the menu and will free it; :param string `title`: the title of the menu. .. note:: Inserting menu at position 0 will insert it in the very beginning of it, inserting at position :meth:`~FlatMenuBar.GetMenuCount` is the same as calling :meth:`~FlatMenuBar.Append`. .. method:: OnAccelCmd(self, event) Single function to handle any accelerator key used inside the menubar. :param `event`: a :class:`FlatMenuEvent` event to be processed. .. method:: OnCustomizeDlg(self, event) Handles the customize dialog here. :param `event`: a :class:`FlatMenuEvent` event to be processed. .. method:: OnEraseBackground(self, event) Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`FlatMenuBar`. :param `event`: a :class:`EraseEvent` event to be processed. .. note:: This method is intentionally empty to reduce flicker. .. method:: OnIdle(self, event) Handles the ``wx.EVT_IDLE`` event for :class:`FlatMenuBar`. :param `event`: a :class:`IdleEvent` event to be processed. .. method:: OnLeaveMenuBar(self, event) Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`FlatMenuBar`. :param `event`: a :class:`MouseEvent` event to be processed. .. note:: This method is for MSW only. .. method:: OnLeaveWindow(self, event) Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`FlatMenuBar`. :param `event`: a :class:`MouseEvent` event to be processed. .. note:: This method is for GTK only. .. method:: OnLeftDown(self, event) Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`FlatMenuBar`. :param `event`: a :class:`MouseEvent` event to be processed. .. method:: OnLeftUp(self, event) Handles the ``wx.EVT_LEFT_UP`` event for :class:`FlatMenuBar`. :param `event`: a :class:`MouseEvent` event to be processed. .. method:: OnMenuDismissed(self, event) Handles the ``EVT_FLAT_MENU_DISMISSED`` event for :class:`FlatMenuBar`. :param `event`: a :class:`FlatMenuEvent` event to be processed. .. method:: OnMouseMove(self, event) Handles the ``wx.EVT_MOTION`` event for :class:`FlatMenuBar`. :param `event`: a :class:`MouseEvent` event to be processed. .. method:: OnPaint(self, event) Handles the ``wx.EVT_PAINT`` event for :class:`FlatMenuBar`. :param `event`: a :class:`PaintEvent` event to be processed. .. method:: OnSize(self, event) Handles the ``wx.EVT_SIZE`` event for :class:`FlatMenuBar`. :param `event`: a :class:`wx.SizeEvent` event to be processed. .. method:: OnStatusBarTimer(self) Handles the timer expiring to delete the `longHelp` string in the :class:`StatusBar`. .. method:: PopupMoreMenu(self) Pops up the 'more' menu. .. method:: PositionAUI(self, mgr, fixToolbar=True) Positions the control inside a wxAUI / PyAUI frame manager. :param `mgr`: an instance of :class:`~wx.lib.agw.aui.framemanager.AuiManager` or :class:`framemanager`; :param bool `fixToolbar`: ``True`` if :class:`FlatMenuBar` can not be floated. .. method:: 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. :param `pt`: an instance of :class:`wx.Point`. .. method:: Remove(self, pos) Removes the menu from the menu bar and returns the menu object - the caller is responsible for deleting it. :param integer `pos`: the position of the menu in the menu bar. .. note:: This function may be used together with :meth:`~FlatMenuBar.Insert` to change the menubar dynamically. .. method:: RemoveHelp(self) Removes the tooltips and statusbar help (if any) for a button. .. method:: ResetToolbarItems(self) Used internally. .. method:: SetBackgroundColour(self, colour) Sets the menu bar background colour. :param `colour`: a valid :class:`wx.Colour`. .. method:: SetBarHeight(self) Recalculates the :class:`FlatMenuBar` height when its settings change. .. method:: SetLCDMonitor(self, lcd=True) Sets whether the PC monitor is an LCD or not. :param bool `lcd`: ``True`` to use the settings appropriate for a LCD monitor, ``False`` otherwise. .. method:: SetMargin(self, margin) Sets the margin above and below the menu bar text. :param integer `margin`: height in pixels of the margin. .. method:: SetOptions(self, options) Sets the :class:`FlatMenuBar` options, whether to show a toolbar, to use LCD screen settings etc... :param integer `options`: a combination of the following bits: ========================= ========= ============================= `options` Bit Hex Value Description ========================= ========= ============================= ``FM_OPT_IS_LCD`` 0x1 Use this style if your computer uses a LCD screen ``FM_OPT_MINIBAR`` 0x2 Use this if you plan to use toolbar only ``FM_OPT_SHOW_CUSTOMIZE`` 0x4 Show "customize link" in more menus, you will need to write your own handler. See demo. ``FM_OPT_SHOW_TOOLBAR`` 0x8 Set this option is you are planing to use the toolbar ========================= ========= ============================= .. method:: SetSpacing(self, spacer) Sets the spacing between the menubar items. :param integer `spacer`: number of pixels between each menu item. .. method:: SetToolbarMargin(self, margin) Sets the margin around the toolbar. :param integer `margin`: width in pixels of the margin around the tools in the toolbar. .. method:: SetToolbarSpacing(self, spacer) Sets the spacing between the toolbar tools. :param integer `spacer`: number of pixels between each tool in the toolbar. .. method:: SetUpdateInterval(self, interval) Sets the UpdateUI interval for toolbar items. All UpdateUI events are sent from within :meth:`~FlatMenuBar.OnIdle` handler, the default is 20 milliseconds. :param integer `interval`: the updateUI interval in milliseconds. .. method:: ShowCustomize(self, show=True) Shows/hides the drop-down arrow which allows customization of :class:`FlatMenu`. :param bool `show`: ``True`` to show the customize menu, ``False`` to hide it. .. method:: UpdateAcceleratorTable(self) Updates the parent accelerator table. .. method:: UpdateItem(self, item) An item was modified. This function is called by :class:`FlatMenu` in case an item was modified directly and not via a :class:`UpdateUIEvent` event. :param `item`: an instance of :class:`FlatMenu`.