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