Changes in src/sas/sasgui/perspectives/calculator/pyconsole.py [7673ecd:f1cbae7] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/calculator/pyconsole.py
r7673ecd rf1cbae7 9 9 import wx 10 10 from wx.lib.dialogs import ScrolledMessageDialog 11 from wx.lib import layoutf 12 11 13 import wx.py.editor as editor 12 14 … … 63 65 title, icon = "Info", wx.ICON_INFORMATION 64 66 text = "\n".join(parts) 65 dlg = ScrolledMessageDialog(parent, text, title, size=((550, 250)))67 dlg = ResizableScrolledMessageDialog(parent, text, title, size=((550, 250))) 66 68 fnt = wx.Font(10, wx.TELETYPE, wx.NORMAL, wx.NORMAL) 67 69 dlg.GetChildren()[0].SetFont(fnt) … … 70 72 dlg.Destroy() 71 73 return errmsg is None 74 75 class ResizableScrolledMessageDialog(wx.Dialog): 76 """ 77 Custom version of wx ScrolledMessageDialog, allowing border resize 78 """ 79 def __init__(self, parent, msg, caption, 80 pos=wx.DefaultPosition, size=(500,300), 81 style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER ): 82 # Notice, that style can be overrriden in the caller. 83 wx.Dialog.__init__(self, parent, -1, caption, pos, size, style) 84 x, y = pos 85 if x == -1 and y == -1: 86 self.CenterOnScreen(wx.BOTH) 87 88 text = wx.TextCtrl(self, -1, msg, style=wx.TE_MULTILINE | wx.TE_READONLY) 89 ok = wx.Button(self, wx.ID_OK, "OK") 90 91 # Mysterious constraint layouts from 92 # https://www.wxpython.org/docs/api/wx.lib.layoutf.Layoutf-class.html 93 lc = layoutf.Layoutf('t=t5#1;b=t5#2;l=l5#1;r=r5#1', (self,ok)) 94 text.SetConstraints(lc) 95 lc = layoutf.Layoutf('b=b5#1;x%w50#1;w!80;h!25', (self,)) 96 ok.SetConstraints(lc) 97 98 self.SetAutoLayout(1) 99 self.Layout() 72 100 73 101 class PyConsole(editor.EditorNotebookFrame):
Note: See TracChangeset
for help on using the changeset viewer.