Changeset cce0ad3 in sasview for src/sas/perspectives/invariant


Ignore:
Timestamp:
Mar 29, 2015 5:09:35 PM (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:
60dca65c
Parents:
5ce7f17
Message:

added help button to invariant panel. Removed long text explaining
details button and enhanced the tooltip on the button.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/perspectives/invariant/invariant_panel.py

    rc4f6851 rcce0ad3  
    11""" 
    2 This module provide GUI for the neutron scattering length density calculator 
     2This module provides the GUI for the invariant perspective panel 
    33 
    44""" 
     
    2121from sas.perspectives.invariant.invariant_state import InvariantState as IState 
    2222from sas.guiframe.panel_base import PanelBase 
     23from sas.guiframe.documentation_window import DocumentationWindow 
     24 
    2325# The minimum q-value to be used when extrapolating 
    2426Q_MINIMUM = 1e-5 
     
    5557class InvariantPanel(ScrolledPanel, PanelBase): 
    5658    """ 
    57     Provides the Invariant GUI. 
     59    Main class defining the sizers (wx "panels") used to draw the 
     60    Invariant GUI. 
    5861    """ 
    5962    ## Internal nickname for the window, used by the AUI manager 
     
    18391842        id = wx.NewId() 
    18401843        self.button_details = wx.Button(self, id, "Details?") 
    1841         hint_msg = "Details about the results of the computation" 
     1844        hint_msg = "Get more details of computation such as fraction from extrapolation" 
    18421845        self.button_details.SetToolTipString(hint_msg) 
    18431846        self.Bind(wx.EVT_BUTTON, self.display_details, id=id) 
    1844         details = "Details on Invariant Total Calculations" 
    1845         details_txt = wx.StaticText(self, -1, details) 
    1846         self.button_sizer.AddMany([(details_txt, 0, 
    1847                                     wx.RIGHT | wx.BOTTOM | wx.TOP, 10), 
     1847        #help button 
     1848        id = wx.NewId() 
     1849        self.button_help = wx.Button(self, id, "HELP") 
     1850        self.button_help.SetToolTipString("Invariant Documentation") 
     1851        self.Bind(wx.EVT_BUTTON, self.on_help, id=id) 
     1852        self.button_sizer.AddMany([((20, 20), 1, wx.EXPAND | wx.ADJUST_MINSIZE, 0), 
    18481853                                   (self.button_details, 0, wx.ALL, 10), 
    18491854                                   (self.button_calculate, 0, 
    1850                                     wx.RIGHT | wx.TOP | wx.BOTTOM, 10)]) 
     1855                                    wx.RIGHT | wx.TOP | wx.BOTTOM, 10), 
     1856                                   (self.button_help, 0,  
     1857                                    wx.RIGHT | wx.TOP | wx.BOTTOM, 10),]) 
    18511858    def _do_layout(self): 
    18521859        """ 
     
    18691876        self.SetSizer(self.main_sizer) 
    18701877        self.SetAutoLayout(True) 
     1878         
     1879    def on_help(self, event): 
     1880        """ 
     1881        Bring up the Invariant Documentation whenever the HELP button is  
     1882        clicked. 
     1883 
     1884        Calls DocumentationWindow with the path of the location within the 
     1885        documentation tree (after /doc/ ....".  Note that when using old 
     1886        versions of Wx (before 2.9) and thus not the release version of 
     1887        installers, the help comes up at the top level of the file as 
     1888        webbrowser does not pass anything past the # to the browser when it is 
     1889        running "file:///...." 
     1890 
     1891    :param evt: Triggers on clicking the help button 
     1892    """ 
     1893 
     1894        _TreeLocation = "user/perspectives/invariant/invariant_help.html" 
     1895        _doc_viewer = DocumentationWindow(self, -1, \ 
     1896             _TreeLocation, "Invariant Help") 
    18711897 
    18721898 
Note: See TracChangeset for help on using the changeset viewer.