+# ScrolledMessageDialog - modified from wxPython lib to set fixed-width font
+class ScrolledMessageDialog(wxDialog):
+ def __init__(self, parent, msg, caption, pos = wxDefaultPosition, size = (500,300)):
+ from wxPython.lib.layoutf import Layoutf
+ wxDialog.__init__(self, parent, -1, caption, pos, size)
+ text = wxTextCtrl(self, -1, msg, wxDefaultPosition,
+ wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY)
+ text.SetFont(modernFont)
+ dc = wxWindowDC(text)
+ w, h = dc.GetTextExtent(' ')
+ ok = wxButton(self, wxID_OK, "OK")
+ text.SetConstraints(Layoutf('t=t5#1;b=t5#2;l=l5#1;r=r5#1', (self,ok)))
+ text.SetSize((w * 80 + 30, h * 40))
+ ok.SetConstraints(Layoutf('b=b5#1;x%w50#1;w!80;h!25', (self,)))
+ self.SetAutoLayout(TRUE)
+ self.Fit()
+ self.CenterOnScreen(wxBOTH)
+
+################################################################################
+