wx.lib.agw.buttonpanel.ButtonInfo¶
This class holds information about every button that is added to
ButtonPanel. It is an auxiliary class that you should use
every time you add a button.
Class Hierarchy¶
Known Superclasses¶
wx.lib.agw.buttonpanel.Control
Methods Summary¶
Default class constructor. |
|
Add a programmer-defined status in addition to the 5 default status |
|
Checks whether a |
|
Draws the button on |
|
Enables/disables this instance of |
|
Returns the best size for the button. |
|
Returns the bitmap associated with this instance of |
|
Returns the |
|
Returns the button type (standard or toggle). |
|
Returns the help string shown in the statusbar. |
|
Returns the |
|
Returns the help string shown in a tooltip. |
|
Returns the |
|
Returns the text associated to the button. |
|
Returns the text alignment in the button (bottom or right). |
|
Returns whether a |
|
Returns whether the button has text or not. |
|
Returns |
|
Sets the bitmap associated with this instance of |
|
Sets the |
|
Sets the button type (standard or toggle). |
|
Sets the help string to be shown in the statusbar. |
|
Sets the |
|
Sets the help string to be shown in a tooltip. |
|
Sets the |
|
Sets the button label text. |
|
Sets the text alignment in the button (bottom or right). |
|
Sets a |
Properties Summary¶
Returns the bitmap associated with this instance of |
|
Returns the |
|
Returns the |
|
Returns the |
Class API¶
- class ButtonInfo(Control)¶
This class holds information about every button that is added to
ButtonPanel. It is an auxiliary class that you should use every time you add a button.
Methods¶
- __init__(self, parent, id=wx.ID_ANY, bmp=wx.NullBitmap, status='Normal', text='', kind=wx.ITEM_NORMAL, shortHelp='', longHelp='')¶
Default class constructor.
- Parameters:
parent – the parent window (
ButtonPanel);id (integer) – the button id;
bmp (wx.Bitmap) – the associated bitmap;
status (string) – button status (“Pressed”, “Hover”, “Normal”, “Toggled”, “Disabled”);
text (string) – text to be displayed either below of to the right of the button;
kind (integer) – button kind, may be
wx.ITEM_NORMALfor standard buttons orwx.ITEM_CHECKfor toggle buttons;shortHelp (string) – a short help to be shown in the button tooltip;
longHelp (string) – this string is shown in the statusbar (if any) of the parent frame when the mouse pointer is inside the button.
- AddStatus(self, name='Custom', bmp=wx.NullBitmap)¶
Add a programmer-defined status in addition to the 5 default status:
Normal;
Disabled;
Hover;
Pressed;
Toggled.
- Parameters:
name (string) – the new status name;
bmp (wx.Bitmap) – the bitmap associated with the new status.
- CheckRefresh(self, status)¶
Checks whether a
ButtonPanelrepaint is needed or not. This is a convenience function.- Parameters:
status (bool) – the status of a newly added
ButtonInfoor a change in theButtonInfostatus.
- Draw(self, dc, rect)¶
Draws the button on
ButtonPanel. Actually the drawing is done inBPArt.
- Enable(self, enable=True)¶
Enables/disables this instance of
ButtonInfo.- Parameters:
enable (bool) –
Trueto enable the button,Falseotherwise.
- GetBitmap(self, status=None)¶
Returns the bitmap associated with this instance of
ButtonInfo.- Parameters:
status (string) – the
ButtonInfostatus (“Pressed”, “Hover”, “Normal”, “Toggled”, “Disabled”).- Returns:
An instance of
wx.Bitmap.
- GetId(self)¶
Returns the
ButtonInfoid.- Returns:
An integer representing the button id.
- GetKind(self)¶
Returns the button type (standard or toggle).
- Returns:
An integer representing the button type, one of
wx.ITEM_NORMAL,wx.ITEM_CHECK.
- GetLongHelp(self)¶
Returns the help string shown in the statusbar.
- Returns:
A string containing the
ButtonInfolong help string.
- GetRect(self)¶
Returns the
ButtonInfoclient rectangle.- Returns:
An instance of
wx.Rect.
- GetShortHelp(self)¶
Returns the help string shown in a tooltip.
- Returns:
A string containing the
ButtonInfoshort help string.
- GetStatus(self)¶
Returns the
ButtonInfostatus.- Returns:
A string containing the
ButtonInfostatus (one of “Pressed”, “Hover”, “Normal”, “Toggled”, “Disabled”).
- GetText(self)¶
Returns the text associated to the button.
- Returns:
A string containing the
ButtonInfotext.
- GetTextAlignment(self)¶
Returns the text alignment in the button (bottom or right).
- Returns:
An integer representing the
ButtonInfotext alignment.
- GetToggled(self)¶
Returns whether a
wx.ITEM_CHECKbutton is toggled or not.- Returns:
Trueif the button is toggled,Falseotherwise.
- HasText(self)¶
Returns whether the button has text or not.
- Returns:
Trueif thisButtonInfoinstance has a label,Falseotherwise.
- IsEnabled(self)¶
Returns
Trueif this instance ofButtonInfois enabled for input,Falseotherwise.
- SetBitmap(self, bmp, status='Normal')¶
Sets the bitmap associated with this instance of
ButtonInfo.- Parameters:
bmp – a valid
wx.Bitmapobject;status (string) – the
ButtonInfostatus (“Pressed”, “Hover”, “Normal”, “Toggled”, “Disabled”).
- SetId(self, id)¶
Sets the
ButtonInfoidentifier.- Parameters:
id (integer) – the identifier of the window.
- SetKind(self, kind=wx.ITEM_NORMAL)¶
Sets the button type (standard or toggle).
- Parameters:
kind (integer) – one of
wx.ITEM_NORMAL,wx.ITEM_CHECK.
- SetLongHelp(self, help='')¶
Sets the help string to be shown in the statusbar.
- Parameters:
help (string) – the string for the long help.
- SetRect(self, rect)¶
Sets the
ButtonInfoclient rectangle.- Parameters:
rect – an instance of
wx.Rect.
- SetShortHelp(self, help='')¶
Sets the help string to be shown in a tooltip.
- Parameters:
help (string) – the string for the short help.
- SetStatus(self, status)¶
Sets the
ButtonInfostatus.- Parameters:
status (string) – one of “Pressed”, “Hover”, “Normal”, “Toggled”, “Disabled”.
- SetText(self, text='')¶
Sets the button label text.
- Parameters:
text (string) – the button label string.
- SetTextAlignment(self, alignment)¶
Sets the text alignment in the button (bottom or right).
- Parameters:
alignment (integer) – the text alignment in this
ButtonInfoinstance.
- SetToggled(self, toggle=True)¶
Sets a
wx.ITEM_CHECKbutton toggled/not toggled.- Parameters:
toggle (bool) –
Trueto toggle the button,Falseotherwise.
Properties¶
- Bitmap¶
Returns the bitmap associated with this instance of
ButtonInfo.- Parameters:
status (string) – the
ButtonInfostatus (“Pressed”, “Hover”, “Normal”, “Toggled”, “Disabled”).- Returns:
An instance of
wx.Bitmap.
- Id¶
Returns the
ButtonInfoid.- Returns:
An integer representing the button id.
- Rect¶
Returns the
ButtonInfoclient rectangle.- Returns:
An instance of
wx.Rect.
- Status¶
Returns the
ButtonInfostatus.- Returns:
A string containing the
ButtonInfostatus (one of “Pressed”, “Hover”, “Normal”, “Toggled”, “Disabled”).