AGW Logo

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

hierarchy Inheritance Diagram

Inheritance diagram for: FlatMenuButton

Inheritance diagram of FlatMenuButton


method_summary Methods Summary

__init__Default class constructor.
ContainsUsed internally.
DrawDraws self at rect using dc.
GetClientRectReturns the client rectangle for FlatMenuButton.
GetTimerReturns the timer object.
GetTimerIdReturns the timer object identifier.
MoveMoves FlatMenuButton to the specified position.
ProcessLeftDownHandles left down mouse events.
ProcessLeftUpHandles left up mouse events.
ProcessMouseMoveHandles mouse motion events.
SetSizeSets the size for FlatMenuButton.
__del__Used internally.

API Class API

class FlatMenuButton(object)[source]

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.



__init__(menu, up, normalBmp, disabledBmp=wx.NullBitmap, scrollOnHover=False)[source]

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

Used internally.



Draw(dc)[source]

Draws self at rect using dc.

Parameters:dc – an instance of wx.DC.


GetClientRect()[source]

Returns the client rectangle for FlatMenuButton.



GetTimer()[source]

Returns the timer object.



GetTimerId()[source]

Returns the timer object identifier.



Move(input1, input2=None)[source]

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

Handles left down mouse events.

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



ProcessLeftUp(pt)[source]

Handles left up mouse events.

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



ProcessMouseMove(pt)[source]

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(input1, input2=None)[source]

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

Table Of Contents

Previous topic

FlatMenuBase

Next topic

FlatMenuEvent