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
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. currentmodule:: wx.lib.agw.foldpanelbar
.. highlight:: python
.. _wx.lib.agw.foldpanelbar.CaptionBar:
==========================================================================================================================================
|phoenix_title| **wx.lib.agw.foldpanelbar.CaptionBar**
==========================================================================================================================================
This class is a graphical caption component that consists of a
caption and a clickable arrow.
The :class:`CaptionBar` fires an event ``EVT_CAPTIONBAR`` which is a
:class:`CaptionBarEvent`. This event can be caught and the parent window
can act upon the collapsed or expanded state of the bar (which is
actually just the icon which changed). The parent panel can
reduce size or expand again.
|
|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>CaptionBar</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.foldpanelbar.CaptionBar_inheritance.png" alt="Inheritance diagram of CaptionBar" usemap="#dummy" class="inheritance"/></center>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
<map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.agw.foldpanelbar.CaptionBar.html" title="wx.lib.agw.foldpanelbar.CaptionBar" alt="" coords="5,315,257,344"/> <area shape="rect" id="node2" href="wx.Window.html" title="wx.Window" alt="" coords="83,237,180,267"/> <area shape="rect" id="node3" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="67,160,196,189"/> <area shape="rect" id="node4" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="73,83,190,112"/> <area shape="rect" id="node5" href="wx.Object.html" title="wx.Object" alt="" coords="28,5,115,35"/> <area shape="rect" id="node6" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="139,5,246,35"/> </map>
</p>
</div>
|
|super_classes| Known Superclasses
==================================
:class:`wx.Window`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.__init__` Default class constructor.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.ApplyCaptionStyle` Applies the style defined in `cbstyle` to the :class:`CaptionBar`.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.Collapse` This sets the internal state/representation to collapsed.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.DoGetBestSize` Returns the best size for this panel, based upon the font
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.DrawHorizontalGradient` Gradient fill from colour 1 to colour 2 from left to right.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.DrawSingleColour` Single colour fill for :class:`CaptionBar`.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.DrawSingleRectangle` Single rectangle for :class:`CaptionBar`.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.DrawVerticalGradient` Gradient fill from colour 1 to colour 2 from top to bottom.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.Expand` This sets the internal state/representation to expanded.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.FillCaptionBackground` Fills the background of the caption with either a gradient or
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.GetCaptionStyle` Returns the current style of the captionbar in a :class:`CaptionBarStyle` class.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.IsCollapsed` Returns whether the status of the bar is expanded or collapsed.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.IsVertical` Returns whether the :class:`CaptionBar` has a default orientation or not.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.OnChar` Handles the ``wx.EVT_CHAR`` event for :class:`CaptionBar`.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.OnMouseEvent` Handles the ``wx.EVT_MOUSE_EVENTS`` event for :class:`CaptionBar`.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.OnPaint` Handles the ``wx.EVT_PAINT`` event for :class:`CaptionBar`.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.OnSize` Handles the ``wx.EVT_SIZE`` event for :class:`CaptionBar`.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.RedrawIconBitmap` Redraws the icons (if they exists).
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.SetBoldFont` Sets the :class:`CaptionBar` font weight to bold.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.SetCaptionStyle` Sets :class:`CaptionBar` styles with :class:`CaptionBarStyle` class.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.SetNormalFont` Sets the :class:`CaptionBar` font weight to normal.
:meth:`~wx.lib.agw.foldpanelbar.CaptionBar.SetRightIndent` Sets the amount of pixels on the right from which the bitmap
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: CaptionBar(wx.Window)
This class is a graphical caption component that consists of a
caption and a clickable arrow.
The :class:`CaptionBar` fires an event ``EVT_CAPTIONBAR`` which is a
:class:`CaptionBarEvent`. This event can be caught and the parent window
can act upon the collapsed or expanded state of the bar (which is
actually just the icon which changed). The parent panel can
reduce size or expand again.
.. method:: __init__(self, parent, id, pos, size, caption="", foldIcons=None, cbstyle=None, rightIndent=FPB_BMP_RIGHTSPACE, iconWidth=16, iconHeight=16, collapsed=False)
Default class constructor.
:param `parent`: the :class:`CaptionBar` parent window;
:param `id`: an identifier for the control: a value of -1 is taken to mean a default;
: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 `caption`: the string to be displayed in :class:`CaptionBar`;
:param `foldIcons`: an instance of :class:`wx.ImageList` containing the icons to display
next to the caption text;
:param `cbstyle`: the :class:`CaptionBar` window style. Must be an instance of
:class:`CaptionBarStyle`;
:param `rightIndent`: number of pixels of the bmp to be aligned from the right filled
with space;
:param `iconWidth`: the :class:`CaptionBar` icon width;
:param `iconHeight`: the :class:`CaptionBar` icon height;
:param `collapsed`: ``True`` if the :class:`CaptionBar` should start in the collapsed state,
``False`` otherwise.
.. method:: ApplyCaptionStyle(self, cbstyle=None, applyDefault=True)
Applies the style defined in `cbstyle` to the :class:`CaptionBar`.
:param `cbstyle`: an instance of :class:`CaptionBarStyle`;
:param `applyDefault`: if ``True``, the colours used in the :class:`CaptionBarStyle`
will be reset to their default values.
.. method:: Collapse(self)
This sets the internal state/representation to collapsed.
:note: This does not trigger a :class:`CaptionBarEvent` to be sent to the
parent.
.. method:: DoGetBestSize(self)
Returns the best size for this panel, based upon the font
assigned to this window, and the caption string.
:note: Overridden from :class:`wx.Window`.
.. method:: DrawHorizontalGradient(self, dc, rect)
Gradient fill from colour 1 to colour 2 from left to right.
:param `dc`: an instance of :class:`wx.DC`;
:param `rect`: the :class:`CaptionBar` client rectangle.
.. method:: DrawSingleColour(self, dc, rect)
Single colour fill for :class:`CaptionBar`.
:param `dc`: an instance of :class:`wx.DC`;
:param `rect`: the :class:`CaptionBar` client rectangle.
.. method:: DrawSingleRectangle(self, dc, rect)
Single rectangle for :class:`CaptionBar`.
:param `dc`: an instance of :class:`wx.DC`;
:param `rect`: the :class:`CaptionBar` client rectangle.
.. method:: DrawVerticalGradient(self, dc, rect)
Gradient fill from colour 1 to colour 2 from top to bottom.
:param `dc`: an instance of :class:`wx.DC`;
:param `rect`: the :class:`CaptionBar` client rectangle.
.. method:: Expand(self)
This sets the internal state/representation to expanded.
:note: This does not trigger a :class:`CaptionBarEvent` to be sent to the
parent.
.. method:: FillCaptionBackground(self, dc)
Fills the background of the caption with either a gradient or
a solid colour.
:param `dc`: an instance of :class:`wx.DC`.
.. method:: GetCaptionStyle(self)
Returns the current style of the captionbar in a :class:`CaptionBarStyle` class.
:note: This can be used to change and set back the changes.
.. method:: IsCollapsed(self)
Returns whether the status of the bar is expanded or collapsed.
.. method:: IsVertical(self)
Returns whether the :class:`CaptionBar` has a default orientation or not.
Default is vertical.
.. method:: OnChar(self, event)
Handles the ``wx.EVT_CHAR`` event for :class:`CaptionBar`.
:param `event`: a :class:`KeyEvent` event to be processed.
:note: This method currently does nothing.
.. method:: OnMouseEvent(self, event)
Handles the ``wx.EVT_MOUSE_EVENTS`` event for :class:`CaptionBar`.
:param `event`: a :class:`MouseEvent` event to be processed.
:note: This method catches the mouse click-double click. If clicked on
the arrow (single) or double on the caption we change state and an event
must be fired to let this panel collapse or expand.
.. method:: OnPaint(self, event)
Handles the ``wx.EVT_PAINT`` event for :class:`CaptionBar`.
:param `event`: a :class:`PaintEvent` event to be processed.
.. method:: OnSize(self, event)
Handles the ``wx.EVT_SIZE`` event for :class:`CaptionBar`.
:param `event`: a :class:`wx.SizeEvent` event to be processed.
.. method:: RedrawIconBitmap(self)
Redraws the icons (if they exists).
.. method:: SetBoldFont(self)
Sets the :class:`CaptionBar` font weight to bold.
.. method:: SetCaptionStyle(self, cbstyle=None, applyDefault=True)
Sets :class:`CaptionBar` styles with :class:`CaptionBarStyle` class.
:param `cbstyle`: an instance of :class:`CaptionBarStyle`;
:param `applyDefault`: if ``True``, the colours used in the :class:`CaptionBarStyle`
will be reset to their default values.
:note: All styles that are actually set, are applied. If you set `applyDefault`
to ``True``, all other (not defined) styles will be set to default. If it is
``False``, the styles which are not set in the :class:`CaptionBarStyle` will be ignored.
.. method:: SetNormalFont(self)
Sets the :class:`CaptionBar` font weight to normal.
.. method:: SetRightIndent(self, pixels)
Sets the amount of pixels on the right from which the bitmap
is trailing.
:param `pixels`: the number of pixels on the right from which the bitmap
is trailing. If this is 0, it will be drawn all the way to the right,
default is equal to ``FPB_BMP_RIGHTSPACE``. Assign this before
assigning an image list to prevent a redraw.
|