Package wx :: Package lib :: Package agw :: Module speedmeter :: Class SpeedMeter

[frames | no frames]

## Type SpeedMeter

    object --+
             |
        Object --+
                 |
        EvtHandler --+
                     |
                Window --+
                         |
            BufferedWindow --+
                             |
                            SpeedMeter

Method Summary
| ``__init__`(self, parent, id, pos, size, extrastyle, bufferedstyle, mousestyle)` Default class constructor.
| ``CircleCoords`(self, radius, angle, centerX, centerY)` Used internally.
| ``Draw`(self, dc)` Draws everything on the empty bitmap.
| ``DrawExternalArc`(self, draw)` Specify wheter or not you wish to draw the external (thicker) arc.
| ``GetAngleRange`(self)` Gets the range of existence for SpeedMeter.
| ``GetArcColour`(self)` Gets the external arc colour.
| ``GetDirection`(self)` Gets the direction of advancing SpeedMeter value.
| ``GetFillerColour`(self)` Gets the partial filler colour.
| ``GetFirstGradientColour`(self)` Gets the first gradient colour (near the ticks).
| ``GetHandColour`(self)` Gets the hand (arrow indicator) colour.
| ``GetHandStyle`(self)` Sets the style for the hand (arrow indicator).
| ``GetIntersection`(self, current, intervals)` Used internally.
| ``GetIntervalColours`(self)` Gets the colours for the intervals.
| ``GetIntervals`(self)` Gets the intervals for SpeedMeter.
| ``GetMiddleIcon`(self)` Gets the icon to be drawn near the center of SpeedMeter.
| ``GetMiddleIconDimens`(self)` Used internally.
| ``GetMiddleText`(self)` Gets the text to be drawn near the center of SpeedMeter.
| ``GetMiddleTextColour`(self)` Gets the colour for the text in the middle.
| ``GetMiddleTextFont`(self)` Gets the font for the text in the middle.
| ``GetNumberOfSecondaryTicks`(self)` Gets the number of secondary (intermediate) ticks.
| ``GetSecondGradientColour`(self)` Gets the first gradient colour (near the center).
| ``GetShadowColour`(self)` Gets the hand's shadow colour.
| ``GetSpeedBackground`(self)` Gets the background colour outside the SpeedMeter control.
| ``GetSpeedStyle`(self)` Returns a list of strings and a list of integers containing the styles.
| ``GetSpeedValue`(self)` Gets the current value for SpeedMeter.
| ``GetTicks`(self)` Gets the ticks for SpeedMeter intervals (main ticks string values).
| ``GetTicksColour`(self)` Gets the ticks colour.
| ``GetTicksFont`(self)` Gets the ticks font.
| ``OnMouseMotion`(self, event)` Handles the mouse events.
| ``SetAngleRange`(self, start, end)` Sets the range of existence for SpeedMeter.
| ``SetArcColour`(self, colour)` Sets the external arc colour (thicker line).
| ``SetDirection`(self, direction)` Sets the direction of advancing SpeedMeter value.
| ``SetFillerColour`(self, colour)` Sets the partial filler colour.
| ``SetFirstGradientColour`(self, colour)` Sets the first gradient colour (near the ticks).
| ``SetHandColour`(self, colour)` Sets the hand (arrow indicator) colour.
| ``SetHandStyle`(self, style)` Sets the style for the hand (arrow indicator).
| ``SetIntervalColours`(self, colours)` Sets the colours for the intervals.
| ``SetIntervals`(self, intervals)` Sets the intervals for SpeedMeter (main ticks numeric values).
| ``SetMiddleIcon`(self, icon)` Sets the icon to be drawn near the center of SpeedMeter.
| ``SetMiddleText`(self, text)` Sets the text to be drawn near the center of SpeedMeter.
| ``SetMiddleTextColour`(self, colour)` Sets the colour for the text in the middle.
| ``SetMiddleTextFont`(self, font)` Sets the font for the text in the middle.
| ``SetNumberOfSecondaryTicks`(self, ticknum)` Sets the number of secondary (intermediate) ticks.
| ``SetSecondGradientColour`(self, colour)` Sets the second gradient colour (near the center).
| ``SetShadowColour`(self, colour)` Sets the hand's shadow colour.
| ``SetSpeedBackground`(self, colour)` Sets the background colour outside the SpeedMeter control.
| ``SetSpeedValue`(self, value)` Sets the current value for SpeedMeter.
| ``SetTicks`(self, ticks)` Sets the ticks for SpeedMeter intervals (main ticks string values).
| ``SetTicksColour`(self, colour)` Sets the ticks colour.
| ``SetTicksFont`(self, font)` Sets the ticks font.

Property Summary

Instance Method Details

