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
|
.. 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.pyprogress
.. highlight:: python
.. _wx.lib.agw.pyprogress.PyProgress:
==========================================================================================================================================
|phoenix_title| **wx.lib.agw.pyprogress.PyProgress**
==========================================================================================================================================
:class:`PyProgress` is similar to :class:`ProgressDialog` in indeterminated mode, but with a
different gauge appearance and a different spinning behavior. The moving gauge
can be drawn with a single solid colour or with a shading gradient foreground.
The gauge background colour is user customizable.
The bar does not move always from the beginning to the end as in :class:`ProgressDialog`
in indeterminated mode, but spins cyclically forward and backward.
|
|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>PyProgress</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.pyprogress.PyProgress_inheritance.png" alt="Inheritance diagram of PyProgress" 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.Trackable.html" title="wx.Trackable" alt="" coords="13,5,115,35"/> <area shape="rect" id="node2" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="65,83,176,112"/> <area shape="rect" id="node4" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="61,160,181,189"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="139,5,220,35"/> <area shape="rect" id="node7" href="wx.Window.html" title="wx.Window" alt="" coords="77,237,165,267"/> <area shape="rect" id="node5" href="wx.lib.agw.pyprogress.PyProgress.html" title="wx.lib.agw.pyprogress.PyProgress" alt="" coords="4,547,237,576"/> <area shape="rect" id="node6" href="wx.Dialog.html" title="wx.Dialog" alt="" coords="80,469,161,499"/> <area shape="rect" id="node9" href="wx.NonOwnedWindow.html" title="wx.NonOwnedWindow" alt="" coords="42,315,200,344"/> <area shape="rect" id="node8" href="wx.TopLevelWindow.html" title="wx.TopLevelWindow" alt="" coords="50,392,192,421"/> </map>
</p>
|
|appearance| Control Appearance
===============================
|
.. figure:: _static/images/widgets/fullsize/wxmsw/wx.lib.agw.pyprogress.pyprogress.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.pyprogress.pyprogress.png
:alt: wxGTK
:figclass: floatcenter
**wxGTK**
|
|super_classes| Known Superclasses
==================================
:class:`wx.Dialog`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.agw.pyprogress.PyProgress.__init__` Default class constructor.
:meth:`~wx.lib.agw.pyprogress.PyProgress.CreateLabel` Creates the :class:`StaticText` that holds the elapsed time label.
:meth:`~wx.lib.agw.pyprogress.PyProgress.DisableAbort` Disables the ``Cancel`` button.
:meth:`~wx.lib.agw.pyprogress.PyProgress.EnableAbort` Enables or disables the ``Cancel`` button.
:meth:`~wx.lib.agw.pyprogress.PyProgress.EnableClose` Enables or disables the ``Close`` button.
:meth:`~wx.lib.agw.pyprogress.PyProgress.GetAGWWindowStyleFlag` Returns the :class:`PyProgress` style.
:meth:`~wx.lib.agw.pyprogress.PyProgress.GetFirstGradientColour` Returns the gauge first gradient colour.
:meth:`~wx.lib.agw.pyprogress.PyProgress.GetGaugeBackground` Returns the gauge background colour.
:meth:`~wx.lib.agw.pyprogress.PyProgress.GetGaugeProportion` Returns the relative proportion between the sliding bar and the
:meth:`~wx.lib.agw.pyprogress.PyProgress.GetGaugeSteps` Returns the number of steps the gauge performs before switching from
:meth:`~wx.lib.agw.pyprogress.PyProgress.GetSecondGradientColour` Returns the gauge second gradient colour.
:meth:`~wx.lib.agw.pyprogress.PyProgress.OnCancel` Handles the ``wx.EVT_BUTTON`` event for the dialog.
:meth:`~wx.lib.agw.pyprogress.PyProgress.OnClose` Handles the ``wx.EVT_CLOSE`` event for :class:`PyProgress`.
:meth:`~wx.lib.agw.pyprogress.PyProgress.OnDestroy` Handles the ``wx.EVT_WINDOW_DESTROY`` event for :class:`PyProgress`.
:meth:`~wx.lib.agw.pyprogress.PyProgress.ReenableOtherWindows` Re-enables the other windows if using :class:`wx.WindowDisabler`.
:meth:`~wx.lib.agw.pyprogress.PyProgress.SetFirstGradientColour` Sets the gauge first gradient colour.
:meth:`~wx.lib.agw.pyprogress.PyProgress.SetGaugeBackground` Sets the gauge background colour.
:meth:`~wx.lib.agw.pyprogress.PyProgress.SetGaugeProportion` Sets the relative proportion between the sliding bar and the
:meth:`~wx.lib.agw.pyprogress.PyProgress.SetGaugeSteps` Sets the number of steps the gauge performs before switching from
:meth:`~wx.lib.agw.pyprogress.PyProgress.SetSecondGradientColour` Sets the gauge second gradient colour.
:meth:`~wx.lib.agw.pyprogress.PyProgress.SetTimeLabel` Sets the elapsed time label.
:meth:`~wx.lib.agw.pyprogress.PyProgress.ShowDialog` Show the dialog.
:meth:`~wx.lib.agw.pyprogress.PyProgress.UpdatePulse` Updates the dialog, setting the progress bar to the new value and, if given
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: PyProgress(wx.Dialog)
:class:`PyProgress` is similar to :class:`ProgressDialog` in indeterminated mode, but with a
different gauge appearance and a different spinning behavior. The moving gauge
can be drawn with a single solid colour or with a shading gradient foreground.
The gauge background colour is user customizable.
The bar does not move always from the beginning to the end as in :class:`ProgressDialog`
in indeterminated mode, but spins cyclically forward and backward.
.. method:: __init__(self, parent=None, id=-1, title="", message="", agwStyle=wx.PD_APP_MODAL|wx.PD_AUTO_HIDE)
Default class constructor.
:param `parent`: parent window;
:param `id`: window identifier. A value of -1 indicates a default value;
:param `title`: dialog title to show in titlebar;
:param `message`: message displayed above the progress bar;
:param `style`: the dialog style. This can be a combination of the following bits:
=================== =========== ==================================================
Window Styles Hex Value Description
=================== =========== ==================================================
``PD_CAN_ABORT`` 0x1 This flag tells the dialog that it should have a ``Cancel`` button which the user may press. If this happens, the next call to `UpdatePulse` will return ``False``.
``PD_APP_MODAL`` 0x2 Make the progress dialog modal. If this flag is not given, it is only 'locally' modal - that is the input to the parent window is disabled, but not to the other ones.
``PD_AUTO_HIDE`` 0x4 Causes the progress dialog to disappear from screen as soon as the maximum value of the progress meter has been reached.
``PD_ELAPSED_TIME`` 0x8 This flag tells the dialog that it should show elapsed time (since creating the dialog).
=================== =========== ==================================================
.. method:: CreateLabel(self, text, sizer)
Creates the :class:`StaticText` that holds the elapsed time label.
:param `text`: the dialog message to be displayed above the gauge;
:param `sizer`: the main :class:`BoxSizer` for :class:`PyProgress`.
.. method:: DisableAbort(self)
Disables the ``Cancel`` button.
.. method:: EnableAbort(self, enable=True)
Enables or disables the ``Cancel`` button.
:param `enable`: ``True`` to enable the ``Cancel`` button, ``False`` to disable it.
.. method:: EnableClose(self, enable=True)
Enables or disables the ``Close`` button.
:param `enable`: ``True`` to enable the ``Close`` button, ``False`` to disable it.
.. method:: GetAGWWindowStyleFlag(self)
Returns the :class:`PyProgress` style.
:see: The :meth:`~PyProgress.__init__` method for a list of possible style flags.
.. method:: GetFirstGradientColour(self)
Returns the gauge first gradient colour.
.. method:: GetGaugeBackground(self)
Returns the gauge background colour.
.. method:: GetGaugeProportion(self)
Returns the relative proportion between the sliding bar and the
whole gauge.
.. method:: GetGaugeSteps(self)
Returns the number of steps the gauge performs before switching from
forward to backward (or vice-versa) movement.
.. method:: GetSecondGradientColour(self)
Returns the gauge second gradient colour.
.. method:: OnCancel(self, event)
Handles the ``wx.EVT_BUTTON`` event for the dialog.
:param `event`: a :class:`CommandEvent` event to be processed.
:note: This method handles the ``Cancel`` button press.
.. method:: OnClose(self, event)
Handles the ``wx.EVT_CLOSE`` event for :class:`PyProgress`.
:param `event`: a :class:`CloseEvent` event to be processed.
.. method:: OnDestroy(self, event)
Handles the ``wx.EVT_WINDOW_DESTROY`` event for :class:`PyProgress`.
:param `event`: a :class:`wx.WindowDestroyEvent` event to be processed.
.. method:: ReenableOtherWindows(self)
Re-enables the other windows if using :class:`wx.WindowDisabler`.
.. method:: SetFirstGradientColour(self, colour)
Sets the gauge first gradient colour.
:param `colour`: a valid :class:`wx.Colour` object.
.. method:: SetGaugeBackground(self, colour)
Sets the gauge background colour.
:param `colour`: a valid :class:`wx.Colour` object.
.. method:: SetGaugeProportion(self, proportion)
Sets the relative proportion between the sliding bar and the
whole gauge.
:param `proportion`: a floating point number representing the relative
proportion between the sliding bar and the whole gauge.
.. method:: SetGaugeSteps(self, steps)
Sets the number of steps the gauge performs before switching from
forward to backward (or vice-versa) movement.
:param `steps`: the number of steps the gauge performs before switching from
forward to backward (or vice-versa) movement.
.. method:: SetSecondGradientColour(self, colour)
Sets the gauge second gradient colour.
:param `colour`: a valid :class:`wx.Colour` object.
.. method:: SetTimeLabel(self, val, label=None)
Sets the elapsed time label.
:param `val`: the elapsed time since the dialog was shown, in seconds;
:param `label`: the new message to display in the elapsed time text.
.. method:: ShowDialog(self, show=True)
Show the dialog.
:param `show`: ``True`` to show the dialog and re-enable all the other windows,
``False`` otherwise.
.. method:: UpdatePulse(self, newmsg="")
Updates the dialog, setting the progress bar to the new value and, if given
changes the message above it. Returns ``True`` unless the ``Cancel`` button
has been pressed.
If ``False`` is returned, the application can either immediately destroy the
dialog or ask the user for the confirmation.
:param `newmsg`: The new messages for the progress dialog text, if it is
empty (which is the default) the message is not changed.
|