ZoomBar is a class that appoximatively mimics the behaviour of the Mac Dock, inside a wx.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 wx.EVT_ERASE_BACKGROUND event for ZoomBar. |
OnLeaveWindow | Handles the wx.EVT_LEAVE_WINDOW event for ZoomBar. |
OnLeftDown | Handles the wx.EVT_LEFT_DOWN and wx.EVT_LEFT_DCLICK events for ZoomBar. |
OnLeftUp | Handles the wx.EVT_LEFT_UP event for ZoomBar. |
OnMotion | Handles the wx.EVT_MOTION event for ZoomBar. |
OnPaint | Handles the wx.EVT_PAINT event for ZoomBar. |
OnSize | Handles the wx.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. |
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 wx.Panel.
This is the main class implementation.
Default class constructor.
Parameters: |
|
---|
Adds a button to ZoomBar.
Parameters: |
|
---|
Adds a separator 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 wx.PyControl.
Draws all the main button bitmaps on the ZoomBar client window.
Parameters: | dc – an instance of wx.DC. |
---|
Draws all the button labels on the ZoomBar client window.
Parameters: | dc – an instance of wx.DC. |
---|
Draws all the reflection button bitmaps on the ZoomBar client window.
Parameters: | dc – an instance of wx.DC. |
---|
Enables/disables the button at position index.
Parameters: |
|
---|
HitTest method for ZoomBar.
Parameters: | pos – the current mouse position. |
---|---|
Returns: | an index representing the button on which the mouse is hovering, or wx.NOT_FOUND if no button has been hit. |
Returns True if the button at position index is enabled, False otherwise.
Parameters: | index – the index of the button to check. |
---|
Handles the wx.EVT_ERASE_BACKGROUND event for ZoomBar.
Parameters: | event – a wx.EraseEvent event to be processed. |
---|
Note
This method is intentionally empty to avoid flicker.
Handles the wx.EVT_LEAVE_WINDOW event for ZoomBar.
Parameters: | event – a wx.MouseEvent event to be processed. |
---|
Handles the wx.EVT_LEFT_DOWN and wx.EVT_LEFT_DCLICK events for ZoomBar.
Parameters: | event – a wx.MouseEvent event to be processed. |
---|
Handles the wx.EVT_LEFT_UP event for ZoomBar.
Parameters: | event – a wx.MouseEvent event to be processed. |
---|
Handles the wx.EVT_MOTION event for ZoomBar.
Parameters: | event – a wx.MouseEvent event to be processed. |
---|
Handles the wx.EVT_PAINT event for ZoomBar.
Parameters: | event – a wx.PaintEvent event to be processed. |
---|
Handles the wx.EVT_SIZE event for ZoomBar.
Parameters: | event – a wx.SizeEvent event to be processed. |
---|
Repositions all the buttons inside the ZoomBar.
Parameters: | toButton – the button currently hovered by the mouse (and hence zoomed). |
---|
Resets all the button sizes and positions, recalculating the optimal ZoomBar size.
Sets the background button bar colour.
Parameters: | colour – an instance of wx.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. |
---|