### __init__(self, parent, id=-1, pos=wx.Point(-1, -1), size=wx.Size(-1, -1), extrastyle=8, bufferedstyle=1, mousestyle=0)
(Constructor)

    Default class constructor.

    Non standard wxPython parameters are:

    a) extrastyle: this value specifies the SpeedMeter styles:
       - SM_ROTATE_TEXT: draws the ticks rotated: the ticks are rotated
                         accordingly to the tick marks positions;
       - SM_DRAW_SECTORS: different intervals are painted in differend colours
                          (every sector of the circle has its own colour);
       - SM_DRAW_PARTIAL_SECTORS: every interval has its own colour, but only
                                  a circle corona is painted near the ticks;
       - SM_DRAW_HAND: the hand (arrow indicator) is drawn;
       - SM_DRAW_SHADOW: a shadow for the hand is drawn;
       - SM_DRAW_PARTIAL_FILLER: a circle corona that follows the hand position
                                 is drawn near the ticks;
       - SM_DRAW_SECONDARY_TICKS: intermediate (smaller) ticks are drawn between
                                  principal ticks;
       - SM_DRAW_MIDDLE_TEXT: some text is printed in the middle of the control
                              near the center;
       - SM_DRAW_MIDDLE_ICON: an icon is drawn in the middle of the control near
                              the center;
       - SM_DRAW_GRADIENT: a gradient of colours will fill the control;
       - SM_DRAW_FANCY_TICKS: with this style you can use xml tags to create
                              some custom text and draw it at the ticks position.
                              see wx.lib.fancytext for the tags.

    b) bufferedstyle: this value allows you to use the normal wx.PaintDC or the
                      double buffered drawing options:
       - SM_NORMAL_DC uses the normal wx.PaintDC;
       - SM_BUFFERED_DC uses the double buffered drawing style.

    c) mousestyle: this value allows you to use the mouse to change the SpeedMeter
                   value interactively with left click/drag events:

       - SM_MOUSE_TRACK: the mouse left click/drag allow you to change the
                         SpeedMeter value interactively.

  Overrides:
    `wx.lib.agw.speedmeter.BufferedWindow.__init__`

### CircleCoords(self, radius, angle, centerX, centerY)

Used internally.

### Draw(self, dc)

Draws everything on the empty bitmap. Here all the chosen styles are applied.

  Overrides:
    `wx.lib.agw.speedmeter.BufferedWindow.Draw`

### DrawExternalArc(self, draw=True)

Specify wheter or not you wish to draw the external (thicker) arc.

### GetAngleRange(self)

Gets the range of existence for SpeedMeter. The returned values are in radians.

### GetArcColour(self)

Gets the external arc colour.

### GetDirection(self)

Gets the direction of advancing SpeedMeter value.

### GetFillerColour(self)

Gets the partial filler colour.

### GetFirstGradientColour(self)

Gets the first gradient colour (near the ticks).

### GetHandColour(self)

Gets the hand (arrow indicator) colour.

### GetHandStyle(self)

Sets the style for the hand (arrow indicator).

### GetIntersection(self, current, intervals)

Used internally.

### GetIntervalColours(self)

Gets the colours for the intervals.

### GetIntervals(self)

Gets the intervals for SpeedMeter.

### GetMiddleIcon(self)

Gets the icon to be drawn near the center of SpeedMeter.

### GetMiddleIconDimens(self)

Used internally.

### GetMiddleText(self)

Gets the text to be drawn near the center of SpeedMeter.

### GetMiddleTextColour(self)

Gets the colour for the text in the middle.

### GetMiddleTextFont(self)

Gets the font for the text in the middle.

### GetNumberOfSecondaryTicks(self)

Gets the number of secondary (intermediate) ticks.

### GetSecondGradientColour(self)

Gets the first gradient colour (near the center).

### GetShadowColour(self)

Gets the hand's shadow colour.

### GetSpeedBackground(self)

Gets the background colour outside the SpeedMeter control.

### GetSpeedStyle(self)

Returns a list of strings and a list of integers containing the styles.

### GetSpeedValue(self)

Gets the current value for SpeedMeter.

### GetTicks(self)

Gets the ticks for SpeedMeter intervals (main ticks string values).

### GetTicksColour(self)

Gets the ticks colour.

### GetTicksFont(self)

Gets the ticks font.

### OnMouseMotion(self, event)

Handles the mouse events.

Here only left clicks/drags are involved. Should SpeedMeter have something more?

### SetAngleRange(self, start=0, end=3.1415926535897931)

Sets the range of existence for SpeedMeter. This values must be specifiend in radians.

### SetArcColour(self, colour=None)

Sets the external arc colour (thicker line).

### SetDirection(self, direction=None)

Sets the direction of advancing SpeedMeter value.

Specifying "advance" will move the hand in clock-wise direction (like normal car speed control), while using "reverse" will move it counterclock-wise direction.

### SetFillerColour(self, colour=None)

Sets the partial filler colour.

A circle corona near the ticks will be filled with this colour, from the starting value to the current value of SpeedMeter.

### SetFirstGradientColour(self, colour=None)

Sets the first gradient colour (near the ticks).

### SetHandColour(self, colour=None)

Sets the hand (arrow indicator) colour.

### SetHandStyle(self, style=None)

Sets the style for the hand (arrow indicator).

By specifying "Hand" SpeedMeter will draw a polygon that simulates the car speed control indicator. Using "Arrow" will force SpeedMeter to draw a simple arrow.

### SetIntervalColours(self, colours=None)

Sets the colours for the intervals. Every intervals (circle sector) should have a colour.

### SetIntervals(self, intervals=None)

Sets the intervals for SpeedMeter (main ticks numeric values).

### SetMiddleIcon(self, icon)

Sets the icon to be drawn near the center of SpeedMeter.

### SetMiddleText(self, text=None)

Sets the text to be drawn near the center of SpeedMeter.

### SetMiddleTextColour(self, colour=None)

Sets the colour for the text in the middle.

### SetMiddleTextFont(self, font=None)

Sets the font for the text in the middle.

### SetNumberOfSecondaryTicks(self, ticknum=None)

Sets the number of secondary (intermediate) ticks.

### SetSecondGradientColour(self, colour=None)

Sets the second gradient colour (near the center).

### SetShadowColour(self, colour=None)

Sets the hand's shadow colour.

### SetSpeedBackground(self, colour=None)

Sets the background colour outside the SpeedMeter control.

### SetSpeedValue(self, value=None)

Sets the current value for SpeedMeter.

### SetTicks(self, ticks=None)

Sets the ticks for SpeedMeter intervals (main ticks string values).

### SetTicksColour(self, colour=None)

Sets the ticks colour.

### SetTicksFont(self, font=None)

Sets the ticks font.

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