Changeset fc8f132 in sasview for src/sas/perspectives


Ignore:
Timestamp:
Mar 1, 2015 12:38:10 AM (10 years ago)
Author:
butler
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:
de69095
Parents:
c558b47
Message:

Add Help button to SLD panel and change default placement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/perspectives/calculator/sld_panel.py

    r79492222 rfc8f132  
    2121from periodictable.nsf import neutron_scattering 
    2222from sas.perspectives.calculator import calculator_widgets as widget    
     23from sas.guiframe.documentation_window import DocumentationWindow 
    2324        
    2425WAVELENGTH = 6.0 
     
    284285        self.Bind(wx.EVT_BUTTON, self.calculateSld, id=id)    
    285286         
    286         sizer_button.Add((250, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     287        self.button_help = wx.Button(self, id, "HELP") 
     288        self.button_help.SetToolTipString("help on SLD calculator.") 
     289        self.Bind(wx.EVT_BUTTON, self.on_help, id=id)    
     290         
     291        sizer_button.Add((150, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    287292        sizer_button.Add(self.button_calculate, 0, wx.RIGHT|wx.ADJUST_MINSIZE, 20) 
     293        sizer_button.Add(self.button_help, 0, wx.RIGHT|wx.ADJUST_MINSIZE, 20) 
    288294        sizer3.Add(sizer_button) 
    289295        #---------layout---------------- 
     
    295301        self.SetSizer(vbox) 
    296302         
     303    def on_help(self, event):     
     304        """ 
     305        Bring up the SLD Documentation whenever 
     306        the HELP button is clicked.  
     307         
     308        Calls DocumentationWindow with the path of the location within the 
     309        documentation tree (after /doc/ ....".  Note that when using old  
     310        versions of Wx (before 2.9) and thus not the release version of  
     311        installers, the help comes up at the top level of the file as  
     312        webbrowser does not pass anything past the # to the browser when it is 
     313        running "file:///...." 
     314     
     315    :param evt: Triggers on clicking the help button 
     316    """ 
     317                 
     318        _TreeLocation = "user/perspectives/calculator/sld_calculator_help.html" 
     319        _doc_viewer = DocumentationWindow(self, -1, \ 
     320             _TreeLocation,"General Scattering Calculator Help") 
     321 
    297322    def calculate_xray_sld(self, element): 
    298323        """ 
     
    456481        self.panel = SldPanel(self, base=base) 
    457482        self.Bind(wx.EVT_CLOSE, self.on_close) 
    458         self.SetPosition((25, 150)) 
     483        self.SetPosition((20, 10)) 
    459484        self.Show(True) 
    460485     
Note: See TracChangeset for help on using the changeset viewer.