Changeset fb0d7a20 in sasview for calculatorview/perspectives


Ignore:
Timestamp:
Feb 17, 2010 11:44:30 AM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
25f766a
Parents:
420cbdd
Message:

removing calculatorview as a perspective

Location:
calculatorview/perspectives/calculator
Files:
2 edited

Legend:

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

    r427fa87 rfb0d7a20  
    5858         
    5959        # If needed, add its name to the perspective list 
    60         self.perspective.append(self.sld_panel.window_name) 
     60        #self.perspective.append(self.sld_panel.window_name) 
    6161 
    6262        # Return the list of panels 
    6363        return [self.sld_panel] 
     64        
    6465     
    6566    def help(self, evt): 
     
    6768            Show a general help dialog.  
    6869            TODO: replace the text with a nice image 
    69         """ 
    70          
    71         """ 
    7270            provide more hint on the SLD calculator 
    7371        """ 
    7472        from help_panel import  HelpWindow 
    75         frame = HelpWindow(None, -1, pageToOpen="doc/sld_calculator_help.html")     
     73        frame = HelpWindow(None, -1)     
    7674        frame.Show(True) 
    77         name = "SLD_calculator" 
    78         if frame.rhelp.HasAnchor(name): 
    79             frame.rhelp.ScrollToAnchor(name) 
    80         else: 
    81            msg= "Cannot find SLD Calculator description " 
    82            msg +="Please.Search in the Help window" 
    83            wx.PostEvent(self.parent, StatusEvent(status = msg ))  
    84          
     75       
    8576    def get_context_menu(self, graph=None): 
    8677        """ 
     
    110101        """ 
    111102        return self.perspective 
     103         
    112104     
     105    def get_tools(self): 
     106        """ 
     107            Returns a set of menu entries for tools 
     108        """ 
     109        id = wx.NewId() 
     110        sld_help = "Provides computation related to Scattering Length density" 
     111        return [("SLD Calculator", sld_help, self.on_calculate_sld)] 
     112               
     113    def on_calculate_sld(self, event): 
     114        """ 
     115            Compute the scattering length density of molecula 
     116        """ 
     117        from sld_panel import SldWindow 
     118        frame = SldWindow(base=self.parent) 
     119        frame.Show(True)  
     120       
     121         
    113122    def on_perspective(self, event): 
    114123        """ 
     
    119128        """ 
    120129        self.parent.set_perspective(self.perspective) 
     130        
    121131     
    122132    def post_init(self): 
     
    125135        """ 
    126136        pass 
     137     
     138   
     139     
  • calculatorview/perspectives/calculator/help_panel.py

    r427fa87 rfb0d7a20  
    100100                                     size=(500,-1)) 
    101101        path = os.getcwd() 
    102         path= os.path.join(os.path.split(path)[0],"calculatorview", 
     102        self.path= os.path.join(os.path.split(path)[0],"calculatorview", 
    103103                            "doc","sld_calculator_help.html") 
    104104        
    105         page1="""<html> 
    106             <body> 
    107              <p>Select topic on Menu</p> 
    108             </body> 
    109             </html>""" 
     105        self.rhelp.LoadPage(self.path) 
    110106        page="""<html> 
    111107            <body> 
     
    114110            </ul> 
    115111            </body> 
    116             </html>"""%path 
    117         self.rhelp.SetPage(page1) 
     112            </html>"""%self.path 
     113         
    118114        self.lhelp.SetPage(page) 
    119115        self.lhelp.Bind(wx.html.EVT_HTML_LINK_CLICKED,self.OnLinkClicked ) 
    120116         
    121         #open the help frame a the current page 
    122         if  pageToOpen!= None: 
    123             self.rhelp.LoadPage(str( pageToOpen)) 
    124              
    125117        vbox.Add(self.rhelp,1, wx.EXPAND) 
    126118        vboxl.Add(self.lhelp, 1, wx.EXPAND) 
     
    143135            Function to diplay html page related to the hyperlinktext selected 
    144136        """ 
    145         link= event.GetLinkInfo().GetHref() 
    146         self.rhelp.LoadPage(link) 
     137        self.rhelp.LoadPage(self.path) 
    147138 
    148139class ViewApp(wx.App): 
Note: See TracChangeset for help on using the changeset viewer.