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()
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):
f = open("Main.py", "r")
msg = f.read()
dlg = wxScrolledMessageDialog(frame, msg, "message test")
+ dlg.CenterOnScreen(wxBOTH)
dlg.ShowModal()
#---------------------------------------------------------------------------
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])))
#---------------------------------------------------------------------------