some demo cleanup

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-11-14 04:01:42 +00:00
parent eef97940e8
commit f0db4f3850
4 changed files with 13 additions and 8 deletions

View File

@@ -10,6 +10,7 @@ def runTest(frame, nb, log):
dlg = wxMultipleChoiceDialog(frame, dlg = wxMultipleChoiceDialog(frame,
"Pick some from\n this list\nblah blah...", "Pick some from\n this list\nblah blah...",
"m.s.d.", lst) "m.s.d.", lst)
dlg.CenterOnScreen(wxBOTH)
if (dlg.ShowModal() == wxID_OK): if (dlg.ShowModal() == wxID_OK):
print "Selection:", dlg.GetValue(), " -> ", dlg.GetValueString() print "Selection:", dlg.GetValue(), " -> ", dlg.GetValueString()

View File

@@ -34,10 +34,10 @@ class TestPopup(wxPopupWindow):
def OnMouseLeftDown(self, evt): def OnMouseLeftDown(self, evt):
self.ldPos = evt.GetEventObject().ClientToScreen(evt.GetPosition()) self.ldPos = evt.GetEventObject().ClientToScreen(evt.GetPosition())
if wxPlatform == "__WXMSW__": # this is weird... ## if wxPlatform == "__WXMSW__": # this is weird...
self.wPos = self.GetParent().ClientToScreen(self.GetPosition()) ## self.wPos = self.GetParent().ClientToScreen(self.GetPosition())
else: ## else:
self.wPos = self.GetPosition() self.wPos = self.GetPosition()
self.CaptureMouse() self.CaptureMouse()
def OnMouseMotion(self, evt): def OnMouseMotion(self, evt):

View File

@@ -8,6 +8,7 @@ def runTest(frame, nb, log):
f = open("Main.py", "r") f = open("Main.py", "r")
msg = f.read() msg = f.read()
dlg = wxScrolledMessageDialog(frame, msg, "message test") dlg = wxScrolledMessageDialog(frame, msg, "message test")
dlg.CenterOnScreen(wxBOTH)
dlg.ShowModal() dlg.ShowModal()
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------

View File

@@ -90,11 +90,14 @@ class TestPanel(wxPanel):
def OnTestGetSelection(self, evt): def OnTestGetSelection(self, evt):
start, end = self.tc.GetSelection() start, end = self.tc.GetSelection()
text = self.tc.GetValue() text = self.tc.GetValue()
# Looks like a bug here, but only if not wxTE_RICH... if wxPlatform == "__WXMSW__": # This is why GetStringSelection was added
if wxPlatform == "__WXMSW__":
text = string.replace(text, '\n', '\r\n') text = string.replace(text, '\n', '\r\n')
self.log.write("GetSelection(): (%d, %d)\n\tSelectedText: %s\n" % self.log.write("GetSelection(): (%d, %d)\n"
(start, end, repr(text[start:end]))) "\tGetStringSelection(): %s\n"
"\tSelectedText: %s\n" %
(start, end,
self.tc.GetStringSelection(),
repr(text[start:end])))
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------