]> git.saurik.com Git - wxWidgets.git/commitdiff
some demo cleanup
authorRobin Dunn <robin@alldunn.com>
Wed, 14 Nov 2001 04:01:42 +0000 (04:01 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 14 Nov 2001 04:01:42 +0000 (04:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/wxMultipleChoiceDialog.py
wxPython/demo/wxPopupWindow.py
wxPython/demo/wxScrolledMessageDialog.py
wxPython/demo/wxTextCtrl.py

index 6e3fb5de55e8d0b98f2b9482e56dfc2ec8852f43..07fe583a3e476d8cfb30125ccef4704c91b32f21 100644 (file)
@@ -10,6 +10,7 @@ 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 d8c3320966276a1a5cf6b280afa11fbf5185d07f..84d0199ba46fdf533b7820a0eac1b2b113087562 100644 (file)
@@ -34,10 +34,10 @@ 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()
+##         if wxPlatform == "__WXMSW__":   # this is weird...
+##             self.wPos = self.GetParent().ClientToScreen(self.GetPosition())
+##         else:
+        self.wPos = self.GetPosition()
         self.CaptureMouse()
 
     def OnMouseMotion(self, evt):
index e50d1e7c9e247795507f9c6e3cfb07bd99f2cb93..210e0e16a9e96ca88bdf71b0ea8e26b1b5bbd8f7 100644 (file)
@@ -8,6 +8,7 @@ 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 dc6ee5f79a1d5073b70bdf8ff6fa052152d902d1..56098d2023f6b63e0f7694954f0eaf80d0ad5cdb 100644 (file)
@@ -90,11 +90,14 @@ class TestPanel(wxPanel):
     def OnTestGetSelection(self, evt):
         start, end = self.tc.GetSelection()
         text = self.tc.GetValue()
-        # Looks like a bug here, but only if not wxTE_RICH...
-        if wxPlatform == "__WXMSW__":
+        if wxPlatform == "__WXMSW__":  # This is why GetStringSelection was added
             text = string.replace(text, '\n', '\r\n')
-        self.log.write("GetSelection(): (%d, %d)\n\tSelectedText: %s\n" %
-                       (start, end, repr(text[start:end])))
+        self.log.write("GetSelection(): (%d, %d)\n"
+                       "\tGetStringSelection(): %s\n"
+                       "\tSelectedText: %s\n" %
+                       (start, end,
+                        self.tc.GetStringSelection(),
+                        repr(text[start:end])))
 
 
 #---------------------------------------------------------------------------