Ejemplo n.º 1
0
    def __init__(self, parent, log):
        wx.Panel.__init__(self, parent, -1)
        self.log = log

        led = gizmos.LEDNumberCtrl(self, -1, (25, 25), (280, 50))
        led.SetValue("012.34")

        led = gizmos.LEDNumberCtrl(self, -1, (25, 100), (280, 50))
        led.SetValue("56789")
        led.SetAlignment(gizmos.LED_ALIGN_RIGHT)
        led.SetDrawFaded(False)
        led.SetForegroundColour('yellow')

        led = gizmos.LEDNumberCtrl(
            self, -1, (25, 175), (280, 50),
            gizmos.LED_ALIGN_CENTER)  # | gizmos.LED_DRAW_FADED)
        led.SetForegroundColour('black')
        led.SetBackgroundColour('white')

        self.clock = led
        self.OnTimer(None)

        self.timer = wx.Timer(self)
        self.timer.Start(1000)
        self.Bind(wx.EVT_TIMER, self.OnTimer)
Ejemplo n.º 2
0
    def __init__(self,
                 parent,
                 id=wx.ID_ANY,
                 pos=wx.DefaultPosition,
                 size=wx.Size(319, 153),
                 style=wx.TAB_TRAVERSAL,
                 name=wx.EmptyString):
        wx.Panel.__init__(self,
                          parent,
                          id=id,
                          pos=pos,
                          size=size,
                          style=style,
                          name=name)

        led = gizmos.LEDNumberCtrl(
            self, -1, (0, 0), (250, 50),
            gizmos.LED_ALIGN_CENTER)  # | gizmos.LED_DRAW_FADED)
        led.SetForegroundColour('black')
        led.SetBackgroundColour('white')
        self.clock = led
        self.OnTimer(None)

        self.timer = wx.Timer(self)
        self.timer.Start(1000)
        self.Bind(wx.EVT_TIMER, self.OnTimer)
Ejemplo n.º 3
0
    def __init__(self):
        super().__init__(parent=None,
                         title='nihao',
                         size=(500, 500),
                         style=wx.DEFAULT_FRAME_STYLE)
        # self.log = log
        self.Centre()

        panel = wx.Panel(parent=self)
        # led = gizmos.LEDNumberCtrl(self, -1, (25,25), (280, 50))
        # led.SetValue("012.34")
        #
        # led = gizmos.LEDNumberCtrl(self, -1, (25, 100), (280, 50))
        # led.SetValue("56789")
        # led.SetAlignment(gizmos.LED_ALIGN_RIGHT)
        title1 = wx.StaticText(panel, label='处理后的数据')
        processeddata = wx.TextCtrl(panel,
                                    style=wx.TE_READONLY | wx.TE_MULTILINE,
                                    name='processeddata')

        led = gizmos.LEDNumberCtrl(
            self, -1, (25, 200), (500, 20), gizmos.LED_ALIGN_CENTER
        )  # | gizmos.LED_DRAW_FADED)LED_ALIGN_CENTER
        led.SetForegroundColour('red')
        led.SetBackgroundColour('white')
        led.SetDrawFaded(False)
        led.SetForegroundColour('yellow')

        box = wx.BoxSizer(wx.VERTICAL)
        box.Add(title1, 1, flag=wx.ALL | wx.EXPAND, border=5)
        box.Add(processeddata, 1, flag=wx.ALL | wx.EXPAND, border=5)
        box.Add(led, 1, flag=wx.ALL | wx.EXPAND, border=5)

        panel.SetSizer(box)

        self.clock = led
        self.OnTimer(None)

        self.timer = wx.Timer(self)
        self.timer.Start(1000)
        self.Bind(wx.EVT_TIMER, self.OnTimer)
Ejemplo n.º 4
0
 def test_defaultCtor(self):
     led = gizmos.LEDNumberCtrl()
     led.Create(self.frame, pos=(25, 25), size=(280, 50))
     led.SetValue('123456')
Ejemplo n.º 5
0
 def test_normalCtor(self):
     led = gizmos.LEDNumberCtrl(self.frame, pos=(25, 25), size=(280, 50))
     led.SetValue('123456')