This simple class holds information about a ZoomBar button, such as normal bitmaps, disabled bitmap, button label, etc...
__init__ | Default class constructor. |
Enable | Enables/disables a button. |
GetBitmap | Returns the button bitmap, which may be a scaled up version of the original |
GetLabel | Returns the button label (if any). |
GetPosition | Returns the button position. |
GetSize | Returns the button size. |
IsEnabled | Returns True if the button is enabled, False otherwise. |
IsZoomed | Returns True if the button is zoomed, False otherwise. |
LoopScales | Caches the bitmaps at various zoom levels to avoid calling every time |
SetCenterZoom | Sets to zoom from the center. |
SetLabel | Sets the button label. |
SetSize | Sets the button size. |
SetZoomFactor | Sets the zoom factor for the button. |
SetupProps | Set up the button position and size. |
ZoomImage | Zooms the button bitmap depending on the mouse x position. |
This simple class holds information about a ZoomBar button, such as normal bitmaps, disabled bitmap, button label, etc...
Default class constructor.
Parameters: |
---|
Enables/disables a button.
Parameters: | enable – True to enable a button, False to disable it. |
---|
Returns the button bitmap, which may be a scaled up version of the original bitmap is the button is being zoomed.
Caches the bitmaps at various zoom levels to avoid calling every time image.Scale on the button bitmap.
Parameters: | size – the original button size, in pixels. |
---|
Sets to zoom from the center.
Parameters: | center – if True button zooms upwards. |
---|
Sets the button label.
Parameters: | label – a string specifying the button label. May be an empty string for no label. |
---|
Sets the button size.
Parameters: |
|
---|
Sets the zoom factor for the button. Larger number gives a greater zoom effect.
Parameters: | zoom – a floating point number, greater than or equal to 1.0. |
---|
Set up the button position and size.
Parameters: | buttonSize – the button original size (not zoomed), in pixels. |
---|