Ignore:
Timestamp:
Nov 28, 2011 1:35:21 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
056b569
Parents:
61f557b
Message:

remove sansview from namespace and added editor

Location:
calculatorview/src/sans/perspectives/calculator
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/src/sans/perspectives/calculator/calculator.py

    rfdc3cb0 rfb58234  
    6666                          ("SANS Resolution Estimator",  
    6767                        resolution_help, self.on_calculate_resoltuion), 
    68                 ("Python Shell", pyconsole_help, self.on_python_console)] 
     68                ("Python Shell/Editor", pyconsole_help, self.on_python_console)] 
    6969               
    7070    def on_edit_data(self, event): 
     
    133133        :param event: menu event 
    134134        """ 
     135        self.get_python_panel(filename=None) 
     136         
     137    def get_python_panel(self, filename=None): 
     138        """ 
     139        Get the python shell panel 
     140         
     141        :param filename: file name to open in editor 
     142        """ 
    135143        from pyconsole import PyConsole 
    136         frame = PyConsole(parent=self.parent) 
     144        frame = PyConsole(parent=self.parent, filename=filename) 
    137145        self.put_icon(frame) 
    138146        frame.Show(True)  
    139      
     147         
    140148    def put_icon(self, frame): 
    141149        """ 
  • calculatorview/src/sans/perspectives/calculator/pyconsole.py

    rb1bda35 rfb58234  
    22Console Module display Python console 
    33""" 
     4import sys 
    45import wx 
    5 import wx.py.crust 
    6 import sys 
    7  
     6#import wx.py.crust as crust 
     7import wx.py.editor as editor 
    88if sys.platform.count("win32")>0: 
    99    PANEL_WIDTH = 800 
     
    1515    FONT_VARIANT = 1 
    1616     
    17 class PyConsole(wx.py.crust.CrustFrame): 
     17class PyConsole(editor.EditorNotebookFrame): 
    1818    ## Internal nickname for the window, used by the AUI manager 
    19     window_name = "Python Shell" 
     19    window_name = "Python Shell/Editor" 
    2020    ## Name to appear on the window title bar 
    21     window_caption = "Python Shell" 
     21    window_caption = "Python Shell/Editor" 
    2222    ## Flag to tell the AUI manager to put this panel in the center pane 
    2323    CENTER_PANE = False 
    2424    def __init__(self, parent=None, manager=None, 
    25                     title='Python Shell',  
     25                    title='Python Shell/Editor', filename=None, 
    2626                    size=(PANEL_WIDTH, PANEL_HEIGHT)): 
    27         if parent != None: 
    28             dataDir = parent._default_save_location 
    29         else: 
    30              dataDir = None 
    31         wx.py.crust.CrustFrame.__init__(self, parent=parent,  
     27        #if parent != None: 
     28        #    dataDir = parent._default_save_location 
     29        #else: 
     30        #     dataDir = None 
     31        #wx.py.crust.CrustFrame.__init__(self, parent=parent,  
     32        #                                title=title, size=size, 
     33        #                                dataDir=dataDir) 
     34        self.config = None 
     35        editor.EditorNotebookFrame.__init__(self, parent=parent,  
    3236                                        title=title, size=size, 
    33                                         dataDir=dataDir) 
     37                                        filename=filename) 
    3438        self._import_site() 
    3539        self.parent = parent 
     
    5761                           wx.OK|wx.ICON_INFORMATION)   
    5862        dial.ShowModal() 
    59          
     63              
    6064ABOUT =  "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" 
     65ABOUT += "This uses Py Shell in wx (developed by Patrick K. O'Brien).\n" 
    6266ABOUT += "If this is your first time using Python, \n" 
    6367ABOUT += "you should definitely check out the tutorial " 
Note: See TracChangeset for help on using the changeset viewer.