]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/ScrolledPanel.py
fixed compile error
[wxWidgets.git] / wxPython / demo / ScrolledPanel.py
index a22c3dc9f2c6997904fd5a01849d34a82e3ac906..e5226cf72895e94efc5a2461c79254e8d7094a1d 100644 (file)
@@ -28,24 +28,32 @@ class TestPanel(scrolled.ScrolledPanel):
 
         words = text.split()
 
-        panel1 = scrolled.ScrolledPanel(self, -1, size=(120,300),
-                                 style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER )
+        panel1 = scrolled.ScrolledPanel(self, -1, size=(140, 300),
+                                 style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER, name="panel1" )
         fgs1 = wx.FlexGridSizer(cols=2, vgap=4, hgap=4)
 
         for word in words:
             label = wx.StaticText(panel1, -1, word+":")
+
+            # A test for scrolling with a too big control
+            #if word == "three":
+            #    tc = wx.TextCtrl(panel1, -1, word, size=(150,-1))
+            #else:
+            #    tc = wx.TextCtrl(panel1, -1, word, size=(50,-1))
+
             tc = wx.TextCtrl(panel1, -1, word, size=(50,-1))
-            fgs1.Add(label, flag=wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL)
-            fgs1.Add(tc, flag=wx.EXPAND|wx.RIGHT, border=25)
+
+            fgs1.Add(label, flag=wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.LEFT, border=10)
+            fgs1.Add(tc, flag=wx.RIGHT, border=10)
 
         panel1.SetSizer( fgs1 )
         panel1.SetAutoLayout(1)
-        panel1.SetupScrolling( scroll_x=False )
+        panel1.SetupScrolling()
 
-        panel2 = scrolled.ScrolledPanel(self, -1, size=(350, 40),
-                                 style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER)
+        panel2 = scrolled.ScrolledPanel(self, -1, size=(350, 50),
+                                 style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER, name="panel2")
         panel3 = scrolled.ScrolledPanel(self, -1, size=(200,100),
-                                 style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER)
+                                 style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER, name="panel3")
 
         fgs2 = wx.FlexGridSizer(cols=25, vgap=4, hgap=4)
         fgs3 = wx.FlexGridSizer(cols=5, vgap=4, hgap=4)
@@ -73,14 +81,14 @@ class TestPanel(scrolled.ScrolledPanel):
 
         hbox = wx.BoxSizer(wx.HORIZONTAL)
         hbox.Add((20,20))
-        hbox.Add(panel1, 0)
+        hbox.Add(panel1, 0, wx.FIXED_MINSIZE)
         hbox.Add((40, 10))
 
         vbox2 = wx.BoxSizer(wx.VERTICAL)
-        vbox2.Add(panel2, 0)
+        vbox2.Add(panel2, 0, wx.FIXED_MINSIZE)
         vbox2.Add((20, 50))
 
-        vbox2.Add(panel3, 0)
+        vbox2.Add(panel3, 0, wx.FIXED_MINSIZE)
         vbox2.Add((20, 10))
         hbox.Add(vbox2)