X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1fded56b375bf7a4687af1cdb182899614c1b2a8..19ab38e730bcd5d900b87a73150ce52947e05d9c:/wxPython/demo/wxLEDNumberCtrl.py diff --git a/wxPython/demo/wxLEDNumberCtrl.py b/wxPython/demo/wxLEDNumberCtrl.py index 4aead17541..7bb46e1647 100644 --- a/wxPython/demo/wxLEDNumberCtrl.py +++ b/wxPython/demo/wxLEDNumberCtrl.py @@ -1,32 +1,36 @@ +# 11/19/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o Updated for wx namespace +# -from wxPython.wx import * -from wxPython.gizmos import * +import time -import time +import wx +import wx.gizmos as gizmos #---------------------------------------------------------------------- -class TestPanel(wxPanel): +class TestPanel(wx.Panel): def __init__(self, parent, log): - wxPanel.__init__(self, parent, -1) + wx.Panel.__init__(self, parent, -1) self.log = log - led = wxLEDNumberCtrl(self, -1, (25,25), (280, 50)) + led = gizmos.LEDNumberCtrl(self, -1, (25,25), (280, 50)) led.SetValue("01234") - led = wxLEDNumberCtrl(self, -1, (25,100), (280, 50)) + led = gizmos.LEDNumberCtrl(self, -1, (25,100), (280, 50)) led.SetValue("56789") - led.SetAlignment(wxLED_ALIGN_RIGHT) + led.SetAlignment(gizmos.LED_ALIGN_RIGHT) led.SetDrawFaded(False) - led = wxLEDNumberCtrl(self, -1, (25,175), (280, 50), - wxLED_ALIGN_CENTER)# | wxLED_DRAW_FADED) + led = gizmos.LEDNumberCtrl(self, -1, (25,175), (280, 50), + gizmos.LED_ALIGN_CENTER)# | gizmos.LED_DRAW_FADED) self.clock = led self.OnTimer(None) - self.timer = wxTimer(self) + self.timer = wx.Timer(self) self.timer.Start(1000) - EVT_TIMER(self, -1, self.OnTimer) + self.Bind(wx.EVT_TIMER, self.OnTimer) def OnTimer(self, evt): @@ -45,6 +49,62 @@ def runTest(frame, nb, log): #---------------------------------------------------------------------- overview = """\ + + +The following was gleaned as best I could from the wxWindows +source, which was a bit reluctant to reveal its secrets. My appologies if +I missed anything - jmg +

+wxLEDNumberCtrl( parent, id=-1, pos=wx.DefaultPosition, +size=wx.DefaultSize, style=LED_ALIGN_LEFT | LED_DRAW_FADED) + +

This is a control that simulates an LED clock display. It only accepts +numeric input. + +

Styles + +

+
LED_ALIGN_LEFT +
Align to the left. + +
LED_ALIGN_RIGHT +
Align to the right. + +
LED_ALIGN_CENTER +
Center on display. + +
LED_DRAW_FADED +
Not implemented. + +
+ +

Methods (and best guesses at what they do) + +

+
GetAlignment() +
Returns the alignment attribute for the control. + +
GetDrawFaded() +
Returns the DrawFaded attribute for the control. + +
GetValue() +
Returns the current value of the control. + +
SetAlignment(alignment) +
Set the alignment attribute for the control. + +
SetDrawFaded(value) +
Set the DrawFaded attribute for the control. + +
SetValue(number) +
Set the value for the control. Only numeric values are accepted. + +
+ +

Additionally, several methods of wx.Window are available as well. + + + """