Changeset 9654baf in sasview


Ignore:
Timestamp:
Mar 1, 2015 2:46:02 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:
18d58a6e
Parents:
491e916
Message:
  • Add help to Kiessig calculator plus some sizing/positioning panel
  • change order of buttons on slit length calculator to match the rest of

the panels with close be the furthest right button on panel

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

Legend:

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

    rb9a5f0e r9654baf  
    1717from calculator_widgets import InputTextCtrl 
    1818from sas.perspectives.calculator import calculator_widgets as widget    
     19from sas.guiframe.documentation_window import DocumentationWindow 
    1920 
    2021_BOX_WIDTH = 77 
     
    2223if sys.platform.count("win32") > 0: 
    2324    PANEL_WIDTH = 500 
    24     PANEL_HEIGHT = 210 
     25    PANEL_HEIGHT = 230 
    2526    FONT_VARIANT = 0 
    2627else: 
     
    123124        Do the layout for the button widgets 
    124125        """  
     126        id = wx.NewId() 
     127        self.bt_help = wx.Button(self, id,'HELP') 
     128        self.bt_help.Bind(wx.EVT_BUTTON, self.on_help) 
     129        self.bt_help.SetToolTipString("Help using the Kiessig fringe calculator.") 
     130 
    125131        self.bt_close = wx.Button(self, wx.ID_CANCEL,'Close') 
    126132        self.bt_close.Bind(wx.EVT_BUTTON, self.on_close) 
    127133        self.bt_close.SetToolTipString("Close this window.") 
    128         self.button_sizer.AddMany([(self.bt_close, 0, wx.LEFT, 390)]) 
     134        self.button_sizer.AddMany([(self.bt_help, 0, wx.LEFT, 260), 
     135                                   (self.bt_close, 0, wx.LEFT, 20)]) 
    129136         
    130137    def _do_layout(self): 
     
    149156        self.SetAutoLayout(True) 
    150157 
     158    def on_help(self, event):     
     159        """ 
     160        Bring up the Kiessig fringe calculator Documentation whenever 
     161        the HELP button is clicked.  
     162         
     163        Calls DocumentationWindow with the path of the location within the 
     164        documentation tree (after /doc/ ....".  Note that when using old  
     165        versions of Wx (before 2.9) and thus not the release version of  
     166        installers, the help comes up at the top level of the file as  
     167        webbrowser does not pass anything past the # to the browser when it is 
     168        running "file:///...." 
     169     
     170    :param evt: Triggers on clicking the help button 
     171    """ 
     172                 
     173        _TreeLocation = "user/perspectives/calculator/kiessig_calculator_help.html" 
     174        _doc_viewer = DocumentationWindow(self, -1, \ 
     175             _TreeLocation,"Density/Volume Calculator Help") 
     176 
    151177    def on_close(self, event): 
    152178        """ 
     
    202228        self.panel = KiessigThicknessCalculatorPanel(parent=self) 
    203229        self.Bind(wx.EVT_CLOSE, self.on_close) 
    204         self.SetPosition((25, 160)) 
     230        self.SetPosition((25, 10)) 
    205231        self.Show(True) 
    206232         
  • src/sas/perspectives/calculator/slit_length_calculator_panel.py

    r491e916 r9654baf  
    128128        self.Bind(wx.EVT_BUTTON, self.on_help,id=id)    
    129129 
    130         self.button_sizer.AddMany([(self.bt_close, 0, wx.LEFT, 280), 
    131                                    (self.button_help, 0, wx.LEFT, 20)]) 
     130        self.button_sizer.AddMany([(self.button_help, 0, wx.LEFT, 280), 
     131                                   (self.bt_close, 0, wx.LEFT, 20)]) 
    132132                
    133133    def _do_layout(self): 
Note: See TracChangeset for help on using the changeset viewer.