]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/Dialog.py
'[1219035] cleanup: miscellaneous' and minor source cleaning.
[wxWidgets.git] / wxPython / demo / Dialog.py
index e9dc898a7608f553c856985d8d1754e2e49cfcaa..756c730020962e07cd6cd742e535d277fb8c4b4f 100644 (file)
@@ -63,25 +63,25 @@ class TestDialog(wx.Dialog):
         line = wx.StaticLine(self, -1, size=(20,-1), style=wx.LI_HORIZONTAL)
         sizer.Add(line, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.RIGHT|wx.TOP, 5)
 
-        box = wx.BoxSizer(wx.HORIZONTAL)
-
+        btnsizer = wx.StdDialogButtonSizer()
+        
         if wx.Platform != "__WXMSW__":
             btn = wx.ContextHelpButton(self)
-            box.Add(btn, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
-
-        btn = wx.Button(self, wx.ID_OK, " OK ")
-        btn.SetDefault()
+            btnsizer.AddButton(btn)
+        
+        btn = wx.Button(self, wx.ID_OK)
         btn.SetHelpText("The OK button completes the dialog")
-        box.Add(btn, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
+        btn.SetDefault()
+        btnsizer.AddButton(btn)
 
-        btn = wx.Button(self, wx.ID_CANCEL, " Cancel ")
+        btn = wx.Button(self, wx.ID_CANCEL)
         btn.SetHelpText("The Cancel button cnacels the dialog. (Cool, huh?)")
-        box.Add(btn, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
+        btnsizer.AddButton(btn)
+        btnsizer.Realize()
 
-        sizer.Add(box, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
+        sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
 
         self.SetSizer(sizer)
-        self.SetAutoLayout(True)
         sizer.Fit(self)
 
 #---------------------------------------------------------------------------