This file contains the SVN revision history for pygauge, at revision 68881.
Available information include commit date, the name of the committer, the file size, the SVN log messages and a diff from the previous version (if available).
The following log message was entered by the committer:
AGW: General overhaul of the documentation, much improved. All the widgets have their own sample usage in the docs as well;
FlatNotebook: Added the FNB_NAV_BUTTONS_WHEN_NEEDED style, which hides the navigation left/right arrows if all tabs fit;
RibbonBar: - Added the EVT_RIBBONBAR_TAB_LEFT_DCLICK event, which generates a special event
when a ribbon bar tab is double-clicked;
XLSGrid: a new widget was added to AGW, termed XLSGrid. It’s based on wx.grid.Grid and can be used to faithfully reproduce the appearance of a Microsoft Excel spreadsheets.
Version SVN diff:
--- wxPython/3rdParty/AGW/agw/pygauge.py 2011/07/24 21:36:47 68362
+++ wxPython/3rdParty/AGW/agw/pygauge.py 2011/08/25 16:40:17 68881
@@ -2,7 +2,7 @@
# PYGAUGE wxPython IMPLEMENTATION
#
# Mark Reed, @ 28 Jul 2010
-# Latest Revision: 02 Aug 2010, 09.00 GMT
+# Latest Revision: 17 Aug 2011, 15.00 GMT
#
# TODO List
#
@@ -24,33 +24,90 @@
# --------------------------------------------------------------------------------- #
"""
-PyGauge is a generic `wx.Gauge` implementation.
+L{PyGauge} is a generic `wx.Gauge` implementation.
Description
===========
-PyGauge supports the determinate mode functions as `wx.Gauge` and adds an L{Update} function
+L{PyGauge} supports the determinate mode functions as `wx.Gauge` and adds an L{Update} function
which takes a value and a time parameter. The `value` is added to the current value over
a period of `time` milliseconds.
+Usage
+=====
+
+Usage example::
+
+ import wx
+ import wx.lib.agw.pygauge as PG
+
+ class MyFrame(wx.Frame):
+
+ def __init__(self, parent):
+
+ wx.Frame.__init__(self, parent, -1, "PyGauge Demo")
+
+ panel = wx.Panel(self)
+
+ gauge1 = PG.PyGauge(panel, -1, size=(100, 25), style=wx.GA_HORIZONTAL)
+ gauge1.SetValue(80)
+ gauge1.SetBackgroundColour(wx.WHITE)
+ gauge1.SetBorderColor(wx.BLACK)
+
+ gauge2 = PG.PyGauge(panel, -1, size=(100, 25), style=wx.GA_HORIZONTAL)
+ gauge2.SetValue([20, 80])
+ gauge2.SetBarColor([wx.Colour(162, 255, 178), wx.Colour(159, 176, 255)])
+ gauge2.SetBackgroundColour(wx.WHITE)
+ gauge2.SetBorderColor(wx.BLACK)
+ gauge2.SetBorderPadding(2)
+ gauge2.Update([30, 0], 2000)
+
+ gauge3 = PG.PyGauge(panel, -1, size=(100, 25), style=wx.GA_HORIZONTAL)
+ gauge3.SetValue(50)
+ gauge3.SetBarColor(wx.GREEN)
+ gauge3.SetBackgroundColour(wx.WHITE)
+ gauge3.SetBorderColor(wx.BLACK)
+
+ sizer = wx.BoxSizer(wx.VERTICAL)
+ sizer.Add(gauge1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 20)
+ sizer.Add(gauge2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 20)
+ sizer.Add(gauge3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 20)
+
+ panel.SetSizer(sizer)
+ sizer.Layout()
+
+
+ # our normal wxApp-derived class, as usual
+
+ app = wx.PySimpleApp()
+
+ frame = MyFrame(None)
+ app.SetTopWindow(frame)
+ frame.Show()
+
+ app.MainLoop()
+
+
Supported Platforms
===================
-PyGauge has been tested on the following platforms:
+L{PyGauge} has been tested on the following platforms:
* Windows (Windows XP);
License And Version
===================
-PyGauge is distributed under the wxPython license.
-PyGauge has been kindly contributed to the AGW library by Mark Reed.
+L{PyGauge} is distributed under the wxPython license.
+
+L{PyGauge} has been kindly contributed to the AGW library by Mark Reed.
-Latest Revision: Andrea Gavana @ 02 Aug 2010, 09.00 GMT
+Latest Revision: Andrea Gavana @ 17 Aug 2011, 15.00 GMT
Version 0.1
+
"""
import wx
@@ -100,8 +157,11 @@
def DoGetBestSize(self):
"""
- Overridden base class virtual. Determines the best size of the
- button based on the label and bezel size.
+ Gets the size which best suits L{PyGauge}: 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 `wx.PyWindow`.
"""
return wx.Size(self._size[0], self._size[1])