AGW Logo

agw_title ZoomBarImage

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

hierarchy Inheritance Diagram

Inheritance diagram for: ZoomBarImage

Inheritance diagram of ZoomBarImage


method_summary Methods Summary

__init__Default class constructor.
EnableEnables/disables a button.
GetBitmapReturns the button bitmap, which may be a scaled up version of the original
GetLabelReturns the button label (if any).
GetPositionReturns the button position.
GetSizeReturns the button size.
IsEnabledReturns True if the button is enabled, False otherwise.
IsZoomedReturns True if the button is zoomed, False otherwise.
LoopScalesCaches the bitmaps at various zoom levels to avoid calling every time
SetCenterZoomSets to zoom from the center.
SetLabelSets the button label.
SetSizeSets the button size.
SetZoomFactorSets the zoom factor for the button.
SetupPropsSet up the button position and size.
ZoomImageZooms the button bitmap depending on the mouse x position.

API Class API

class ZoomBarImage(object)[source]

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



__init__(parent, bitmap, disabledBmp=wx.NullBitmap, label="")[source]

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(enable=True)[source]

Enables/disables a button.

Parameters:enableTrue to enable a button, False to disable it.


GetBitmap()[source]

Returns the button bitmap, which may be a scaled up version of the original bitmap is the button is being zoomed.



GetLabel()[source]

Returns the button label (if any).



GetPosition()[source]

Returns the button position.



GetSize()[source]

Returns the button size.



IsEnabled()[source]

Returns True if the button is enabled, False otherwise.



IsZoomed()[source]

Returns True if the button is zoomed, False otherwise.



LoopScales(size)[source]

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(center=True)[source]

Sets to zoom from the center.

Parameters:center – if True button zooms upwards.


SetLabel(label)[source]

Sets the button label.

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


SetSize(width, height)[source]

Sets the button size.

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


SetZoomFactor(zoom)[source]

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.


SetupProps(buttonSize)[source]

Set up the button position and size.

Parameters:buttonSize – the button original size (not zoomed), in pixels.


ZoomImage(nxcoord)[source]

Zooms the button bitmap depending on the mouse x position.

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

Table Of Contents

Previous topic

ZoomBarEvent

Next topic

zoombar functions