ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change
on this file since 91f151a was
91f151a,
checked in by Gervaise Alina <gervyh@…>, 14 years ago
|
working on data editor
|
-
Property mode set to
100644
|
File size:
1.7 KB
|
Line | |
---|
1 | import wx |
---|
2 | CONSOLE_WIDTH = 340 |
---|
3 | CONSOLE_HEIGHT = 240 |
---|
4 | |
---|
5 | import wx |
---|
6 | import sys |
---|
7 | from DataLoader.loader import Loader |
---|
8 | |
---|
9 | _BOX_WIDTH = 60 |
---|
10 | |
---|
11 | if sys.platform.count("win32")>0: |
---|
12 | _STATICBOX_WIDTH = 450 |
---|
13 | PANEL_WIDTH = 500 |
---|
14 | PANEL_HEIGHT = 550 |
---|
15 | FONT_VARIANT = 0 |
---|
16 | else: |
---|
17 | _STATICBOX_WIDTH = 480 |
---|
18 | PANEL_WIDTH = 530 |
---|
19 | PANEL_HEIGHT = 560 |
---|
20 | FONT_VARIANT = 1 |
---|
21 | |
---|
22 | |
---|
23 | class ConsoleDialog(wx.Dialog): |
---|
24 | def __init__(self, parent=None, id=-1, manager=None, data=None, |
---|
25 | title="Data Summary",size=(PANEL_WIDTH, PANEL_HEIGHT)): |
---|
26 | wx.Dialog.__init__(self, parent=parent, id=id, title=title, size=size) |
---|
27 | |
---|
28 | self.parent = parent |
---|
29 | self._manager = manager |
---|
30 | self._data = data |
---|
31 | self.sizer = wx.BoxSizer(wx.VERTICAL) |
---|
32 | self.msg_txt = wx.TextCtrl(self, size=(PANEL_WIDTH-40, |
---|
33 | PANEL_HEIGHT-60), |
---|
34 | style=wx.TE_MULTILINE) |
---|
35 | self.msg_txt.SetEditable(False) |
---|
36 | self.msg_txt.SetValue('No message available') |
---|
37 | self.sizer.Add(self.msg_txt, 1, wx.EXPAND|wx.ALL, 10) |
---|
38 | if self._data is not None: |
---|
39 | self.set_message(msg=self._data.__str__()) |
---|
40 | |
---|
41 | self.SetSizer(self.sizer) |
---|
42 | |
---|
43 | def set_manager(self, manager): |
---|
44 | """ |
---|
45 | """ |
---|
46 | self._manager = manager |
---|
47 | |
---|
48 | def set_message(self, msg=""): |
---|
49 | """ |
---|
50 | """ |
---|
51 | self.msg_txt.SetValue(str(msg)) |
---|
52 | |
---|
53 | if __name__ =="__main__": |
---|
54 | |
---|
55 | app = wx.App() |
---|
56 | # Instantiate a loader |
---|
57 | loader = Loader() |
---|
58 | # Load data |
---|
59 | data = loader.load("MAR07232_rest.ASC") |
---|
60 | dlg = ConsoleDialog(data=data) |
---|
61 | dlg.ShowModal() |
---|
62 | app.MainLoop() |
---|
Note: See
TracBrowser
for help on using the repository browser.