Changeset 1941e6a in sasview for src/sas


Ignore:
Timestamp:
Jun 19, 2016 1:33:52 PM (8 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:
53b9fc8
Parents:
70c5d490
Message:

fixes #438 - added help button to data explorer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/data_panel.py

    rd85c194 r1941e6a  
    1313import wx 
    1414from wx.build import build_options 
     15 
    1516# Check version 
    1617toks = str(wx.__version__).split('.') 
     
    291292        Layout widgets related to buttons 
    292293        """ 
     294        #Load Data Button 
    293295        self.bt_add = wx.Button(self, wx.NewId(), "Load Data",  
    294296                                size=(BUTTON_WIDTH, -1)) 
    295297        self.bt_add.SetToolTipString("Load data files") 
    296298        wx.EVT_BUTTON(self, self.bt_add.GetId(), self._load_data) 
     299         
     300        #Delete Data Button 
    297301        self.bt_remove = wx.Button(self, wx.NewId(), "Delete Data", 
    298302         size=(BUTTON_WIDTH, -1)) 
    299303        self.bt_remove.SetToolTipString("Delete data from the application") 
    300304        wx.EVT_BUTTON(self, self.bt_remove.GetId(), self.on_remove) 
     305         
     306        #Send data to perspective button 
    301307        self.bt_import = wx.Button(self, wx.NewId(), "Send To", 
    302308                                    size=(BUTTON_WIDTH, -1)) 
    303309        self.bt_import.SetToolTipString("Send Data set to active perspective") 
    304310        wx.EVT_BUTTON(self, self.bt_import.GetId(), self.on_import) 
     311         
     312        #Choose perspective to be send data to combo box 
    305313        self.perspective_cbox = wx.ComboBox(self, -1, 
    306314                                style=wx.CB_READONLY) 
     
    310318                        self._on_perspective_selection) 
    311319     
     320        #Append data to current Graph Button 
    312321        self.bt_append_plot = wx.Button(self, wx.NewId(), "Append Plot To", 
    313322                                        size=(BUTTON_WIDTH, -1)) 
     
    316325        wx.EVT_BUTTON(self, self.bt_append_plot.GetId(), self.on_append_plot) 
    317326         
     327        #Create a new graph and send data to that new graph button 
    318328        self.bt_plot = wx.Button(self, wx.NewId(), "New Plot",  
    319329                                 size=(BUTTON_WIDTH, -1)) 
     
    321331        wx.EVT_BUTTON(self, self.bt_plot.GetId(), self.on_plot) 
    322332         
     333        #Freeze current theory button - becomes a data set and stays on graph 
    323334        self.bt_freeze = wx.Button(self, wx.NewId(), "Freeze Theory",  
    324335                                   size=(BUTTON_WIDTH, -1)) 
     
    329340        wx.EVT_BUTTON(self, self.bt_freeze.GetId(), self.on_freeze) 
    330341        
     342        #select plot to send to combo box (blank if no data) 
    331343        if sys.platform == 'darwin': 
    332344            self.cb_plotpanel = wx.ComboBox(self, -1,  
     
    337349        wx.EVT_COMBOBOX(self.cb_plotpanel, -1, self._on_plot_selection) 
    338350        self.cb_plotpanel.Disable() 
     351         
     352        #Help button 
     353        self.bt_help = wx.Button(self, wx.NewId(), "HELP", 
     354                                 size=(BUTTON_WIDTH, -1)) 
     355        self.bt_help.SetToolTipString("Help for the Data Explorer.") 
     356        wx.EVT_BUTTON(self,self.bt_help.GetId(), self.on_help) 
    339357 
    340358        self.sizer3.AddMany([(self.bt_add), 
     
    356374                             ((10, 10)), 
    357375                             (self.sizer4), 
    358                              ((10, 40)), 
    359                              ((10, 40))]) 
     376                             ((10, 10)), 
     377                             (self.bt_help, 0, wx.EXPAND|wx.RIGHT, 5)]) 
    360378 
    361379        self.sizer3.AddGrowableCol(1, 1) 
     
    10691087        return self.frame  
    10701088     
     1089    def on_help(self, event): 
     1090        """ 
     1091        Bring up the data manager Documentation whenever 
     1092        the HELP button is clicked. 
     1093 
     1094        Calls DocumentationWindow with the path of the location within the 
     1095        documentation tree (after /doc/ ....".  Note that when using old 
     1096        versions of Wx (before 2.9) and thus not the release version of 
     1097        installers, the help comes up at the top level of the file as 
     1098        webbrowser does not pass anything past the # to the browser when it is 
     1099        running "file:///...." 
     1100 
     1101    :param evt: Triggers on clicking the help button 
     1102    """ 
     1103 
     1104        #import documentation window here to avoid circular imports 
     1105        #if put at top of file with rest of imports. 
     1106        from documentation_window import DocumentationWindow 
     1107 
     1108        _TreeLocation = "user/sasgui/guiframe/data_explorer_help.html" 
     1109        _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, "", 
     1110                                          "Data Explorer Help") 
     1111 
    10711112    def on_close(self, event): 
    10721113        """ 
Note: See TracChangeset for help on using the changeset viewer.