Changeset 056b569 in sasview for fittingview/src/sans/perspectives


Ignore:
Timestamp:
Nov 28, 2011 1:48:38 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:
a1968c4
Parents:
fb58234
Message:

adde custom model editor

Location:
fittingview/src/sans/perspectives/fitting
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • fittingview/src/sans/perspectives/fitting/fitting.py

    rfa02d95 r056b569  
    1414import re 
    1515import sys 
     16import os 
    1617import wx 
    1718import logging 
     
    216217        chain_menu.Check(not self.batch_reset_flag) 
    217218        chain_menu.Enable(self.batch_on) 
     219         
     220        self.menu1.AppendSeparator() 
     221        self.id_editmodel = wx.NewId() 
     222        editmodel_help = "Edit cusomized model sample file"  
     223        self.menu1.Append(self.id_editmodel, "Edit Custom Model",  
     224                                   editmodel_help)  
     225        wx.EVT_MENU(owner, self.id_editmodel,  self.edit_custom_model) 
     226         
    218227        #create  menubar items 
    219228        return [(self.menu1, self.sub_menu)] 
    220              
    221     
     229     
     230    def edit_custom_model(self, event): 
     231        """ 
     232        Get the python editor panel 
     233        """ 
     234        from editmodel import PyConsole 
     235        filename = os.path.join("plugins", "testmodel.py") 
     236        frame = PyConsole(parent=self.parent, filename=filename) 
     237        self.put_icon(frame) 
     238        frame.Show(True)  
     239         
     240    def put_icon(self, frame): 
     241        """ 
     242        Put icon in the frame title bar 
     243        """ 
     244        if hasattr(frame, "IsIconized"): 
     245            if not frame.IsIconized(): 
     246                try: 
     247                    icon = self.parent.GetIcon() 
     248                    frame.SetIcon(icon) 
     249                except: 
     250                    pass       
     251                      
    222252    def on_add_sim_page(self, event): 
    223253        """ 
Note: See TracChangeset for help on using the changeset viewer.