Phoenix Logo

phoenix_title wx.lib.agw.zoombar.ZoomBarImage

This simple class holds information about a ZoomBar button, such as normal bitmaps, disabled bitmap, button label, etc...


class_hierarchy Class Hierarchy

Inheritance diagram for class ZoomBarImage:

method_summary Methods Summary

__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.
SetupProps Set up the button position and size.
SetZoomFactor Sets the zoom factor for the button. Larger number gives a greater zoom
ZoomImage Zooms the button bitmap depending on the mouse x position.

api Class API



class ZoomBarImage(object)

This simple class holds information about a ZoomBar button, such as normal bitmaps, disabled bitmap, button label, etc...


Methods



__init__(self, parent, bitmap, disabledBmp=wx.NullBitmap, label="")

Default class constructor.

Parameters:
  • parent – the main ZoomBar window;
  • bitmap – the button bitmap, an instance of wx.Bitmap;
  • disabledBmp – the button bitmap when the button is in a disabled state;
  • label – the button label.


Enable(self, enable=True)

Enables/disables a button.

Parameters:enableTrue 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.

Parameters:size – the original button size, in pixels.


SetCenterZoom(self, center=True)

Sets to zoom from the center.

Parameters:center – if True button zooms upwards.


SetLabel(self, label)

Sets the button label.

Parameters:label – a string specifying the button label. May be an empty string for no label.


SetSize(self, width, height)

Sets the button size.

Parameters:
  • width – the button width;
  • height – the button height.


SetupProps(self, buttonSize)

Set up the button position and size.

Parameters: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.

Parameters: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.

Parameters:nxcoord – the mouse x position relative to the button center.