ZoomBar is a class that appoximatively mimics the behaviour of the Mac Dock, inside a Panel.
This is the main class implementation.
__init__ | Default class constructor. |
AddButton | Adds a button to ZoomBar. |
AddSeparator | Adds a separator to ZoomBar. |
DoGetBestSize | Gets the size which best suits the window: for a control, it would be the |
DoLayout | Common method to re-layout ZoomBar. |
DrawButtons | Draws all the main button bitmaps on the ZoomBar client window. |
DrawLabels | Draws all the button labels on the ZoomBar client window. |
DrawReflections | Draws all the reflection button bitmaps on the ZoomBar client window. |
EnableButton | Enables/disables the button at position index. |
GetBarColour | Returns the background button bar colour. |
GetButtonSize | Returns the original (not zoomed) button size, in pixels. |
GetCenterZoom | Returns True if buttons zoom upwards. |
GetShowLabels | Returns True if button labels are currently shown. |
GetShowReflections | Returns True if reflections bitmap are currently shown. |
GetZoomFactor | Returns the current zoom factor. |
HitTest | HitTest method for ZoomBar. |
InitialReposition | Sets up the initial buttons and sizes them from the center. |
IsButtonEnabled | Returns True if the button at position index is enabled, False |
OnEraseBackground | Handles the EVT_ERASE_BACKGROUND event for ZoomBar. |
OnLeaveWindow | Handles the EVT_LEAVE_WINDOW event for ZoomBar. |
OnLeftDown | Handles the EVT_LEFT_DOWN and EVT_LEFT_DCLICK events for ZoomBar. |
OnLeftUp | Handles the EVT_LEFT_UP event for ZoomBar. |
OnMotion | Handles the EVT_MOTION event for ZoomBar. |
OnPaint | Handles the EVT_PAINT event for ZoomBar. |
OnSize | Handles the EVT_SIZE event for ZoomBar. |
Reposition | Repositions all the buttons inside the ZoomBar. |
ResetSize | Resets all the button sizes and positions, recalculating the optimal ZoomBar |
SetBarColour | Sets the background button bar colour. |
SetButtonSize | Sets the original button size. |
SetCenterZoom | Sets to zoom from the center. |
SetShowLabels | Sets whether to show button labels or not. |
SetShowReflections | Sets whether to show reflections or not. |
SetZoomFactor | Sets the zoom factor for all the buttons. Larger number gives a greater zoom |
SnapToBottom | Snaps the background button bar bitmap and all the buttons to the bottom |
ZoomBar is a class that appoximatively mimics the behaviour of the Mac Dock, inside a Panel.
This is the main class implementation.
Default class constructor.
Parameters: |
|
---|
Adds a button to ZoomBar.
Parameters: |
|
---|
Gets the size which best suits the window: for a control, it would be the minimal size which doesn’t truncate the control, for a panel - the same size as it would have after a call to Fit().
Note
Overridden from PyControl.
Draws all the main button bitmaps on the ZoomBar client window.
Parameters: | dc – an instance of DC. |
---|
Draws all the button labels on the ZoomBar client window.
Parameters: | dc – an instance of DC. |
---|
Draws all the reflection button bitmaps on the ZoomBar client window.
Parameters: | dc – an instance of DC. |
---|
Enables/disables the button at position index.
Parameters: |
|
---|
Returns the background button bar colour.
Returns the original (not zoomed) button size, in pixels.
Returns True if buttons zoom upwards.
Returns True if button labels are currently shown.
Returns True if reflections bitmap are currently shown.
Returns the current zoom factor.
HitTest method for ZoomBar.
Parameters: | pos – the current mouse position. |
---|---|
Returns: | an index representing the button on which the mouse is hovering, or NOT_FOUND if no button has been hit. |
Sets up the initial buttons and sizes them from the center.
Returns True if the button at position index is enabled, False otherwise.
Parameters: | index – the index of the button to check. |
---|
Handles the EVT_ERASE_BACKGROUND event for ZoomBar.
Parameters: | event – a EraseEvent event to be processed. |
---|
Note
This method is intentionally empty to avoid flicker.
Handles the EVT_LEAVE_WINDOW event for ZoomBar.
Parameters: | event – a MouseEvent event to be processed. |
---|
Handles the EVT_LEFT_DOWN and EVT_LEFT_DCLICK events for ZoomBar.
Parameters: | event – a MouseEvent event to be processed. |
---|
Handles the EVT_LEFT_UP event for ZoomBar.
Parameters: | event – a MouseEvent event to be processed. |
---|
Handles the EVT_MOTION event for ZoomBar.
Parameters: | event – a MouseEvent event to be processed. |
---|
Handles the EVT_PAINT event for ZoomBar.
Parameters: | event – a PaintEvent event to be processed. |
---|
Handles the EVT_SIZE event for ZoomBar.
Parameters: | event – a SizeEvent event to be processed. |
---|
Repositions all the buttons inside the ZoomBar.
Parameters: | toButton – the button currently hovered by the mouse (and hence zoomed). |
---|
Sets the background button bar colour.
Parameters: | colour – an instance of Colour; |
---|
Sets the original button size.
Parameters: | size – the new (not-zoomed) button size, in pixels. |
---|
Sets to zoom from the center.
Parameters: | center – if True button zooms upwards. |
---|
Sets whether to show button labels or not.
Parameters: | show – True to show button labels, False otherwise. |
---|
Sets whether to show reflections or not.
Parameters: | show – True to show reflections, False otherwise. |
---|
Sets the zoom factor for all the buttons. Larger number gives a greater zoom effect.
Parameters: | zoom – a floating point number, greater than or equal to 1.0. |
---|