]> git.saurik.com Git - wxWidgets.git/commitdiff
A bit of cleanup and etc.
authorRobin Dunn <robin@alldunn.com>
Wed, 14 Nov 2001 18:43:55 +0000 (18:43 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 14 Nov 2001 18:43:55 +0000 (18:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/wxMultipleChoiceDialog.py
wxPython/demo/wxPopupWindow.py
wxPython/demo/wxScrolledMessageDialog.py
wxPython/wxPython/lib/dialogs.py

index 07fe583a3e476d8cfb30125ccef4704c91b32f21..6e3fb5de55e8d0b98f2b9482e56dfc2ec8852f43 100644 (file)
@@ -10,7 +10,6 @@ def runTest(frame, nb, log):
     dlg = wxMultipleChoiceDialog(frame,
                                  "Pick some from\n this list\nblah blah...",
                                  "m.s.d.", lst)
-    dlg.CenterOnScreen(wxBOTH)
     if (dlg.ShowModal() == wxID_OK):
         print "Selection:", dlg.GetValue(), " -> ", dlg.GetValueString()
 
index 84d0199ba46fdf533b7820a0eac1b2b113087562..c4d163e9ffefbec6915bb2b64e807ee85483442f 100644 (file)
@@ -34,9 +34,6 @@ class TestPopup(wxPopupWindow):
 
     def OnMouseLeftDown(self, evt):
         self.ldPos = evt.GetEventObject().ClientToScreen(evt.GetPosition())
-##         if wxPlatform == "__WXMSW__":   # this is weird...
-##             self.wPos = self.GetParent().ClientToScreen(self.GetPosition())
-##         else:
         self.wPos = self.GetPosition()
         self.CaptureMouse()
 
index 210e0e16a9e96ca88bdf71b0ea8e26b1b5bbd8f7..e50d1e7c9e247795507f9c6e3cfb07bd99f2cb93 100644 (file)
@@ -8,7 +8,6 @@ def runTest(frame, nb, log):
     f = open("Main.py", "r")
     msg = f.read()
     dlg = wxScrolledMessageDialog(frame, msg, "message test")
-    dlg.CenterOnScreen(wxBOTH)
     dlg.ShowModal()
 
 #---------------------------------------------------------------------------
index 6c82207f0522641e1213f3076e0c00cab52ddd99..dd600ddd27406336d63bdead5848033230e39458 100644 (file)
@@ -5,9 +5,11 @@ import string
 
 
 class wxScrolledMessageDialog(wxDialog):
-
     def __init__(self, parent, msg, caption, pos = wxDefaultPosition, size = (500,300)):
         wxDialog.__init__(self, parent, -1, caption, pos, size)
+        x, y = pos
+        if x == -1 and y == -1:
+            self.CenterOnScreen(wxBOTH)
         text = wxTextCtrl(self, -1, msg, wxDefaultPosition,
                              wxDefaultSize,
                              wxTE_MULTILINE | wxTE_READONLY)
@@ -19,9 +21,11 @@ class wxScrolledMessageDialog(wxDialog):
 
 
 class wxMultipleChoiceDialog(wxDialog):
-
     def __init__(self, parent, msg, title, lst, pos = wxDefaultPosition, size = (200,200)):
         wxDialog.__init__(self, parent, -1, title, pos, size)
+        x, y = pos
+        if x == -1 and y == -1:
+            self.CenterOnScreen(wxBOTH)
         dc = wxClientDC(self)
         height = 0
         for line in string.split(msg,'\n'):