Package wx :: Package lib :: Package agw :: Module speedmeter

[frames | no frames]

## Module wx.lib.agw.speedmeter

Description:

SpeedMeter tries to reproduce the behavior of some car controls (but not only), by creating an "angular" control (actually, circular). I remember to have seen it somewhere, and i decided to implement it in wxPython.

SpeedMeter starts its construction from an empty bitmap, and it uses some functions of the wx.DC class to create the rounded effects. everything is processed in the draw() method of SpeedMeter class.

This implementation allows you to use either directly the wx.PaintDC, or the better (for me) double buffered style with wx.BufferedPaintDC. the double buffered implementation has been adapted from the wxPython wiki example:

http://wiki.wxpython.org/index.cgi/doublebuffereddrawing

Usage:

speedwindow1 = SM.SpeedMeter(parent,
  bufferedstyle, extrastyle, mousestyle )

None of the options (a part of parent class) are strictly required, if you use the defaults you get a very simple SpeedMeter. For the full listing of the input parameters, see the SpeedMeter __init__() method.

Methods and Settings:

SpeedMeter is highly customizable, and in particular you can set:

- The start and end angle of existence for SpeedMeter;
- The intervals in which you divide the SpeedMeter (numerical values);
- The corresponding thicks for the intervals;
- The interval colours (different intervals may have different filling colours);
- The ticks font and colour;
- The background colour (outsize the SpeedMeter region);
- The external arc colour;
- The hand (arrow) colour;
- The hand's shadow colour;
- The hand's style ("arrow" or "hand");
- The partial filler colour;
- The number of secondary (intermediate) ticks;
- The direction of increasing speed ("advance" or "reverse");
- The text to be drawn in the middle and its font;
- The icon to be drawn in the middle;
- The first and second gradient colours (that fills the SpeedMeter control);
- The current value.

For more info on methods and initial styles, please refer to the __init__() method for SpeedMeter or to the specific functions.

SpeedMeter control is freeware and distributed under the wxPython license.

Latest revision: Andrea Gavana @ 15 oct 2008, 10.00 GMT Version 0.1

Classes
`BufferedWindow` | A Buffered window class.
`SpeedMeter` |

Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:55:21 2009 | http://epydoc.sf.net