phoenix_title wx.lib.agw.buttonpanel.ButtonPanel

A custom panel class with gradient background shading with the possibility to add buttons and controls still respecting the gradient background.


class_hierarchy Class Hierarchy

Inheritance diagram for class ButtonPanel:

appearance Control Appearance


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


super_classes Known Superclasses

wx.Panel


method_summary Methods Summary

__init__

Default class constructor.

AddButton

Adds a button to ButtonPanel.

AddControl

Adds a wxPython control to ButtonPanel.

AddSeparator

Adds a separator line to ButtonPanel.

AddSpacer

Adds a spacer (stretchable or fixed-size) to ButtonPanel.

Clear

Clears the ButtonPanel.

DoGetBestSize

Gets the size which best suits ButtonPanel: for a control, it would be

DoGiveHelp

Shows tooltips and long help strings in StatusBar.

DoLayout

Do the Layout for ButtonPanel.

FlexibleLayout

Layout the items when the main caption exists.

GetAlignment

Returns the buttons alignment.

GetBarText

Returns the main caption text.

GetBPArt

Returns the associated BPArt art provider.

GetControls

Returns the wxPython controls that belongs to ButtonPanel.

GetItemSize

Returns the size of an item in the main ButtonPanel sizer.

GetNonFlexibleChildren

Returns all the ButtonPanel main sizer’s children that are not

GetStyle

Returns the ButtonPanel window style.

GetUseHelp

Returns whether or not short and long help strings should be displayed as tooltips

HasBarText

Returns whether ButtonPanel has a main caption text or not.

HitTest

HitTest method for ButtonPanel.

IsStandard

Returns whether ButtonPanel is aligned “Standard” (left/top) or not.

IsVertical

Returns whether ButtonPanel is vertically aligned or not.

LayoutItems

Layout the items using a different algorithms depending on the existence

OnEraseBackground

Handles the wx.EVT_ERASE_BACKGROUND event for ButtonPanel.

OnLeftDown

Handles the wx.EVT_LEFT_DOWN event for ButtonPanel.

OnLeftUp

Handles the wx.EVT_LEFT_UP event for ButtonPanel.

OnMouseEnterWindow

Handles the wx.EVT_ENTER_WINDOW event for ButtonPanel.

OnMouseLeave

Handles the wx.EVT_LEAVE_WINDOW event for ButtonPanel.

OnMouseMove

Handles the wx.EVT_MOTION event for ButtonPanel.

OnPaint

Handles the wx.EVT_PAINT event for ButtonPanel.

OnSize

Handles the wx.EVT_SIZE event for ButtonPanel.

OnStatusBarTimer

Handles the timer expiring to delete the long help string in StatusBar.

ReCreateSizer

Recreates the ButtonPanel sizer accordingly to the alignment specified.

RemoveAllButtons

Remove all the buttons from ButtonPanel.

RemoveAllSeparators

Remove all the separators from ButtonPanel.

RemoveHelp

Removes the tooltips and statusbar help (if any) for a button.

RemoveText

Removes the main caption text.

RepaintOldSelection

Repaints the old selected/hovered button.

SetAlignment

Sets the buttons alignment.

SetBarText

Sets the main caption text.

SetBPArt

Sets a new BPArt art provider to ButtonPanel.

SetStyle

Sets the ButtonPanel window style.

SetUseHelp

Sets whether or not short and long help strings should be displayed as tooltips

SizeLayout

Layout the items when no main caption exists.


api Class API

class ButtonPanel(wx.Panel)

A custom panel class with gradient background shading with the possibility to add buttons and controls still respecting the gradient background.


Methods

__init__(self, parent, id=wx.ID_ANY, text='', agwStyle=BP_DEFAULT_STYLE, alignment=BP_ALIGN_LEFT, name='buttonPanel')

Default class constructor.

Parameters:
  • parent (wx.Window) – the parent window. Must not be None;

  • id (integer) – window identifier. If wx.ID_ANY, will automatically create an identifier;

  • text (string) – the main caption text for ButtonPanel;

  • agwStyle (integer) – the AGW-specific window style (one of BP_DEFAULT_STYLE, BP_USE_GRADIENT);

  • alignment (integer) – alignment of buttons (left or right);

  • name (string) – window class name.



AddButton(self, btnInfo)

Adds a button to ButtonPanel.

Parameters:

btnInfo – an instance of ButtonInfo.

Note

Remember to pass a ButtonInfo instance to this method, and not a standard Button or a ToolBar tool.



AddControl(self, control, proportion=0, flag=wx.ALIGN_CENTER | wx.ALL, border=None)

Adds a wxPython control to ButtonPanel.

Parameters:
  • control – an instance of wx.Window;

  • proportion (integer) – the control proportion (0 for fixed-size, 1 or more for a stretchable one);

  • flag (integer) – one of the BoxSizer flags;

  • border (integer) – the control border width (in pixels), if the flag parameter is set to include any border flag.



AddSeparator(self)

Adds a separator line to ButtonPanel.