AGW Logo

agw_title PyGauge

This class provides a visual alternative for wx.Gauge. It currently only support determinate mode (see SetValue and SetRange)

hierarchy Inheritance Diagram

Inheritance diagram for: PyGauge

Inheritance diagram of PyGauge


appearance Control Appearance


PyGauge

PyGauge


method_summary Methods Summary

__init__Default class constructor.
DoGetBestSizeGets the size which best suits PyGauge: for a control, it would be
GetBarColorReturns the PyGauge main bar colour.
GetBarColourReturns the PyGauge main bar colour.
GetBarGradientReturns a tuple containing the gradient start and end colours.
GetBorderColorReturns the PyGauge border colour.
GetBorderColourReturns the PyGauge border colour.
GetBorderPaddingGets the border padding.
GetRangeReturns the maximum value of the gauge.
GetValueReturns the current position of the gauge.
OnEraseBackgroundHandles the wx.EVT_ERASE_BACKGROUND event for PyGauge.
OnPaintHandles the wx.EVT_PAINT event for PyGauge.
OnTimerHandles the wx.EVT_TIMER event for PyGauge.
SetBarColorSets the PyGauge main bar colour.
SetBarColourSets the PyGauge main bar colour.
SetBarGradientSets the bar gradient.
SetBorderColorSets the PyGauge border colour.
SetBorderColourSets the PyGauge border colour.
SetBorderPaddingSets the border padding.
SetRangeSets the range of the gauge.
SetValueSets the current position of the gauge.
SortForDisplayInternal method which sorts things so we draw the longest bar first.
UpdateUpdate the gauge by adding value to it over time milliseconds.

API Class API

class PyGauge(wx.PyWindow)[source]

This class provides a visual alternative for wx.Gauge. It currently only support determinate mode (see PyGauge.SetValue() and PyGauge.SetRange())



__init__(parent, id=wx.ID_ANY, range=100, pos=wx.DefaultPosition, size=(-1, 30), style=0)[source]

Default class constructor.

Parameters:
  • parent – parent window. Must not be None;
  • id – window identifier. A value of -1 indicates a default value;
  • pos – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;
  • size – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform;
  • style – the underlying wx.PyWindow window style.


DoGetBestSize()[source]

Gets the size which best suits 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.



GetBarColor()

Returns the PyGauge main bar colour.



GetBarColour()[source]

Returns the PyGauge main bar colour.



GetBarGradient()[source]

Returns a tuple containing the gradient start and end colours.



GetBorderColor()

Returns the PyGauge border colour.



GetBorderColour()[source]

Returns the PyGauge border colour.



GetBorderPadding()[source]

Gets the border padding.



GetRange()[source]

Returns the maximum value of the gauge.



GetValue()[source]

Returns the current position of the gauge.



OnEraseBackground(event)[source]

Handles the wx.EVT_ERASE_BACKGROUND event for PyGauge.

Parameters:event – a wx.EraseEvent event to be processed.

Note

This method is intentionally empty to reduce flicker.



OnPaint(event)[source]

Handles the wx.EVT_PAINT event for PyGauge.

Parameters:event – a wx.PaintEvent event to be processed.


OnTimer(event)[source]

Handles the wx.EVT_TIMER event for PyGauge.

Parameters:event – a wx.TimerEvent event to be processed.


SetBarColor(colour)

Sets the PyGauge main bar colour.

Parameters:colour – an instance of wx.Colour.


SetBarColour(colour)[source]

Sets the PyGauge main bar colour.

Parameters:colour – an instance of wx.Colour.



SetBarGradient(gradient)[source]

Sets the bar gradient.

Parameters:gradient – a tuple containing the gradient start and end colours.

Note

This overrides the bar colour previously set with SetBarColour.



SetBorderColor(colour)

Sets the PyGauge border colour.

Parameters:colour – an instance of wx.Colour.



SetBorderColour(colour)[source]

Sets the PyGauge border colour.

Parameters:colour – an instance of wx.Colour.



SetBorderPadding(padding)[source]

Sets the border padding.

Parameters:padding – pixels between the border and the progress bar.


SetRange(range)[source]

Sets the range of the gauge. The gauge length is its value as a proportion of the range.

Parameters:range – The maximum value of the gauge.


SetValue(value)[source]

Sets the current position of the gauge.

Parameters:value – an integer specifying the current position of the gauge.


SortForDisplay()[source]

Internal method which sorts things so we draw the longest bar first.



Update(value, time=0)[source]

Update the gauge by adding value to it over time milliseconds. The time parameter must be a multiple of 50 milliseconds.

Parameters:
  • value – The value to be added to the gauge;
  • time – The length of time in milliseconds that it will take to move the gauge.
Tree

Table Of Contents

Previous topic

pygauge

Next topic

SVN Revision 68362 For pygauge