.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2017 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. currentmodule:: wx.lib.agw.flatmenu

.. highlight:: python



.. _wx.lib.agw.flatmenu.FlatMenuButton:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.flatmenu.FlatMenuButton**
==========================================================================================================================================

A nice small class that functions like :class:`wx.BitmapButton`, the reason I did
not used :class:`wx.BitmapButton` is that on Linux, it has some extra margins that
I can't seem to be able to remove.



|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>FlatMenuButton</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.lib.agw.flatmenu.FlatMenuButton_inheritance.png" alt="Inheritance diagram of FlatMenuButton" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.agw.flatmenu.FlatMenuButton.html" title="wx.lib.agw.flatmenu.FlatMenuButton" alt="" coords="5,5,256,35"/> </map> 
   </p>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.lib.agw.flatmenu.FlatMenuButton.__init__`                             Default class constructor.
:meth:`~wx.lib.agw.flatmenu.FlatMenuButton.Contains`                             Used internally.
:meth:`~wx.lib.agw.flatmenu.FlatMenuButton.Draw`                                 Draws self at rect using dc.
:meth:`~wx.lib.agw.flatmenu.FlatMenuButton.GetClientRect`                        Returns the client rectangle for :class:`FlatMenuButton`.
:meth:`~wx.lib.agw.flatmenu.FlatMenuButton.GetTimer`                             Returns the timer object.
:meth:`~wx.lib.agw.flatmenu.FlatMenuButton.GetTimerId`                           Returns the timer object identifier.
:meth:`~wx.lib.agw.flatmenu.FlatMenuButton.Move`                                 Moves :class:`FlatMenuButton` to the specified position.
:meth:`~wx.lib.agw.flatmenu.FlatMenuButton.ProcessLeftDown`                      Handles left down mouse events.
:meth:`~wx.lib.agw.flatmenu.FlatMenuButton.ProcessLeftUp`                        Handles left up mouse events.
:meth:`~wx.lib.agw.flatmenu.FlatMenuButton.ProcessMouseMove`                     Handles mouse motion events. This is called any time the mouse moves in the parent menu,
:meth:`~wx.lib.agw.flatmenu.FlatMenuButton.SetSize`                              Sets the size for :class:`FlatMenuButton`.
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: FlatMenuButton(object)

   A nice small class that functions like :class:`wx.BitmapButton`, the reason I did
   not used :class:`wx.BitmapButton` is that on Linux, it has some extra margins that
   I can't seem to be able to remove.

   .. method:: __init__(self, menu, up, normalBmp, disabledBmp=wx.NullBitmap, scrollOnHover=False)

      Default class constructor.
      
      :param `menu`: the parent menu associated with this button, an instance of :class:`FlatMenu`;
      :param bool `up`: ``True`` for up arrow or ``False`` for down arrow;
      :param `normalBmp`: normal state bitmap, an instance of :class:`wx.Bitmap`;
      :param `disabledBmp`: disabled state bitmap, an instance of :class:`wx.Bitmap`.


   .. method:: Contains(self, pt)

      Used internally. 


   .. method:: Draw(self, dc)

      Draws self at rect using dc.
      
      :param `dc`: an instance of :class:`wx.DC`.


   .. method:: GetClientRect(self)

      Returns the client rectangle for :class:`FlatMenuButton`. 


   .. method:: GetTimer(self)

      Returns the timer object. 


   .. method:: GetTimerId(self)

      Returns the timer object identifier. 


   .. method:: Move(self, input1, input2=None)

      Moves :class:`FlatMenuButton` to the specified position.
      
      :param `input1`: if it is an instance of :class:`wx.Point`, it represents the :class:`FlatMenuButton`
       position and the `input2` parameter is not used. Otherwise it is an integer representing
       the button `x` position;
      :param `input2`: if not ``None``, it is an integer representing the button `y` position.


   .. method:: ProcessLeftDown(self, pt)

      Handles left down mouse events.
      
      :param `pt`: an instance of :class:`wx.Point` where the left mouse button was pressed.


   .. method:: ProcessLeftUp(self, pt)

      Handles left up mouse events.
      
      :param `pt`: an instance of :class:`wx.Point` where the left mouse button was released.


   .. method:: ProcessMouseMove(self, pt)

      Handles mouse motion events. This is called any time the mouse moves in the parent menu,
      so we must check to see if the mouse is over the button.
      
      :param `pt`: an instance of :class:`wx.Point` where the mouse pointer was moved.


   .. method:: SetSize(self, input1, input2=None)

      Sets the size for :class:`FlatMenuButton`.
      
      :param `input1`: if it is an instance of :class:`wx.Size`, it represents the :class:`FlatMenuButton`
       size and the `input2` parameter is not used. Otherwise it is an integer representing
       the button width;
      :param `input2`: if not ``None``, it is an integer representing the button height.


