]> git.saurik.com Git - wxWidgets.git/commitdiff
wx.StaticBox and siblings creation order, and other fixes from Kevin Ollivier
authorRobin Dunn <robin@alldunn.com>
Sun, 25 Apr 2004 00:39:05 +0000 (00:39 +0000)
committerRobin Dunn <robin@alldunn.com>
Sun, 25 Apr 2004 00:39:05 +0000 (00:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26942 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/ColourDB.py
wxPython/demo/Main.py
wxPython/demo/RadioButton.py
wxPython/demo/StaticText.py
wxPython/demo/TimeCtrl.py
wxPython/wx/lib/imagebrowser.py

index b3b08ce8788444bb5a884d659ef4559433ebd9a7..e00652c734d3cf25cda6f7b9b32893f1383a1475 100644 (file)
@@ -18,10 +18,6 @@ class TestWindow(wx.ScrolledWindow):
         #self.clrList.sort()
         self.bg_bmp = images.getGridBGBitmap()
 
         #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")
         # 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")
@@ -54,6 +50,11 @@ class TestWindow(wx.ScrolledWindow):
         self.SetScrollbars(
             self.cellWidth, self.lineHeight, numCells, len(self.clrList) + 2
             )
         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__()
 
 
     # tile the background bitmap loaded in __init__()
index 349a1a67122d4fe34b89f7e03cfc6c1f88f6c4cb..31a56a73a703549e644a9a365c09a1e70955f0a0 100644 (file)
@@ -465,8 +465,8 @@ class wxPythonDemo(wx.Frame):
         self.Centre(wx.BOTH)
         self.CreateStatusBar(1, wx.ST_SIZEGRIP)
 
         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,
 
         # Set up a log on the View Log Notebook page
         self.log = wx.TextCtrl(splitter2, -1,
index 74b853d048fd7288e0b1e90811181ea25e99bd4b..3fcf1fee4eb43594a33c993be4749684adfd723d 100644 (file)
@@ -10,6 +10,13 @@ class TestPanel( wx.Panel ):
         self.log = log
         panel = wx.Panel( self, -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 )
         # 1st group of controls:
         self.group1_ctrls = []
         radio1 = wx.RadioButton( panel, -1, " Radio1 ", style = wx.RB_GROUP )
@@ -22,25 +29,6 @@ class TestPanel( wx.Panel ):
         self.group1_ctrls.append((radio2, text2))
         self.group1_ctrls.append((radio3, text3))
 
         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 )
         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 )
@@ -52,6 +40,18 @@ class TestPanel( wx.Panel ):
         box2 = wx.StaticBoxSizer( box2_title, wx.VERTICAL )
         grid2 = wx.FlexGridSizer( 0, 2, 0, 0 )
 
         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 )
         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 )
index 6cc9edd3ffd18c36ee903606af28ffd8217fe073..85484799fd002c1311aa072e43e20e19a406926c 100644 (file)
@@ -26,7 +26,7 @@ class TestPanel(wx.Panel):
         text = wx.StaticText(self, -1, str, (20, 100))
         font = wx.Font(18, wx.SWISS, wx.NORMAL, wx.NORMAL)
         text.SetFont(font)
         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)
 
         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)
index 7b730fb0b96881dd1e1c2977c8cdd386bc22a39f..9b35061b93a5ef36a0046991f33fc52ce7c4f3ab 100644 (file)
@@ -16,7 +16,9 @@ class TestPanel( scrolled.ScrolledPanel ):
         scrolled.ScrolledPanel.__init__( self, parent, -1 )
         self.log = log
 
         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 )
         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 )
@@ -70,9 +72,7 @@ class TestPanel( scrolled.ScrolledPanel ):
         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 )
         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 )
 
         buttonbox.Add( buttonChange, 0, wx.ALIGN_CENTRE|wx.ALL, 5 )
         buttonbox.Add( radio_vbox, 0, wx.ALIGN_CENTRE|wx.ALL, 5 )
 
index da40ffc340aac4f57ab9052a2a72694f7546bccd..942eb877f43ccb9853db0c15345757e6db7c8116 100644 (file)
@@ -135,11 +135,11 @@ class ImageDialog(wx.Dialog):
 
         self.dir_x = self.x_pos
         self.dir_y = self.y_pos
 
         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
 
 
         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.Bind(wx.EVT_BUTTON, self.SetDirect, btn)
 
         self.type_posy = self.y_pos     # save the y position for the image type combo
@@ -148,7 +148,6 @@ class ImageDialog(wx.Dialog):
         self.GetFiles()     # get the file list
 
         self.y_pos = self.y_pos + self.delta + 10
         self.GetFiles()     # get the file list
 
         self.y_pos = self.y_pos + self.delta + 10
-
         self.list_height = 150
 
     # List of Labels
         self.list_height = 150
 
     # List of Labels
@@ -223,7 +222,8 @@ class ImageDialog(wx.Dialog):
         self.fl_list.sort()     # sort the file list
 
     def DisplayDir(self):       # display the working directory
         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
 
     def OnSetType(self, event):
         val = event.GetString()      # get file type value