Changeset 18d58a6e in sasview


Ignore:
Timestamp:
Mar 1, 2015 3:06:24 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:
517f3d4
Parents:
9654baf
Message:

add help button to resolution calculator panel and do a few adjustments

File:
1 edited

Legend:

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

    rb9a5f0e r18d58a6e  
    3131from math import fabs 
    3232from sas.perspectives.calculator import calculator_widgets as widget    
     33from sas.guiframe.documentation_window import DocumentationWindow 
    3334 
    3435_BOX_WIDTH = 100 
     
    533534        Do the layout for the button widgets 
    534535        """  
    535         # coordinate selction removed 
    536         #outerbox_txt = wx.StaticText(self, -1, 'Outer Box') 
    537         #self.x_y_rb = wx.RadioButton(self, -1,"Cartesian") 
    538         #self.Bind(wx.EVT_RADIOBUTTON, 
    539         #          self._on_xy_coordinate, id=self.x_y_rb.GetId()) 
    540         #self.r_phi_rb = wx.RadioButton(self, -1,"Polar") 
    541         #self.Bind(wx.EVT_RADIOBUTTON, 
    542         #          self._on_rp_coordinate, id=self.r_phi_rb.GetId()) 
    543         #self.r_phi_rb.SetValue(True) 
    544         #reset button 
     536 
    545537        id = wx.NewId() 
    546538        self.reset_button = wx.Button(self, id, "Reset") 
     
    554546        self.compute_button.SetToolTipString(hint_on_compute) 
    555547        self.Bind(wx.EVT_BUTTON, self.on_compute, id=id) 
     548        #help button 
     549        id = wx.NewId() 
     550        self.help_button = wx.Button(self, id, "HELP") 
     551        hint_on_help = "Help on using the Resolution Calculator" 
     552        self.help_button.SetToolTipString(hint_on_help) 
     553        self.Bind(wx.EVT_BUTTON, self.on_help, id=id) 
    556554        # close button 
    557555        self.bt_close = wx.Button(self, wx.ID_CANCEL,'Close') 
    558556        self.bt_close.Bind(wx.EVT_BUTTON, self.on_close) 
    559557        self.bt_close.SetToolTipString("Close this window.") 
    560         """ 
    561         self.button_sizer.AddMany([(self.r_phi_rb,  0, wx.LEFT, 15), 
    562                                    (self.x_y_rb,  0, wx.LEFT, 15), 
    563                                    (self.reset_button, 0, wx.LEFT, 50), 
    564                                    (self.compute_button, 0, wx.LEFT, 15), 
    565                                    (self.bt_close, 0, wx.LEFT, 15)])#370)]) 
    566         """ 
     558 
    567559        self.button_sizer.Add((110, -1)) 
    568560        self.button_sizer.AddMany([(self.reset_button, 0, wx.LEFT, 50), 
    569561                                   (self.compute_button, 0, wx.LEFT, 15), 
     562                                   (self.help_button, 0, wx.LEFT, 15), 
    570563                                   (self.bt_close, 0, wx.LEFT, 15)]) 
    571564        self.compute_button.SetFocus() 
     
    697690        self.SetAutoLayout(True) 
    698691         
     692 
     693    def on_help(self, event):     
     694        """ 
     695        Bring up the Resolution calculator Documentation whenever 
     696        the HELP button is clicked.  
     697         
     698        Calls DocumentationWindow with the path of the location within the 
     699        documentation tree (after /doc/ ....".  Note that when using old  
     700        versions of Wx (before 2.9) and thus not the release version of  
     701        installers, the help comes up at the top level of the file as  
     702        webbrowser does not pass anything past the # to the browser when it is 
     703        running "file:///...." 
     704     
     705    :param evt: Triggers on clicking the help button 
     706    """ 
     707                 
     708        _TreeLocation = "user/perspectives/calculator/resolution_calculator_help.html" 
     709        _doc_viewer = DocumentationWindow(self, -1, \ 
     710             _TreeLocation,"Resolution Calculator Help") 
    699711 
    700712    def on_close(self, event): 
     
    14061418        self.panel = ResolutionCalculatorPanel(parent=self) 
    14071419        self.Bind(wx.EVT_CLOSE, self.OnClose) 
    1408         self.SetPosition((25, 150)) 
     1420        self.SetPosition((25, 10)) 
    14091421        self.Show(True) 
    14101422     
Note: See TracChangeset for help on using the changeset viewer.