Phoenix Logo

phoenix_title wx.lib.ticker.Ticker


class_hierarchy Class Hierarchy

Inheritance diagram for class Ticker:


super_classes Known Superclasses

wx.Control


method_summary Methods Summary

__init__ Default class constructor.
AcceptsFocus Non-interactive, so don’t accept focus
DoGetBestSize Width we don’t care about, height is either -1, or the character
DrawText Draws the ticker text at the current offset using the provided DC.
GetDirection Get the set direction.
GetFPS Get the frames per second speed of the ticker.
GetPPF Get pixels per frame setting.
GetText Get the current ticker text.
IsTicking Is the ticker ticking? ie, is the text moving?
OnErase Noop because of double buffering
OnPaint Handles the wx.EVT_PAINT event for Ticker.
OnTick Handles the wx.EVT_TIMER event for Ticker.
SetDirection Sets the direction of the ticker: right to left (rtl) or
SetFont Set the font for the control.
SetFPS Adjust the update speed of the ticker.
SetPPF Set the number of pixels per frame the ticker moves - ie,
SetText Set the ticker text.
ShouldInheritColours Don’t get colours from our parent.
Start Starts the text moving
Stop Stop moving the text
UpdateExtent Updates the cached text extent if needed.

api Class API



class Ticker(wx.Control)

Methods



__init__(self, parent, id=-1, text="", fgcolor = wx.BLACK, bgcolor = wx.WHITE, start=True, ppf=2, fps=20, direction="rtl", pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.NO_BORDER, name="Ticker")

Default class constructor.

Parameters:
  • parent (wx.Window) – the parent
  • id (integer) – an identifier for the control: a value of -1 is taken to mean a default
  • text (string) – text in the ticker
  • fgcolor (wx.Colour) – text/foreground color
  • bgcolor (wx.Colour) – background color
  • start (boolean) – if True, the ticker starts immediately
  • ppf (int) – pixels per frame
  • fps (int) – frames per second
  • direction – direction of ticking, ‘rtl’ or ‘ltr’
  • pos (wx.Point) – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform
  • name – the control name


AcceptsFocus(self)

Non-interactive, so don’t accept focus



DoGetBestSize(self)

Width we don’t care about, height is either -1, or the character height of our text with a little extra padding



DrawText(self, dc)

Draws the ticker text at the current offset using the provided DC.

Parameters:dc (wx.DC) – the dc to use.


GetDirection(self)

Get the set direction.



GetFPS(self)

Get the frames per second speed of the ticker.



GetPPF(self)

Get pixels per frame setting.



GetText(self)

Get the current ticker text.



IsTicking(self)

Is the ticker ticking? ie, is the text moving?



OnErase(self, evt)

Noop because of double buffering

Handles the wx.EVT_ERASE_BACKGROUND event for Ticker.

Parameters:evt – a EraseEvent event to be processed.


OnPaint(self, evt)

Handles the wx.EVT_PAINT event for Ticker.

Parameters:evt – a PaintEvent event to be processed.


OnTick(self, evt)

Handles the wx.EVT_TIMER event for Ticker.

Parameters:evt – a TimerEvent event to be processed.


SetDirection(self, dir)

Sets the direction of the ticker: right to left (rtl) or left to right (ltr).

Parameters:dir – the direction ‘rtl’ or ‘ltr’


SetFont(self, font)

Set the font for the control.

Parameters:font (wx.Font) – the font to be used.


SetFPS(self, fps)

Adjust the update speed of the ticker.

Parameters:fps (int) – frames per second.


SetPPF(self, ppf)

Set the number of pixels per frame the ticker moves - ie, how “jumpy” it is.

Parameters:ppf (int) – the pixels per frame setting.


SetText(self, text)

Set the ticker text.

Parameters:text (string) – the ticker text


ShouldInheritColours(self)

Don’t get colours from our parent.



Start(self)

Starts the text moving



Stop(self)

Stop moving the text



UpdateExtent(self, dc)

Updates the cached text extent if needed.

Parameters:dc (wx.DC) – the dc to use.