wx.lib.ticker.Ticker¶
Control(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, name=ControlNameStr) -> None Control() -> None
This is the base class for a control or “widget”.
Class Hierarchy¶
Known Superclasses¶
Methods Summary¶
Default class constructor. |
|
Non-interactive, so don’t accept focus |
|
Width we don’t care about, height is either -1, or the character |
|
Draws the ticker text at the current offset using the provided DC. |
|
Get the set direction. |
|
Get the frames per second speed of the ticker. |
|
Get pixels per frame setting. |
|
Get the current ticker text. |
|
Is the ticker ticking? ie, is the text moving? |
|
Noop because of double buffering |
|
Handles the |
|
Handles the |
|
Sets the direction of the ticker: right to left (rtl) or |
|
Set the font for the control. |
|
Adjust the update speed of the ticker. |
|
Set the number of pixels per frame the ticker moves - ie, |
|
Set the ticker text. |
|
Don’t get colours from our parent. |
|
Starts the text moving |
|
Stop moving the text |
|
Updates the cached text extent if needed. |
Class API¶
- class Ticker(wx.Control)¶
Control(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, name=ControlNameStr) -> None Control() -> None
This is the base class for a control or “widget”.
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 forTicker
.- Parameters:
evt – a
EraseEvent
event to be processed.
- OnPaint(self, evt)¶
Handles the
wx.EVT_PAINT
event forTicker
.- Parameters:
evt – a
PaintEvent
event to be processed.
- OnTick(self, evt)¶
Handles the
wx.EVT_TIMER
event forTicker
.- 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