Home | Trees | Index | Help |
|
---|
Package wx :: Package lib :: Module platebtn :: Class PlateButton |
|
object
--+ |Object
--+ |EvtHandler
--+ |Window
--+ |Control
--+ |PyControl
--+ | PlateButton
PlateButton is a custom type of flat button with support for displaying bitmaps and having an attached dropdown menu.
Method Summary | |
---|---|
Create a PlateButton @keyword label: Buttons label text @keyword bmp: Buttons bitmap @keyword style: Button style | |
Can this window have the focus? | |
Disable the control | |
Calculate the best size of the button @return: wx.Size | |
Enable/Disable the control | |
Get the brush for drawing the background of the button @return: wx.Brush @note: used internally when on gtk | |
Get the bitmap of the disable state @return: wx.Bitmap or None | |
Get the label bitmap @return: wx.Bitmap or None | |
Get the label bitmap @return: wx.Bitmap or None | |
Get the label bitmap @return: wx.Bitmap or None | |
String |
Generic way of getting a label from any window, for identification purposes. |
Return the menu associated with this button or None if no menu is associated with it. | |
Override setting of background fill | |
Trap the erase event to keep the background transparent on windows. | |
Set the visual focus state if need be | |
Execute a single button press action when the Return key is pressed and this control has the focus. | |
Set the visual state back to normal when focus is lost unless the control is currently in a pressed state. | |
Sets the pressed state and depending on the click position will show the popup menu if one has been set. | |
Post a button event if the control was previously in a pressed state. | |
Refresh the control to a proper state after the menu has been dismissed. | |
Set the bitmap displayed in the button @param bmp: wx.Bitmap | |
Set the bitmap for the disabled state @param bmp: wx.Bitmap | |
Set the bitmap displayed in the button @param bmp: wx.Bitmap | |
Set the bitmap displayed in the button @param bmp: wx.Bitmap | |
Set the bitmap displayed in the button @param bmp: wx.Bitmap | |
Set the bitmap displayed in the button @param bmp: wx.Bitmap | |
Set this control to have the focus | |
Adjust size of control when font changes | |
Set the label of the button @param label: lable string | |
Set the color of the label. | |
Set the menu that can be shown when clicking on the drop arrow of the button. | |
Set the color used for highlighting the pressed state @param color: wx.Color @note: also resets all text colours as necessary | |
Manually set the state of the button @param state: one of the PLATE_* values @note: the state may be altered by mouse actions | |
Sets the window style bytes, the updates take place immediately no need to call refresh afterwards. | |
Set the variant/font size of this control | |
Overridden base class virtual. | |
Show the dropdown menu if one is associated with this control | |
Toggle button state |
Property Summary | |
---|---|
BitmapDisabled : Property for accessing the bitmap for the disabled state | |
BitmapFocus : Property for accessing the default bitmap | |
BitmapHover : Property for accessing the default bitmap | |
BitmapLabel : Property for accessing the default bitmap | |
BitmapSelected : Property for accessing the default bitmap | |
LabelText : Property for getting the label of the button |
Instance Method Details |
---|
__init__(self,
parent,
id_=-1,
label='',
bmp=None,
pos=wx.Point(-1, -1),
size=wx.Size(-1, -1),
style=1,
name=u'button')
|
AcceptsFocus(self)Can this window have the focus?
|
Disable(self)Disable the control
|
DoGetBestSize(self)Calculate the best size of the button @return: wx.Size
|
Enable(self, enable=True)Enable/Disable the control
|
GetBackgroundBrush(self, dc)Get the brush for drawing the background of the button @return: wx.Brush @note: used internally when on gtk |
GetBitmapDisabled(self)Get the bitmap of the disable state @return: wx.Bitmap or None |
GetBitmapFocus(self)Get the label bitmap @return: wx.Bitmap or None |
GetBitmapHover(self)Get the label bitmap @return: wx.Bitmap or None |
GetBitmapLabel(self)Get the label bitmap @return: wx.Bitmap or None |
GetLabelText(self)Generic way of getting a label from any window, for identification purposes. The interpretation of this function differs from class to class. For frames and dialogs, the value returned is the title. For buttons or static text controls, it is the button text. This function can be useful for meta-programs such as testing tools or special-needs access programs)which need to identify windows by name.
|
GetMenu(self)Return the menu associated with this button or None if no menu is associated with it. |
HasTransparentBackground(self)Override setting of background fill
|
OnErase(self, evt)Trap the erase event to keep the background transparent on windows. @param evt: wx.EVT_ERASE_BACKGROUND |
OnFocus(self, evt)Set the visual focus state if need be |
OnKeyUp(self, evt)Execute a single button press action when the Return key is pressed and this control has the focus. @param evt: wx.EVT_KEY_UP |
OnKillFocus(self, evt)Set the visual state back to normal when focus is lost unless the control is currently in a pressed state. |
OnLeftDown(self, evt)Sets the pressed state and depending on the click position will show the popup menu if one has been set. |
OnLeftUp(self, evt)Post a button event if the control was previously in a pressed state. @param evt: wx.MouseEvent |
OnMenuClose(self, evt)Refresh the control to a proper state after the menu has been dismissed. @param evt: wx.EVT_MENU_CLOSE |
SetBitmap(self, bmp)Set the bitmap displayed in the button @param bmp: wx.Bitmap |
SetBitmapDisabled(self, bmp)Set the bitmap for the disabled state @param bmp: wx.Bitmap |
SetBitmapFocus(self, bmp)Set the bitmap displayed in the button @param bmp: wx.Bitmap |
SetBitmapHover(self, bmp)Set the bitmap displayed in the button @param bmp: wx.Bitmap |
SetBitmapLabel(self, bmp)Set the bitmap displayed in the button @param bmp: wx.Bitmap |
SetBitmapSelected(self, bmp)Set the bitmap displayed in the button @param bmp: wx.Bitmap |
SetFocus(self)Set this control to have the focus
|
SetFont(self, font)Adjust size of control when font changes
|
SetLabel(self, label)Set the label of the button @param label: lable string
|
SetLabelColor(self, normal, hlight=wx.Colour(-1, -1, -1, 255))Set the color of the label. The optimal label color is usually automatically selected depending on the button color. In some cases the colors that are choosen may not be optimal. The normal state must be specified, if the other two params are left Null they will be automatically guessed based on the normal color. To prevent this automatic color choices from happening either specify a color or None for the other params. @param normal: Label color for normal state @keyword hlight: Color for when mouse is hovering over |
SetMenu(self, menu)Set the menu that can be shown when clicking on the drop arrow of the button. @param menu: wxMenu to use as a PopupMenu @note: Arrow is not drawn unless a menu is set |
SetPressColor(self, color)Set the color used for highlighting the pressed state @param color: wx.Color @note: also resets all text colours as necessary |
SetState(self, state)Manually set the state of the button @param state: one of the PLATE_* values @note: the state may be altered by mouse actions |
SetWindowStyle(self, style)Sets the window style bytes, the updates take place immediately no need to call refresh afterwards. @param style: bitmask of PB_STYLE_* values
|
SetWindowVariant(self, variant)Set the variant/font size of this control
|
ShouldInheritColours(self)Overridden base class virtual. If the parent has non-default colours then we want this control to inherit them.
|
ShowMenu(self)Show the dropdown menu if one is associated with this control |
ToggleState(self)Toggle button state |
Property Details |
---|
BitmapDisabledProperty for accessing the bitmap for the disabled state |
BitmapFocusProperty for accessing the default bitmap |
BitmapHoverProperty for accessing the default bitmap |
BitmapLabelProperty for accessing the default bitmap |
BitmapSelectedProperty for accessing the default bitmap |
LabelTextProperty for getting the label of the button |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:54:05 2009 | http://epydoc.sf.net |