.. include:: headings.inc .. module:: lib.agw.pyprogress .. currentmodule:: lib.agw.pyprogress .. highlight:: python .. _lib.agw.pyprogress: ========================================================================================================================================== |phoenix_title| **pyprogress** ========================================================================================================================================== :class:`PyProgress` is similar to :class:`ProgressDialog` in indeterminated mode, but with a different gauge appearance and a different spinning behavior. Description =========== :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. Other options include: - Possibility to change the proportion between the spinning bar and the entire gauge, so that the bar can be longer or shorter (the default is 20%); - Modifying the number of steps the spinning bar performs before a forward (or backward) loop reverses. :class:`PyProgress` can optionally display a ``Cancel`` button, and a :class:`StaticText` which outputs the elapsed time from the starting of the process. Usage ===== Usage example:: import wx import wx.lib.agw.pyprogress as PP # Our normal wxApp-derived class, as usual app = wx.App(0) dlg = PP.PyProgress(None, -1, "PyProgress Example", "An Informative Message", agwStyle=wx.PD_APP_MODAL|wx.PD_ELAPSED_TIME) dlg.SetGaugeProportion(0.2) dlg.SetGaugeSteps(50) dlg.SetGaugeBackground(wx.WHITE) dlg.SetFirstGradientColour(wx.WHITE) dlg.SetSecondGradientColour(wx.BLUE) max = 400 keepGoing = ``True`` count = 0 while keepGoing and count < max: count += 1 wx.MilliSleep(30) if count >= max / 2: keepGoing = dlg.UpdatePulse("Half-time!") else: keepGoing = dlg.UpdatePulse() dlg.Destroy() app.MainLoop() Supported Platforms =================== :class:`PyProgress` has been tested on the following platforms: * Windows (Windows XP); * Linux Ubuntu (Dapper 6.06) Window Styles ============= This class supports the following window styles: =================== =========== ================================================== 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 `Update` 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). =================== =========== ================================================== Events Processing ================= `No custom events are available for this class.` License And Version =================== :class:`PyProgress` is distributed under the wxPython license. Latest Revision: Andrea Gavana @ 14 Mar 2012, 21.00 GMT Version 0.4 | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for module **pyprogress** .. raw:: html

Inheritance diagram of pyprogress

| |class_summary| Classes Summary =============================== ================================================================================ ================================================================================ :ref:`lib.agw.pyprogress.ProgressGauge` This class provides a visual alternative for :class:`Gauge`. :ref:`lib.agw.pyprogress.PyProgress` :class:`PyProgress` is similar to :class:`ProgressDialog` in indeterminated mode, but with a ================================================================================ ================================================================================ | .. toctree:: :maxdepth: 1 :hidden: lib.agw.pyprogress.ProgressGauge lib.agw.pyprogress.PyProgress