Source

sleepytime / sleepytime.py

Full commit
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.3 on Wed Apr  1 17:50:35 2009

import wx

# begin wxGlade: extracode
# end wxGlade



class SleepyFrame(wx.Frame):
    def __init__(self, *args, **kwds):
        # begin wxGlade: SleepyFrame.__init__
        kwds["style"] = wx.ICONIZE|wx.CAPTION|wx.MINIMIZE|wx.CLOSE_BOX|wx.MINIMIZE_BOX
        wx.Frame.__init__(self, *args, **kwds)
        self.hour_label = wx.StaticText(self, -1, "--", style=wx.ALIGN_CENTRE)
        self.hour_plus10 = wx.Button(self, -1, "+10")
        self.hour_plus1 = wx.Button(self, -1, "+1")
        self.hour_minus1 = wx.Button(self, -1, "-1")
        self.hour_minus10 = wx.Button(self, -1, "-10")
        self.minute_label = wx.StaticText(self, -1, "--", style=wx.ALIGN_CENTRE)
        self.minute_plus10 = wx.Button(self, -1, "+10")
        self.minute_plus1 = wx.Button(self, -1, "+1")
        self.minute_minus1 = wx.Button(self, -1, "-1")
        self.minute_minus10 = wx.Button(self, -1, "-10")
        self.hour_label_copy_1 = wx.StaticText(self, -1, "--", style=wx.ALIGN_CENTRE)
        self.second_plus10 = wx.Button(self, -1, "+10")
        self.second_plus1 = wx.Button(self, -1, "+1")
        self.second_minus1 = wx.Button(self, -1, "-1")
        self.second_minus10 = wx.Button(self, -1, "-10")
        self.status_label = wx.StaticText(self, -1, "Status")
        self.playpause_button = wx.Button(self, -1, ">")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.hour_plusten, self.hour_plus10)
        self.Bind(wx.EVT_BUTTON, self.hour_plusone, self.hour_plus1)
        self.Bind(wx.EVT_BUTTON, self.hour_minusone, self.hour_minus1)
        self.Bind(wx.EVT_BUTTON, self.hour_minusten, self.hour_minus10)
        self.Bind(wx.EVT_BUTTON, self.minute_plusten, self.minute_plus10)
        self.Bind(wx.EVT_BUTTON, self.minute_plusone, self.minute_plus1)
        self.Bind(wx.EVT_BUTTON, self.minute_minusone, self.minute_minus1)
        self.Bind(wx.EVT_BUTTON, self.minute_minusten, self.minute_minus10)
        self.Bind(wx.EVT_BUTTON, self.second_plusten, self.second_plus10)
        self.Bind(wx.EVT_BUTTON, self.sceond_plusone, self.second_plus1)
        self.Bind(wx.EVT_BUTTON, self.second_minusone, self.second_minus1)
        self.Bind(wx.EVT_BUTTON, self.second_minusten, self.second_minus10)
        self.Bind(wx.EVT_BUTTON, self.PlayPause_click, self.playpause_button)
        # end wxGlade

    def __set_properties(self):
        # begin wxGlade: SleepyFrame.__set_properties
        self.SetTitle("iTunes Sleepytime")
        self.SetSize((489, 145))
        self.hour_label.SetMinSize((90, 90))
        self.hour_label.SetBackgroundColour(wx.Colour(47, 47, 47))
        self.hour_label.SetForegroundColour(wx.Colour(192, 192, 192))
        self.hour_label.SetFont(wx.Font(56, wx.MODERN, wx.NORMAL, wx.BOLD, 0, ""))
        self.hour_plus10.SetMinSize((45, 24))
        self.hour_plus1.SetMinSize((45, 24))
        self.hour_minus1.SetMinSize((45, 24))
        self.hour_minus10.SetMinSize((45, 24))
        self.minute_label.SetMinSize((90, 90))
        self.minute_label.SetBackgroundColour(wx.Colour(47, 47, 47))
        self.minute_label.SetForegroundColour(wx.Colour(192, 192, 192))
        self.minute_label.SetFont(wx.Font(56, wx.MODERN, wx.NORMAL, wx.BOLD, 0, ""))
        self.minute_plus10.SetMinSize((45, 24))
        self.minute_plus1.SetMinSize((45, 24))
        self.minute_minus1.SetMinSize((45, 24))
        self.minute_minus10.SetMinSize((45, 24))
        self.hour_label_copy_1.SetMinSize((90, 90))
        self.hour_label_copy_1.SetBackgroundColour(wx.Colour(47, 47, 47))
        self.hour_label_copy_1.SetForegroundColour(wx.Colour(192, 192, 192))
        self.hour_label_copy_1.SetFont(wx.Font(56, wx.MODERN, wx.NORMAL, wx.BOLD, 0, ""))
        self.second_plus10.SetMinSize((45, 24))
        self.second_plus1.SetMinSize((45, 24))
        self.second_minus1.SetMinSize((45, 24))
        self.second_minus10.SetMinSize((45, 24))
        self.status_label.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, 0, ""))
        self.playpause_button.SetMinSize((30, 30))
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: SleepyFrame.__do_layout
        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        sizer_2 = wx.BoxSizer(wx.VERTICAL)
        sizer_6 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_4_copy_1 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_5_copy_1 = wx.BoxSizer(wx.VERTICAL)
        sizer_4_copy = wx.BoxSizer(wx.HORIZONTAL)
        sizer_5_copy = wx.BoxSizer(wx.VERTICAL)
        sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_5 = wx.BoxSizer(wx.VERTICAL)
        sizer_4.Add(self.hour_label, 0, wx.ALIGN_CENTER_VERTICAL, 0)
        sizer_5.Add(self.hour_plus10, 0, 0, 0)
        sizer_5.Add(self.hour_plus1, 0, 0, 0)
        sizer_5.Add(self.hour_minus1, 0, 0, 0)
        sizer_5.Add(self.hour_minus10, 0, 0, 0)
        sizer_4.Add(sizer_5, 0, wx.ALIGN_CENTER_VERTICAL, 0)
        sizer_3.Add(sizer_4, 1, wx.EXPAND, 0)
        sizer_4_copy.Add(self.minute_label, 0, wx.ALIGN_CENTER_VERTICAL, 0)
        sizer_5_copy.Add(self.minute_plus10, 0, 0, 0)
        sizer_5_copy.Add(self.minute_plus1, 0, 0, 0)
        sizer_5_copy.Add(self.minute_minus1, 0, 0, 0)
        sizer_5_copy.Add(self.minute_minus10, 0, 0, 0)
        sizer_4_copy.Add(sizer_5_copy, 0, wx.ALIGN_CENTER_VERTICAL, 0)
        sizer_3.Add(sizer_4_copy, 1, wx.EXPAND, 0)
        sizer_4_copy_1.Add(self.hour_label_copy_1, 0, wx.ALIGN_CENTER_VERTICAL, 0)
        sizer_5_copy_1.Add(self.second_plus10, 0, 0, 0)
        sizer_5_copy_1.Add(self.second_plus1, 0, 0, 0)
        sizer_5_copy_1.Add(self.second_minus1, 0, 0, 0)
        sizer_5_copy_1.Add(self.second_minus10, 0, 0, 0)
        sizer_4_copy_1.Add(sizer_5_copy_1, 0, wx.ALIGN_CENTER_VERTICAL, 0)
        sizer_3.Add(sizer_4_copy_1, 1, wx.EXPAND, 0)
        sizer_2.Add(sizer_3, 1, wx.EXPAND, 0)
        sizer_6.Add(self.status_label, 0, wx.ALIGN_CENTER_VERTICAL, 5)
        sizer_6.Add(self.playpause_button, 0, wx.EXPAND, 0)
        sizer_2.Add(sizer_6, 0, wx.ALIGN_RIGHT, 0)
        sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
        self.SetSizer(sizer_1)
        sizer_1.SetSizeHints(self)
        self.Layout()
        # end wxGlade

    def hour_plusten(self, event): # wxGlade: SleepyFrame.<event_handler>
        print "Event handler `hour_plusten' not implemented!"
        event.Skip()

    def hour_plusone(self, event): # wxGlade: SleepyFrame.<event_handler>
        print "Event handler `hour_plusone' not implemented!"
        event.Skip()

    def hour_minusone(self, event): # wxGlade: SleepyFrame.<event_handler>
        print "Event handler `hour_minusone' not implemented!"
        event.Skip()

    def hour_minusten(self, event): # wxGlade: SleepyFrame.<event_handler>
        print "Event handler `hour_minusten' not implemented!"
        event.Skip()

    def minute_plusten(self, event): # wxGlade: SleepyFrame.<event_handler>
        print "Event handler `minute_plusten' not implemented!"
        event.Skip()

    def minute_plusone(self, event): # wxGlade: SleepyFrame.<event_handler>
        print "Event handler `minute_plusone' not implemented!"
        event.Skip()

    def minute_minusone(self, event): # wxGlade: SleepyFrame.<event_handler>
        print "Event handler `minute_minusone' not implemented!"
        event.Skip()

    def minute_minusten(self, event): # wxGlade: SleepyFrame.<event_handler>
        print "Event handler `minute_minusten' not implemented!"
        event.Skip()

    def second_plusten(self, event): # wxGlade: SleepyFrame.<event_handler>
        print "Event handler `second_plusten' not implemented!"
        event.Skip()

    def sceond_plusone(self, event): # wxGlade: SleepyFrame.<event_handler>
        print "Event handler `sceond_plusone' not implemented!"
        event.Skip()

    def second_minusone(self, event): # wxGlade: SleepyFrame.<event_handler>
        print "Event handler `second_minusone' not implemented!"
        event.Skip()

    def second_minusten(self, event): # wxGlade: SleepyFrame.<event_handler>
        print "Event handler `second_minusten' not implemented!"
        event.Skip()

    def PlayPause_click(self, event): # wxGlade: SleepyFrame.<event_handler>
        print "Event handler `PlayPause_click' not implemented!"
        event.Skip()

# end of class SleepyFrame


if __name__ == "__main__":
    app = wx.PySimpleApp(0)
    wx.InitAllImageHandlers()
    frame_1 = SleepyFrame(None, -1, "")
    app.SetTopWindow(frame_1)
    frame_1.Show()
    app.MainLoop()