From: Robin Dunn Date: Wed, 14 Nov 2001 18:43:55 +0000 (+0000) Subject: A bit of cleanup and etc. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/80f7e6500b3d8418d5a3305a8a4e2de4373717a7 A bit of cleanup and etc. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/demo/wxMultipleChoiceDialog.py b/wxPython/demo/wxMultipleChoiceDialog.py index 07fe583a3e..6e3fb5de55 100644 --- a/wxPython/demo/wxMultipleChoiceDialog.py +++ b/wxPython/demo/wxMultipleChoiceDialog.py @@ -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() diff --git a/wxPython/demo/wxPopupWindow.py b/wxPython/demo/wxPopupWindow.py index 84d0199ba4..c4d163e9ff 100644 --- a/wxPython/demo/wxPopupWindow.py +++ b/wxPython/demo/wxPopupWindow.py @@ -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() diff --git a/wxPython/demo/wxScrolledMessageDialog.py b/wxPython/demo/wxScrolledMessageDialog.py index 210e0e16a9..e50d1e7c9e 100644 --- a/wxPython/demo/wxScrolledMessageDialog.py +++ b/wxPython/demo/wxScrolledMessageDialog.py @@ -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() #--------------------------------------------------------------------------- diff --git a/wxPython/wxPython/lib/dialogs.py b/wxPython/wxPython/lib/dialogs.py index 6c82207f05..dd600ddd27 100644 --- a/wxPython/wxPython/lib/dialogs.py +++ b/wxPython/wxPython/lib/dialogs.py @@ -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'):