File: wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.txt

package info (click to toggle)
wxpython4.0 4.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 211,112 kB
  • sloc: cpp: 888,355; python: 223,130; makefile: 52,087; ansic: 45,780; sh: 3,012; xml: 1,534; perl: 264
file content (348 lines) | stat: -rw-r--r-- 14,966 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. currentmodule:: wx.lib.agw.pycollapsiblepane

.. highlight:: python



.. _wx.lib.agw.pycollapsiblepane.PyCollapsiblePane:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.pycollapsiblepane.PyCollapsiblePane**
==========================================================================================================================================

:class:`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| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>PyCollapsiblePane</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.lib.agw.pycollapsiblepane.PyCollapsiblePane_inheritance.png" alt="Inheritance diagram of PyCollapsiblePane" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.Panel.html" title="wx.Panel" alt="" coords="126,315,201,344"/> <area shape="rect" id="node6" href="wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.html" title="wx.lib.agw.pycollapsiblepane.PyCollapsiblePane" alt="" coords="5,392,323,421"/> <area shape="rect" id="node2" href="wx.Window.html" title="wx.Window" alt="" coords="119,237,208,267"/> <area shape="rect" id="node3" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="56,5,157,35"/> <area shape="rect" id="node4" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="108,83,219,112"/> <area shape="rect" id="node7" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="103,160,224,189"/> <area shape="rect" id="node5" href="wx.Object.html" title="wx.Object" alt="" coords="181,5,263,35"/> </map> 
   </p>

|


|appearance| Control Appearance
===============================

|

.. figure:: _static/images/widgets/fullsize/wxmsw/wx.lib.agw.pycollapsiblepane.pycollapsiblepane.png
   :alt: wxMSW
   :figclass: floatleft

   **wxMSW**


.. figure:: _static/images/widgets/fullsize/wxmac/../no_appearance.png
   :alt: wxMAC
   :figclass: floatright

   **wxMAC**


.. figure:: _static/images/widgets/fullsize/wxgtk/wx.lib.agw.pycollapsiblepane.pycollapsiblepane.png
   :alt: wxGTK
   :figclass: floatcenter

   **wxGTK**


|




|super_classes| Known Superclasses
==================================

:class:`wx.Panel`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.__init__`                 Default class constructor.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.Collapse`                 Collapses or expands the pane window.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.DoGetBestSize`            Gets the size which best suits the window: for a control, it would be the
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.Expand`                   Same as :meth:`~PyCollapsiblePane.Collapse` (False).
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.GetAGWWindowStyleFlag`    Returns the :class:`PyCollapsiblePane` window style.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.GetBorder`                Returns the :class:`PyCollapsiblePane` border in pixels (platform dependent).
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.GetBtnLabel`              Returns the button label.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.GetButton`                Returns the button associated with :class:`PyCollapsiblePane`.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.GetButtonFont`            Returns the button font.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.GetExpanderDimensions`    Returns the expander dimensions, a tuple of integers representing the
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.GetLabel`                 Returns the button label.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.GetPane`                  Returns a reference to the pane window. Use the returned :class:`wx.Window` as
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.HasAGWFlag`               Returns whether a flag is present in the :class:`PyCollapsiblePane` style.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.IsCollapsed`              Returns ``True`` if the pane window is currently hidden.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.IsExpanded`               Returns ``True`` if the pane window is currently shown.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.Layout`                   Layout the :class:`PyCollapsiblePane`.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.OnButton`                 Handles the ``wx.EVT_BUTTON`` event for :class:`PyCollapsiblePane`.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.OnDrawGTKExpander`        Overridable method to draw the GTK-style expander.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.OnDrawGTKStyle`           Handles the ``wx.EVT_PAINT`` event for :class:`PyCollapsiblePane`.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.OnDrawGTKText`            Overridable method to draw the :class:`PyCollapsiblePane` text in the expander.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.OnSize`                   Handles the ``wx.EVT_SIZE`` event for :class:`PyCollapsiblePane`.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.OnStateChange`            Handles the status changes (collapsing/expanding).
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.SetAGWWindowStyleFlag`    Sets the :class:`PyCollapsiblePane` window style flags.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.SetButton`                Assign a new button to :class:`PyCollapsiblePane`.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.SetButtonFont`            Sets the button font.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.SetExpanderDimensions`    Sets the expander width and height.
:meth:`~wx.lib.agw.pycollapsiblepane.PyCollapsiblePane.SetLabel`                 Sets the button label.
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: PyCollapsiblePane(wx.Panel)

   :class:`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.

   .. method:: __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.
      
      :param `parent`: the :class:`PyCollapsiblePane` parent. Must not be ``None``;
      :param `id`: window identifier. A value of -1 indicates a default value;
      :param `label`: The initial label shown in the button which allows the
       user to expand or collapse the pane window.
      :param `pos`: the control position. A value of (-1, -1) indicates a default position,
       chosen by either the windowing system or wxPython, depending on platform;
      :param `size`: the control size. A value of (-1, -1) indicates a default size,
       chosen by either the windowing system or wxPython, depending on platform;
      :param `style`: the underlying :class:`Panel` window style;
      :param `agwStyle`: the AGW-specifi window style. This can be a combination of the
       following bits:
      
       ==================== =========== ==================================================
       Window Styles        Hex Value   Description
       ==================== =========== ==================================================
       ``CP_NO_TLW_RESIZE``         0x2 By default :class:`PyCollapsiblePane` resizes 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_EXPANDER``          0x4 Uses a GTK expander instead of a button.
       ``CP_USE_STATICBOX``         0x8 Uses a :class:`StaticBox` around :class:`PyCollapsiblePane`.
       ``CP_LINE_ABOVE``           0x10 Draws a line above :class:`PyCollapsiblePane`.
       ==================== =========== ==================================================
      
      :param `validator`: the validator associated to the :class:`PyCollapsiblePane`;
      :param `name`: the widget name.


   .. method:: Collapse(self, collapse=True)

      Collapses or expands the pane window.
      
      :param `collapse`: ``True`` to collapse the pane window, ``False`` to expand it.


   .. method:: 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 :class:`Panel`.


   .. method:: Expand(self)

      Same as :meth:`~PyCollapsiblePane.Collapse` (False). 


   .. method:: GetAGWWindowStyleFlag(self)

      Returns the :class:`PyCollapsiblePane` window style.
      
      :see: :meth:`~PyCollapsiblePane.SetAGWWindowStyleFlag` for a list of possible window style flags.


   .. method:: GetBorder(self)

      Returns the :class:`PyCollapsiblePane` border in pixels (platform dependent). 


   .. method:: GetBtnLabel(self)

      Returns the button label. 


   .. method:: GetButton(self)

      Returns the button associated with :class:`PyCollapsiblePane`. 


   .. method:: GetButtonFont(self)

      Returns the button font. 


   .. method:: GetExpanderDimensions(self)

      Returns the expander dimensions, a tuple of integers representing the
      width and height of the expander, in pixels.


   .. method:: GetLabel(self)

      Returns the button label.
      
      :note: Overridden from :class:`Panel`.


   .. method:: GetPane(self)

      Returns a reference to the pane window. Use the returned :class:`wx.Window` as
      the parent of widgets to make them part of the collapsible area.


   .. method:: HasAGWFlag(self, flag)

      Returns whether a flag is present in the :class:`PyCollapsiblePane` style.
      
      :param `flag`: one of the possible :class:`PyCollapsiblePane` window styles.
      
      :see: :meth:`~PyCollapsiblePane.SetAGWWindowStyleFlag` for a list of possible window style flags.


   .. method:: IsCollapsed(self)

      Returns ``True`` if the pane window is currently hidden. 


   .. method:: IsExpanded(self)

      Returns ``True`` if the pane window is currently shown. 


   .. method:: Layout(self)

      Layout the :class:`PyCollapsiblePane`. 


   .. method:: OnButton(self, event)

      Handles the ``wx.EVT_BUTTON`` event for :class:`PyCollapsiblePane`.
      
      :param `event`: a :class:`CommandEvent` event to be processed.


   .. method:: OnDrawGTKExpander(self, dc)

      Overridable method to draw the GTK-style expander.
      
      :param `dc`: an instance of :class:`wx.DC`.


   .. method:: OnDrawGTKStyle(self, event)

      Handles the ``wx.EVT_PAINT`` event for :class:`PyCollapsiblePane`.
      
      :param `event`: a :class:`PaintEvent` event to be processed.
      
      :note: This is a drawing routine to paint the GTK-style expander.


   .. method:: OnDrawGTKText(self, dc)

      Overridable method to draw the :class:`PyCollapsiblePane` text in the expander.
      
      :param `dc`: an instance of :class:`wx.DC`.


   .. method:: OnSize(self, event)

      Handles the ``wx.EVT_SIZE`` event for :class:`PyCollapsiblePane`.
      
      :param `event`: a :class:`wx.SizeEvent` event to be processed.


   .. method:: OnStateChange(self, sz)

      Handles the status changes (collapsing/expanding).
      
      :param `sz`: an instance of :class:`wx.Size`.


   .. method:: SetAGWWindowStyleFlag(self, agwStyle)

      Sets the :class:`PyCollapsiblePane` window style flags.
      
      :param `agwStyle`: the AGW-specific window style. This can be a combination of the
       following bits:
      
       ==================== =========== ==================================================
       Window Styles        Hex Value   Description
       ==================== =========== ==================================================
       ``CP_NO_TLW_RESIZE``         0x2 By default :class:`PyCollapsiblePane` resizes 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_EXPANDER``          0x4 Uses a GTK expander instead of a button.
       ``CP_USE_STATICBOX``         0x8 Uses a :class:`StaticBox` around :class:`PyCollapsiblePane`.
       ``CP_LINE_ABOVE``           0x10 Draws a line above :class:`PyCollapsiblePane`.
       ==================== =========== ==================================================


   .. method:: SetButton(self, button)

      Assign a new button to :class:`PyCollapsiblePane`.
      
      :param `button`: can be the standard :class:`Button` or any of the generic
       implementations which live in :mod:`lib.buttons`.


   .. method:: SetButtonFont(self, font)

      Sets the button font.
      
      :param `font`: a valid :class:`wx.Font` object.


   .. method:: SetExpanderDimensions(self, width, height)

      Sets the expander width and height.
      
      :param `width`: an integer specifying the expander width in pixels;
      :param `height`: an integer specifying the expander height in pixels.


   .. method:: SetLabel(self, label)

      Sets the button label.
      
      :param `label`: the new button label.
      
      :note: Overridden from :class:`Panel`.