Changeset 491e916 in sasview


Ignore:
Timestamp:
Mar 1, 2015 2:23:04 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:
9654baf
Parents:
58c125d
Message:

Added help button to slit size calculator and adjusted sizing

File:
1 edited

Legend:

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

    r79492222 r491e916  
    2020from calculator_widgets import InterActiveOutputTextCtrl 
    2121from sas.perspectives.calculator import calculator_widgets as widget    
     22from sas.guiframe.documentation_window import DocumentationWindow 
    2223 
    2324_BOX_WIDTH = 76 
     
    2526if sys.platform.count("win32") > 0: 
    2627    PANEL_WIDTH = 500 
    27     PANEL_HEIGHT = 200 
     28    PANEL_HEIGHT = 210 
    2829    FONT_VARIANT = 0 
    2930else: 
     
    121122        self.bt_close.Bind(wx.EVT_BUTTON, self.on_close) 
    122123        self.bt_close.SetToolTipString("Close this window.") 
    123         self.button_sizer.AddMany([(self.bt_close, 0, wx.LEFT, 390)]) 
    124          
     124  
     125        id = wx.NewId() 
     126        self.button_help = wx.Button(self, id, "HELP") 
     127        self.button_help.SetToolTipString("Help for slit length calculator.") 
     128        self.Bind(wx.EVT_BUTTON, self.on_help,id=id)    
     129 
     130        self.button_sizer.AddMany([(self.bt_close, 0, wx.LEFT, 280), 
     131                                   (self.button_help, 0, wx.LEFT, 20)]) 
     132                
    125133    def _do_layout(self): 
    126134        """ 
     
    160168         
    161169        return path 
     170 
     171    def on_help(self, event):     
     172        """ 
     173        Bring up the slit length calculator Documentation whenever 
     174        the HELP button is clicked.  
     175         
     176        Calls DocumentationWindow with the path of the location within the 
     177        documentation tree (after /doc/ ....".  Note that when using old  
     178        versions of Wx (before 2.9) and thus not the release version of  
     179        installers, the help comes up at the top level of the file as  
     180        webbrowser does not pass anything past the # to the browser when it is 
     181        running "file:///...." 
     182     
     183    :param evt: Triggers on clicking the help button 
     184    """ 
     185                 
     186        _TreeLocation = "user/perspectives/calculator/slit_calculator_help.html" 
     187        _doc_viewer = DocumentationWindow(self, -1, \ 
     188             _TreeLocation,"Slit Length Calculator Help") 
    162189 
    163190    def on_close(self, event): 
     
    266293        self.panel = SlitLengthCalculatorPanel(parent=self) 
    267294        self.Bind(wx.EVT_CLOSE, self.on_close) 
    268         self.SetPosition((25, 150)) 
     295        self.SetPosition((25, 10)) 
    269296        self.Show(True) 
    270297 
Note: See TracChangeset for help on using the changeset viewer.