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 c26a64b was
75df58b,
checked in by Gervaise Alina <gervyh@…>, 14 years ago
|
working on loading for prview
|
-
Property mode set to
100644
|
File size:
1.9 KB
|
Line | |
---|
1 | import wx |
---|
2 | #import gui_manager |
---|
3 | from sans.guiframe import gui_manager |
---|
4 | |
---|
5 | # For py2exe, import config here |
---|
6 | import local_config |
---|
7 | import sys |
---|
8 | |
---|
9 | |
---|
10 | # Application dimensions |
---|
11 | APP_HEIGHT = 780 |
---|
12 | APP_WIDTH = 850 |
---|
13 | |
---|
14 | class PrFrame(gui_manager.ViewerFrame): |
---|
15 | """ |
---|
16 | """ |
---|
17 | def _on_open(self, event): |
---|
18 | """ |
---|
19 | """ |
---|
20 | pass |
---|
21 | |
---|
22 | |
---|
23 | class PrApp(gui_manager.ViewApp): |
---|
24 | """ |
---|
25 | """ |
---|
26 | def OnInit(self): |
---|
27 | """ |
---|
28 | """ |
---|
29 | # Check the size of the screen |
---|
30 | # Add some padding to make sure to clear any OS tool bar |
---|
31 | screen_size = wx.GetDisplaySize() |
---|
32 | app_height = APP_HEIGHT if screen_size[1]>APP_HEIGHT else screen_size[1]-50 |
---|
33 | app_width = APP_WIDTH if screen_size[0]>APP_WIDTH else screen_size[0]-50 |
---|
34 | |
---|
35 | self.frame = PrFrame(None, -1, local_config.__appname__, |
---|
36 | window_height=app_height, window_width=app_width) |
---|
37 | self.frame.Show(True) |
---|
38 | |
---|
39 | if hasattr(self.frame, 'special'): |
---|
40 | self.frame.special.SetCurrent() |
---|
41 | self.SetTopWindow(self.frame) |
---|
42 | return True |
---|
43 | |
---|
44 | class SansView(): |
---|
45 | """ |
---|
46 | """ |
---|
47 | def __init__(self): |
---|
48 | """ |
---|
49 | """ |
---|
50 | #from gui_manager import ViewApp |
---|
51 | #self.gui = gui_manager.ViewApp(0) |
---|
52 | self.gui = PrApp(0) |
---|
53 | |
---|
54 | # Add perspectives to the basic application |
---|
55 | # Additional perspectives can still be loaded |
---|
56 | # dynamically |
---|
57 | import perspectives.pr as module |
---|
58 | self.pr_plug = module.Plugin(standalone=True) |
---|
59 | self.gui.add_perspective(self.pr_plug) |
---|
60 | |
---|
61 | # Build the GUI |
---|
62 | self.gui.build_gui() |
---|
63 | |
---|
64 | # Set the application manager for the GUI |
---|
65 | self.gui.set_manager(self) |
---|
66 | |
---|
67 | # Start the main loop |
---|
68 | self.gui.MainLoop() |
---|
69 | |
---|
70 | |
---|
71 | if __name__ == "__main__": |
---|
72 | sansview = SansView() |
---|
Note: See
TracBrowser
for help on using the repository browser.