git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12422
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
dlg = wxMultipleChoiceDialog(frame,
"Pick some from\n this list\nblah blah...",
"m.s.d.", lst)
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()
if (dlg.ShowModal() == wxID_OK):
print "Selection:", dlg.GetValue(), " -> ", dlg.GetValueString()
def OnMouseLeftDown(self, evt):
self.ldPos = evt.GetEventObject().ClientToScreen(evt.GetPosition())
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()
self.wPos = self.GetPosition()
self.CaptureMouse()
f = open("Main.py", "r")
msg = f.read()
dlg = wxScrolledMessageDialog(frame, msg, "message test")
f = open("Main.py", "r")
msg = f.read()
dlg = wxScrolledMessageDialog(frame, msg, "message test")
- dlg.CenterOnScreen(wxBOTH)
dlg.ShowModal()
#---------------------------------------------------------------------------
dlg.ShowModal()
#---------------------------------------------------------------------------
class wxScrolledMessageDialog(wxDialog):
class wxScrolledMessageDialog(wxDialog):
def __init__(self, parent, msg, caption, pos = wxDefaultPosition, size = (500,300)):
wxDialog.__init__(self, parent, -1, caption, pos, size)
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)
text = wxTextCtrl(self, -1, msg, wxDefaultPosition,
wxDefaultSize,
wxTE_MULTILINE | wxTE_READONLY)
class wxMultipleChoiceDialog(wxDialog):
class wxMultipleChoiceDialog(wxDialog):
def __init__(self, parent, msg, title, lst, pos = wxDefaultPosition, size = (200,200)):
wxDialog.__init__(self, parent, -1, title, pos, size)
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'):
dc = wxClientDC(self)
height = 0
for line in string.split(msg,'\n'):