- text2 = wxStaticText( self, -1, "24-hour format:")
- spin2 = wxSpinButton( self, -1, wxDefaultPosition, wxSize(-1,20), 0 )
- self.time24 = wxTimeCtrl( self, -1, name="24 hour control", fmt24hr=True, spinButton = spin2 )
-
- text3 = wxStaticText( self, -1, "No seconds\nor spin button:")
- self.spinless_ctrl = wxTimeCtrl( self, -1, name="spinless control", display_seconds = False )
-
- grid = wxFlexGridSizer( 0, 2, 10, 5 )
- grid.Add( text1, 0, wxALIGN_RIGHT )
- hbox1 = wxBoxSizer( wxHORIZONTAL )
- hbox1.Add( self.time12, 0, wxALIGN_CENTRE )
- hbox1.Add( spin1, 0, wxALIGN_CENTRE )
- grid.Add( hbox1, 0, wxLEFT )
-
- grid.Add( text2, 0, wxALIGN_RIGHT|wxTOP|wxBOTTOM )
- hbox2 = wxBoxSizer( wxHORIZONTAL )
- hbox2.Add( self.time24, 0, wxALIGN_CENTRE )
- hbox2.Add( spin2, 0, wxALIGN_CENTRE )
- grid.Add( hbox2, 0, wxLEFT )
-
- grid.Add( text3, 0, wxALIGN_RIGHT|wxTOP|wxBOTTOM )
- grid.Add( self.spinless_ctrl, 0, wxLEFT )
-
-
- buttonChange = wxButton( self, -1, "Change Controls")
- self.radio12to24 = wxRadioButton( self, -1, "Copy 12-hour time to 24-hour control", wxDefaultPosition, wxDefaultSize, wxRB_GROUP )
- self.radio24to12 = wxRadioButton( self, -1, "Copy 24-hour time to 12-hour control")
- self.radioWx = wxRadioButton( self, -1, "Set controls to 'now' using wxDateTime")
- self.radioMx = wxRadioButton( self, -1, "Set controls to 'now' using mxDateTime")
-
- radio_vbox = wxBoxSizer( wxVERTICAL )
- radio_vbox.Add( self.radio12to24, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 )
- radio_vbox.Add( self.radio24to12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 )
- radio_vbox.Add( self.radioWx, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 )
- radio_vbox.Add( self.radioMx, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 )
-
- box_label = wxStaticBox( self, -1, "Change Controls through API" )
- buttonbox = wxStaticBoxSizer( box_label, wxHORIZONTAL )
- buttonbox.Add( buttonChange, 0, wxALIGN_CENTRE|wxALL, 5 )
- buttonbox.Add( radio_vbox, 0, wxALIGN_CENTRE|wxALL, 5 )
-
- hbox = wxBoxSizer( wxHORIZONTAL )
- hbox.Add( grid, 0, wxALIGN_LEFT|wxALL, 15 )
- hbox.Add( buttonbox, 0, wxALIGN_RIGHT|wxBOTTOM, 20 )
-
-
- box_label = wxStaticBox( self, -1, "Bounds Control" )
- boundsbox = wxStaticBoxSizer( box_label, wxHORIZONTAL )
- self.set_bounds = wxCheckBox( self, -1, "Set time bounds:" )
-
- minlabel = wxStaticText( self, -1, "minimum time:" )
- self.min = wxTimeCtrl( self, -1, name="min", display_seconds = False )
+ text2 = wx.StaticText( self, -1, "24-hour format:")
+ spin2 = wx.SpinButton( self, -1, wx.DefaultPosition, (-1,20), 0 )
+ self.time24 = timectl.TimeCtrl(
+ self, -1, name="24 hour control", fmt24hr=True,
+ spinButton = spin2
+ )
+
+ text3 = wx.StaticText( self, -1, "No seconds\nor spin button:")
+ self.spinless_ctrl = timectl.TimeCtrl(
+ self, -1, name="spinless control",
+ display_seconds = False
+ )
+
+ grid = wx.FlexGridSizer( 0, 2, 10, 5 )
+ grid.Add( text1, 0, wx.ALIGN_RIGHT )
+ hbox1 = wx.BoxSizer( wx.HORIZONTAL )
+ hbox1.Add( self.time12, 0, wx.ALIGN_CENTRE )
+ hbox1.Add( spin1, 0, wx.ALIGN_CENTRE )
+ grid.Add( hbox1, 0, wx.LEFT )
+
+ grid.Add( text2, 0, wx.ALIGN_RIGHT|wx.TOP|wx.BOTTOM )
+ hbox2 = wx.BoxSizer( wx.HORIZONTAL )
+ hbox2.Add( self.time24, 0, wx.ALIGN_CENTRE )
+ hbox2.Add( spin2, 0, wx.ALIGN_CENTRE )
+ grid.Add( hbox2, 0, wx.LEFT )
+
+ grid.Add( text3, 0, wx.ALIGN_RIGHT|wx.TOP|wx.BOTTOM )
+ grid.Add( self.spinless_ctrl, 0, wx.LEFT )
+
+
+ buttonChange = wx.Button( self, -1, "Change Controls")
+ self.radio12to24 = wx.RadioButton(
+ self, -1, "Copy 12-hour time to 24-hour control",
+ wx.DefaultPosition, wx.DefaultSize, wx.RB_GROUP
+ )
+
+ self.radio24to12 = wx.RadioButton(
+ self, -1, "Copy 24-hour time to 12-hour control"
+ )
+
+ self.radioWx = wx.RadioButton( self, -1, "Set controls to 'now' using wxDateTime")
+ self.radioMx = wx.RadioButton( self, -1, "Set controls to 'now' using mxDateTime")
+
+ radio_vbox = wx.BoxSizer( wx.VERTICAL )
+ radio_vbox.Add( self.radio12to24, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+ radio_vbox.Add( self.radio24to12, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+ radio_vbox.Add( self.radioWx, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+ radio_vbox.Add( self.radioMx, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+
+ box_label = wx.StaticBox( self, -1, "Change Controls through API" )
+ buttonbox = wx.StaticBoxSizer( box_label, wx.HORIZONTAL )
+ buttonbox.Add( buttonChange, 0, wx.ALIGN_CENTRE|wx.ALL, 5 )
+ buttonbox.Add( radio_vbox, 0, wx.ALIGN_CENTRE|wx.ALL, 5 )
+
+ hbox = wx.BoxSizer( wx.HORIZONTAL )
+ hbox.Add( grid, 0, wx.ALIGN_LEFT|wx.ALL, 15 )
+ hbox.Add( buttonbox, 0, wx.ALIGN_RIGHT|wx.BOTTOM, 20 )
+
+
+ box_label = wx.StaticBox( self, -1, "Bounds Control" )
+ boundsbox = wx.StaticBoxSizer( box_label, wx.HORIZONTAL )
+ self.set_bounds = wx.CheckBox( self, -1, "Set time bounds:" )
+
+ minlabel = wx.StaticText( self, -1, "minimum time:" )
+ self.min = timectl.TimeCtrl( self, -1, name="min", display_seconds = False )