Phoenix Logo

phoenix_title wx.lib.agw.flatmenu.FlatMenuButton

A nice small class that functions like wx.BitmapButton, the reason I did not used 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

Inheritance diagram for class FlatMenuButton:

method_summary Methods Summary

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

api Class API



class FlatMenuButton(object)

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


Methods



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

Default class constructor.

Parameters:
  • menu – the parent menu associated with this button, an instance of FlatMenu;
  • up (bool) – True for up arrow or False for down arrow;
  • normalBmp – normal state bitmap, an instance of wx.Bitmap;
  • disabledBmp – disabled state bitmap, an instance of wx.Bitmap.


Contains(self, pt)

Used internally.



Draw(self, dc)

Draws self at rect using dc.

Parameters:dc – an instance of wx.DC.


GetClientRect(self)

Returns the client rectangle for FlatMenuButton.



GetTimer(self)

Returns the timer object.



GetTimerId(self)

Returns the timer object identifier.



Move(self, input1, input2=None)

Moves FlatMenuButton to the specified position.

Parameters:
  • input1 – if it is an instance of wx.Point, it represents the FlatMenuButton position and the input2 parameter is not used. Otherwise it is an integer representing the button x position;
  • input2 – if not None, it is an integer representing the button y position.


ProcessLeftDown(self, pt)

Handles left down mouse events.

Parameters:pt – an instance of wx.Point where the left mouse button was pressed.


ProcessLeftUp(self, pt)

Handles left up mouse events.

Parameters:pt – an instance of wx.Point where the left mouse button was released.


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.

Parameters:pt – an instance of wx.Point where the mouse pointer was moved.


SetSize(self, input1, input2=None)

Sets the size for FlatMenuButton.

Parameters:
  • input1 – if it is an instance of wx.Size, it represents the FlatMenuButton size and the input2 parameter is not used. Otherwise it is an integer representing the button width;
  • input2 – if not None, it is an integer representing the button height.