Changeset 58c125d in sasview for src/sas/perspectives


Ignore:
Timestamp:
Mar 1, 2015 1:55:51 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:
491e916
Parents:
33f551f
Message:

Added Help button to density/Volume calculator panel and replace screen
shot in help file.

Location:
src/sas/perspectives/calculator
Files:
2 edited

Legend:

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

    r79492222 r58c125d  
    1111from periodictable import formula as Formula 
    1212from sas.perspectives.calculator import calculator_widgets as widget 
     13from sas.guiframe.documentation_window import DocumentationWindow 
    1314        
    1415AVOGADRO =  6.02214129e23 
     
    205206        self.Bind(wx.EVT_BUTTON, self.calculate, id=id)    
    206207         
    207         sizer_button.Add((250, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     208        id = wx.NewId() 
     209        self.button_help = wx.Button(self, id, "HELP") 
     210        self.button_help.SetToolTipString("Help for density calculator.") 
     211        self.Bind(wx.EVT_BUTTON, self.on_help, id=id)    
     212         
     213        sizer_button.Add((150, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    208214        sizer_button.Add(self.button_calculate, 0,  
     215                                        wx.RIGHT|wx.ADJUST_MINSIZE, 20) 
     216        sizer_button.Add(self.button_help, 0,  
    209217                                        wx.RIGHT|wx.ADJUST_MINSIZE, 20) 
    210218        sizer3.Add(sizer_button) 
     
    352360            event.Skip() 
    353361             
     362    def on_help(self, event):     
     363        """ 
     364        Bring up the density/volume calculator Documentation whenever 
     365        the HELP button is clicked.  
     366         
     367        Calls DocumentationWindow with the path of the location within the 
     368        documentation tree (after /doc/ ....".  Note that when using old  
     369        versions of Wx (before 2.9) and thus not the release version of  
     370        installers, the help comes up at the top level of the file as  
     371        webbrowser does not pass anything past the # to the browser when it is 
     372        running "file:///...." 
     373     
     374    :param evt: Triggers on clicking the help button 
     375    """ 
     376                 
     377        _TreeLocation = "user/perspectives/calculator/density_calculator_help.html" 
     378        _doc_viewer = DocumentationWindow(self, -1, \ 
     379             _TreeLocation,"Density/Volume Calculator Help") 
     380 
    354381    def clear_outputs(self): 
    355382        """ 
     
    377404    def __init__(self, parent=None, title="Density/Volume Calculator", 
    378405                  base=None, manager=None,  
    379                   size=(PANEL_SIZE, PANEL_SIZE/1.7), *args, **kwds): 
     406                  size=(PANEL_SIZE*1.05, PANEL_SIZE/1.55), *args, **kwds): 
    380407        """ 
    381408        """ 
     
    388415        self.panel = DensityPanel(self, base=base) 
    389416        self.Bind(wx.EVT_CLOSE, self.on_close) 
    390         self.SetPosition((25, 160)) 
     417        self.SetPosition((25, 10)) 
    391418        self.Show(True) 
    392419     
Note: See TracChangeset for help on using the changeset viewer.