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 f82d256 was
b1bda35,
checked in by Jae Cho <jhjcho@…>, 13 years ago
|
little fix in comments
|
-
Property mode set to
100644
|
File size:
2.1 KB
|
Rev | Line | |
---|
[ec6c520] | 1 | """ |
---|
| 2 | Console Module display Python console |
---|
| 3 | """ |
---|
[861f8317] | 4 | import wx |
---|
[ec6c520] | 5 | import wx.py.crust |
---|
| 6 | import sys |
---|
| 7 | |
---|
| 8 | if sys.platform.count("win32")>0: |
---|
| 9 | PANEL_WIDTH = 800 |
---|
| 10 | PANEL_HEIGHT = 600 |
---|
| 11 | FONT_VARIANT = 0 |
---|
| 12 | else: |
---|
| 13 | PANEL_WIDTH = 830 |
---|
| 14 | PANEL_HEIGHT = 620 |
---|
| 15 | FONT_VARIANT = 1 |
---|
| 16 | |
---|
| 17 | class PyConsole(wx.py.crust.CrustFrame): |
---|
| 18 | ## Internal nickname for the window, used by the AUI manager |
---|
[b1bda35] | 19 | window_name = "Python Shell" |
---|
[ec6c520] | 20 | ## Name to appear on the window title bar |
---|
[b1bda35] | 21 | window_caption = "Python Shell" |
---|
[ec6c520] | 22 | ## Flag to tell the AUI manager to put this panel in the center pane |
---|
| 23 | CENTER_PANE = False |
---|
| 24 | def __init__(self, parent=None, manager=None, |
---|
[b1bda35] | 25 | title='Python Shell', |
---|
[ec6c520] | 26 | size=(PANEL_WIDTH, PANEL_HEIGHT)): |
---|
| 27 | if parent != None: |
---|
| 28 | dataDir = parent._default_save_location |
---|
[b1bda35] | 29 | else: |
---|
| 30 | dataDir = None |
---|
[ec6c520] | 31 | wx.py.crust.CrustFrame.__init__(self, parent=parent, |
---|
| 32 | title=title, size=size, |
---|
| 33 | dataDir=dataDir) |
---|
[861f8317] | 34 | self._import_site() |
---|
[ec6c520] | 35 | self.parent = parent |
---|
| 36 | self._manager = manager |
---|
| 37 | self.Centre() |
---|
| 38 | |
---|
[861f8317] | 39 | def _import_site(self): |
---|
| 40 | """ |
---|
| 41 | Import site for exe |
---|
| 42 | """ |
---|
| 43 | import site |
---|
| 44 | |
---|
[ec6c520] | 45 | def set_manager(self, manager): |
---|
| 46 | """ |
---|
| 47 | Set the manager of this window |
---|
| 48 | """ |
---|
| 49 | self._manager = manager |
---|
[861f8317] | 50 | |
---|
| 51 | def OnAbout(self, event): |
---|
| 52 | """ |
---|
| 53 | On About |
---|
| 54 | """ |
---|
| 55 | message = ABOUT |
---|
[b1bda35] | 56 | dial = wx.MessageDialog(self, message, 'About', |
---|
[861f8317] | 57 | wx.OK|wx.ICON_INFORMATION) |
---|
| 58 | dial.ShowModal() |
---|
| 59 | |
---|
[b1bda35] | 60 | ABOUT = "Welcome to Python %s! \n\n"% sys.version.split()[0] |
---|
| 61 | ABOUT += "This uses PyCrust Shell in wx (developed by Patrick K. O'Brien).\n" |
---|
[861f8317] | 62 | ABOUT += "If this is your first time using Python, \n" |
---|
| 63 | ABOUT += "you should definitely check out the tutorial " |
---|
| 64 | ABOUT += "on the Internet at http://www.python.org/doc/tut/." |
---|
[ec6c520] | 65 | |
---|
[861f8317] | 66 | |
---|
[ec6c520] | 67 | if __name__ == "__main__": |
---|
| 68 | |
---|
| 69 | app = wx.App() |
---|
| 70 | dlg = PyConsole() |
---|
| 71 | dlg.Show() |
---|
| 72 | app.MainLoop() |
---|
Note: See
TracBrowser
for help on using the repository browser.