#self.clrList.sort()
self.bg_bmp = images.getGridBGBitmap()
- # Event handlers
- self.Bind(wx.EVT_PAINT, self.OnPaint)
- self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
-
# This could also be done by getting the window's default font;
# either way, we need to have a font loaded for later on.
#self.SetBackgroundColour("WHITE")
self.SetScrollbars(
self.cellWidth, self.lineHeight, numCells, len(self.clrList) + 2
)
+
+ # Event handlers - moved here so events won't fire before init is
+ # finished.
+ self.Bind(wx.EVT_PAINT, self.OnPaint)
+ self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
# tile the background bitmap loaded in __init__()
self.Centre(wx.BOTH)
self.CreateStatusBar(1, wx.ST_SIZEGRIP)
- splitter = wx.SplitterWindow(self, -1, style=wx.CLIP_CHILDREN)
- splitter2 = wx.SplitterWindow(splitter, -1, style=wx.CLIP_CHILDREN)
+ splitter = wx.SplitterWindow(self, -1, style=wx.CLIP_CHILDREN | wx.SP_LIVE_UPDATE | wx.SP_3D)
+ splitter2 = wx.SplitterWindow(splitter, -1, style=wx.CLIP_CHILDREN | wx.SP_LIVE_UPDATE | wx.SP_3D)
# Set up a log on the View Log Notebook page
self.log = wx.TextCtrl(splitter2, -1,
self.log = log
panel = wx.Panel( self, -1 )
+ # Layout controls on panel:
+ vs = wx.BoxSizer( wx.VERTICAL )
+
+ box1_title = wx.StaticBox( panel, -1, "Group 1" )
+ box1 = wx.StaticBoxSizer( box1_title, wx.VERTICAL )
+ grid1 = wx.FlexGridSizer( 0, 2, 0, 0 )
+
# 1st group of controls:
self.group1_ctrls = []
radio1 = wx.RadioButton( panel, -1, " Radio1 ", style = wx.RB_GROUP )
self.group1_ctrls.append((radio2, text2))
self.group1_ctrls.append((radio3, text3))
- # 2nd group of controls:
- self.group2_ctrls = []
- radio4 = wx.RadioButton( panel, -1, " Radio1 ", style = wx.RB_GROUP )
- radio5 = wx.RadioButton( panel, -1, " Radio2 " )
- radio6 = wx.RadioButton( panel, -1, " Radio3 " )
- text4 = wx.TextCtrl( panel, -1, "" )
- text5 = wx.TextCtrl( panel, -1, "" )
- text6 = wx.TextCtrl( panel, -1, "" )
- self.group2_ctrls.append((radio4, text4))
- self.group2_ctrls.append((radio5, text5))
- self.group2_ctrls.append((radio6, text6))
-
- # Layout controls on panel:
- vs = wx.BoxSizer( wx.VERTICAL )
-
- box1_title = wx.StaticBox( panel, -1, "Group 1" )
- box1 = wx.StaticBoxSizer( box1_title, wx.VERTICAL )
- grid1 = wx.FlexGridSizer( 0, 2, 0, 0 )
-
for radio, text in self.group1_ctrls:
grid1.AddWindow( radio, 0, wx.ALIGN_CENTRE|wx.LEFT|wx.RIGHT|wx.TOP, 5 )
grid1.AddWindow( text, 0, wx.ALIGN_CENTRE|wx.LEFT|wx.RIGHT|wx.TOP, 5 )
box2 = wx.StaticBoxSizer( box2_title, wx.VERTICAL )
grid2 = wx.FlexGridSizer( 0, 2, 0, 0 )
+ # 2nd group of controls:
+ self.group2_ctrls = []
+ radio4 = wx.RadioButton( panel, -1, " Radio1 ", style = wx.RB_GROUP )
+ radio5 = wx.RadioButton( panel, -1, " Radio2 " )
+ radio6 = wx.RadioButton( panel, -1, " Radio3 " )
+ text4 = wx.TextCtrl( panel, -1, "" )
+ text5 = wx.TextCtrl( panel, -1, "" )
+ text6 = wx.TextCtrl( panel, -1, "" )
+ self.group2_ctrls.append((radio4, text4))
+ self.group2_ctrls.append((radio5, text5))
+ self.group2_ctrls.append((radio6, text6))
+
for radio, text in self.group2_ctrls:
grid2.AddWindow( radio, 0, wx.ALIGN_CENTRE|wx.LEFT|wx.RIGHT|wx.TOP, 5 )
grid2.AddWindow( text, 0, wx.ALIGN_CENTRE|wx.LEFT|wx.RIGHT|wx.TOP, 5 )
text = wx.StaticText(self, -1, str, (20, 100))
font = wx.Font(18, wx.SWISS, wx.NORMAL, wx.NORMAL)
text.SetFont(font)
- #text.SetSize(text.GetBestSize())
+ text.SetSize(text.GetBestSize())
wx.StaticText(self, -1, "Multi-line wx.StaticText\nline 2\nline 3\n\nafter empty line", (20,150))
wx.StaticText(self, -1, "Align right multi-line\nline 2\nline 3\n\nafter empty line", (220,150), style=wx.ALIGN_RIGHT)
scrolled.ScrolledPanel.__init__( self, parent, -1 )
self.log = log
-
+ box_label = wx.StaticBox( self, -1, "Change Controls through API" )
+ buttonbox = wx.StaticBoxSizer( box_label, wx.HORIZONTAL )
+
text1 = wx.StaticText( self, -1, "12-hour format:")
self.time12 = masked.TimeCtrl( self, -1, name="12 hour control" )
spin1 = wx.SpinButton( self, -1, wx.DefaultPosition, (-1,20), 0 )
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 )
self.dir_x = self.x_pos
self.dir_y = self.y_pos
- self.DisplayDir() # display the directory value
+ self.dir = wx.StaticText(self, -1, self.set_dir, (self.dir_x, self.dir_y), (250, -1))
self.y_pos = self.y_pos + self.delta
- btn = wx.Button(self, 12331, ' Set Directory ', (self.x_pos, self.y_pos), size)
+ btn = wx.Button(self, 12331, ' Set Directory ', (self.x_pos, self.y_pos))
self.Bind(wx.EVT_BUTTON, self.SetDirect, btn)
self.type_posy = self.y_pos # save the y position for the image type combo
self.GetFiles() # get the file list
self.y_pos = self.y_pos + self.delta + 10
-
self.list_height = 150
# List of Labels
self.fl_list.sort() # sort the file list
def DisplayDir(self): # display the working directory
- wx.StaticText(self, -1, self.set_dir, (self.dir_x, self.dir_y), (250, -1))
+ if self.dir:
+ self.dir.SetLabel(self.set_dir)
def OnSetType(self, event):
val = event.GetString() # get file type value