Changeset f1cbae7 in sasview for src/sas/sasgui/perspectives/calculator/pyconsole.py
- Timestamp:
- Oct 6, 2016 1:54:59 PM (8 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 578a11d
- Parents:
- b2a3814
- git-author:
- Piotr Rozyczko <rozyczko@…> (10/06/16 13:54:00)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (10/06/16 13:54:59)
- 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.