X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/34a544a635f3bac9320e6eb41aaaa5a5e8d1f5a4..628eae0bcd7916c57847b7eab739d4cc32534ccf:/wxPython/demo/Dialog.py?ds=sidebyside diff --git a/wxPython/demo/Dialog.py b/wxPython/demo/Dialog.py index e9dc898a76..756c730020 100644 --- a/wxPython/demo/Dialog.py +++ b/wxPython/demo/Dialog.py @@ -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) #---------------------------------------------------------------------------