wx.lib.agw.pycollapsiblepane.PyCollapsiblePane¶
PyCollapsiblePane is a container with an embedded button-like control which
can be used by the user to collapse or expand the pane’s contents.
Class Hierarchy¶
Control Appearance¶
Known Superclasses¶
Methods Summary¶
Default class constructor. |
|
Collapses or expands the pane window. |
|
Gets the size which best suits the window: for a control, it would be the |
|
Same as |
|
Returns the |
|
Returns the |
|
Returns the button label. |
|
Returns the button associated with |
|
Returns the button font. |
|
Returns the expander dimensions, a tuple of integers representing the |
|
Returns the button label. |
|
Returns a reference to the pane window. Use the returned |
|
Returns whether a flag is present in the |
|
Returns |
|
Returns |
|
Layout the |
|
Handles the |
|
Overridable method to draw the GTK-style expander. |
|
Handles the |
|
Overridable method to draw the |
|
Handles the |
|
Handles the status changes (collapsing/expanding). |
|
Sets the |
|
Assign a new button to |
|
Sets the button font. |
|
Sets the expander width and height. |
|
Sets the button label. |
Class API¶
- class PyCollapsiblePane(wx.Panel)¶
PyCollapsiblePaneis a container with an embedded button-like control which can be used by the user to collapse or expand the pane’s contents.
Methods¶
- __init__(self, parent, id=wx.ID_ANY, label='', pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, agwStyle=wx.CP_DEFAULT_STYLE, validator=wx.DefaultValidator, name='PyCollapsiblePane')¶
Default class constructor.
- Parameters:
parent – the
PyCollapsiblePaneparent. Must not beNone;id – window identifier. A value of -1 indicates a default value;
label – The initial label shown in the button which allows the user to expand or collapse the pane window.
pos – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;
size – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform;
style – the underlying
Panelwindow style;agwStyle –
the AGW-specifi window style. This can be a combination of the following bits:
Window Styles
Hex Value
Description
CP_NO_TLW_RESIZE0x2
By default
PyCollapsiblePaneresizes the top level window containing it when its own size changes. This allows to easily implement dialogs containing an optionally shown part, for example, and so is the default behaviour but can be inconvenient in some specific cases – use this flag to disable this automatic parent resizing then.CP_GTK_EXPANDER0x4
Uses a GTK expander instead of a button.
CP_USE_STATICBOX0x8
Uses a
StaticBoxaroundPyCollapsiblePane.CP_LINE_ABOVE0x10
Draws a line above
PyCollapsiblePane.validator – the validator associated to the
PyCollapsiblePane;name – the widget name.
- Collapse(self, collapse=True)¶
Collapses or expands the pane window.
- Parameters:
collapse –
Trueto collapse the pane window,Falseto expand it.
- DoGetBestSize(self)¶
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
Panel.
- GetAGWWindowStyleFlag(self)¶
Returns the
PyCollapsiblePanewindow style.See also
SetAGWWindowStyleFlagfor a list of possible window style flags.
- GetBorder(self)¶
Returns the
PyCollapsiblePaneborder in pixels (platform dependent).
- GetBtnLabel(self)¶
Returns the button label.
- GetButton(self)¶
Returns the button associated with
PyCollapsiblePane.
- GetButtonFont(self)¶
Returns the button font.
- GetExpanderDimensions(self)¶
Returns the expander dimensions, a tuple of integers representing the width and height of the expander, in pixels.
- GetLabel(self)¶
Returns the button label.
Note
Overridden from
Panel.
- GetPane(self)¶
Returns a reference to the pane window. Use the returned
wx.Windowas the parent of widgets to make them part of the collapsible area.
- HasAGWFlag(self, flag)¶
Returns whether a flag is present in the
PyCollapsiblePanestyle.- Parameters:
flag – one of the possible
PyCollapsiblePanewindow styles.
See also
SetAGWWindowStyleFlagfor a list of possible window style flags.
- IsCollapsed(self)¶
Returns
Trueif the pane window is currently hidden.
- IsExpanded(self)¶
Returns
Trueif the pane window is currently shown.
- Layout(self)¶
Layout the
PyCollapsiblePane.
- OnButton(self, event)¶
Handles the
wx.EVT_BUTTONevent forPyCollapsiblePane.- Parameters:
event – a
CommandEventevent to be processed.
- OnDrawGTKExpander(self, dc)¶
Overridable method to draw the GTK-style expander.
- Parameters:
dc – an instance of
wx.DC.
- OnDrawGTKStyle(self, event)¶
Handles the
wx.EVT_PAINTevent forPyCollapsiblePane.- Parameters:
event – a
PaintEventevent to be processed.
Note
This is a drawing routine to paint the GTK-style expander.
- OnDrawGTKText(self, dc)¶
Overridable method to draw the
PyCollapsiblePanetext in the expander.- Parameters:
dc – an instance of
wx.DC.
- OnSize(self, event)¶
Handles the
wx.EVT_SIZEevent forPyCollapsiblePane.- Parameters:
event – a
wx.SizeEventevent to be processed.
- OnStateChange(self, sz)¶
Handles the status changes (collapsing/expanding).
- Parameters:
sz – an instance of
wx.Size.
- SetAGWWindowStyleFlag(self, agwStyle)¶
Sets the
PyCollapsiblePanewindow style flags.- Parameters:
agwStyle –
the AGW-specific window style. This can be a combination of the following bits:
Window Styles
Hex Value
Description
CP_NO_TLW_RESIZE0x2
By default
PyCollapsiblePaneresizes the top level window containing it when its own size changes. This allows to easily implement dialogs containing an optionally shown part, for example, and so is the default behaviour but can be inconvenient in some specific cases – use this flag to disable this automatic parent resizing then.CP_GTK_EXPANDER0x4
Uses a GTK expander instead of a button.
CP_USE_STATICBOX0x8
Uses a
StaticBoxaroundPyCollapsiblePane.CP_LINE_ABOVE0x10
Draws a line above
PyCollapsiblePane.
- SetButton(self, button)¶
Assign a new button to
PyCollapsiblePane.- Parameters:
button – can be the standard
Buttonor any of the generic implementations which live inlib.buttons.
- SetExpanderDimensions(self, width, height)¶
Sets the expander width and height.
- Parameters:
width – an integer specifying the expander width in pixels;
height – an integer specifying the expander height in pixels.
- SetLabel(self, label)¶
Sets the button label.
- Parameters:
label – the new button label.
Note
Overridden from
Panel.