Changeset dea2f6e in sasview


Ignore:
Timestamp:
Mar 24, 2015 10:42:13 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:
f552ff3
Parents:
1805b87
Message:

Add Pr Help button linking to new docs and comment out old code (remove
after full testing)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/perspectives/pr/inversion_panel.py

    r8b21fa7 rdea2f6e  
    1616from pr_widgets import DataFileTextCtrl 
    1717from pr_widgets import OutputTextCtrl 
     18from sas.guiframe.documentation_window import DocumentationWindow 
    1819 
    1920if sys.platform.count("win32") > 0: 
     
    675676        self.Bind(wx.EVT_BUTTON, self._on_invert, id=wx_id) 
    676677 
     678#        self.button_help = wx.Button(self, -1, "HELP") 
     679#       app_tip = "Get help on P(r) inversion." 
     680#        self.button_help.SetToolTipString(app_tip) 
     681#        self.button_help.Bind(wx.EVT_BUTTON, self.on_help) 
     682 
    677683        self._set_reset_flag(True) 
    678684        self._set_save_flag(True) 
     
    680686        sizer_button.Add((20, 20), 1, wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    681687        sizer_button.Add(button_ok, 0, wx.LEFT | wx.ADJUST_MINSIZE, 10) 
     688#        sizer_button.Add(self.button_help, 0, wx.LEFT | wx.ADJUST_MINSIZE, 10) 
    682689 
    683690        iy_vb += 1 
     
    928935                logging.error(msg) 
    929936 
    930 class HelpDialog(wx.Dialog): 
     937    def on_help(self, event): 
     938        """ 
     939        Bring up the P(r) Documentation whenever 
     940        the HELP button is clicked. 
     941 
     942        Calls DocumentationWindow with the path of the location within the 
     943        documentation tree (after /doc/ ....".  Note that when using old 
     944        versions of Wx (before 2.9) and thus not the release version of 
     945        installers, the help comes up at the top level of the file as 
     946        webbrowser does not pass anything past the # to the browser when it is 
     947        running "file:///...." 
     948 
     949    :param evt: Triggers on clicking the help button 
    931950    """ 
    932     """ 
    933     def __init__(self, parent, id): 
    934         """ 
    935         """ 
    936         from sas.pr.invertor import help 
    937         wx.Dialog.__init__(self, parent, id, size=(400, 450)) 
    938         self.SetTitle("P(r) help") 
    939         self.SetWindowVariant(variant=FONT_VARIANT) 
    940  
    941         vbox = wx.BoxSizer(wx.VERTICAL) 
    942  
    943         explanation = help() 
    944  
    945         label_explain = wx.StaticText(self, -1, explanation, size=(360, 350)) 
    946  
    947         vbox.Add(label_explain, 0, wx.ALL | wx.EXPAND, 15) 
    948  
    949  
    950         static_line = wx.StaticLine(self, -1) 
    951         vbox.Add(static_line, 0, wx.EXPAND, 0) 
    952  
    953         button_ok = wx.Button(self, wx.ID_OK, "OK") 
    954  
    955         sizer_button = wx.BoxSizer(wx.HORIZONTAL) 
    956         sizer_button.Add((20, 20), 1, wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    957         sizer_button.Add(button_ok, 0, wx.LEFT | wx.RIGHT | wx.ADJUST_MINSIZE, 10) 
    958  
    959         vbox.Add(sizer_button, 0, wx.EXPAND | wx.BOTTOM | wx.TOP, 10) 
    960  
    961         self.SetSizer(vbox) 
    962         self.SetAutoLayout(True) 
    963  
    964         self.Layout() 
    965         self.Centre() 
     951 
     952        _TreeLocation = "user/perspectives/pr/pr_help.html" 
     953        _doc_viewer = DocumentationWindow(self, -1, \ 
     954             _TreeLocation, "P(r) Help") 
     955 
     956 
     957 
     958#class HelpDialog(wx.Dialog): 
     959#    """ 
     960#    """ 
     961#    def __init__(self, parent, id): 
     962#        """ 
     963#        """ 
     964#        from sas.pr.invertor import help 
     965#        wx.Dialog.__init__(self, parent, id, size=(400, 450)) 
     966#        self.SetTitle("P(r) help") 
     967#        self.SetWindowVariant(variant=FONT_VARIANT) 
     968# 
     969#        vbox = wx.BoxSizer(wx.VERTICAL) 
     970# 
     971#       explanation = help() 
     972# 
     973#        label_explain = wx.StaticText(self, -1, explanation, size=(360, 350)) 
     974# 
     975#        vbox.Add(label_explain, 0, wx.ALL | wx.EXPAND, 15) 
     976# 
     977# 
     978#        static_line = wx.StaticLine(self, -1) 
     979#        vbox.Add(static_line, 0, wx.EXPAND, 0) 
     980# 
     981#        button_ok = wx.Button(self, wx.ID_OK, "OK") 
     982# 
     983#        sizer_button = wx.BoxSizer(wx.HORIZONTAL) 
     984#        sizer_button.Add((20, 20), 1, wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
     985#        sizer_button.Add(button_ok, 0, wx.LEFT | wx.RIGHT | wx.ADJUST_MINSIZE, 10) 
     986# 
     987#        vbox.Add(sizer_button, 0, wx.EXPAND | wx.BOTTOM | wx.TOP, 10) 
     988# 
     989#        self.SetSizer(vbox) 
     990#        self.SetAutoLayout(True) 
     991# 
     992#        self.Layout() 
     993#        self.Centre() 
    966994 
    967995class PrDistDialog(wx.Dialog): 
Note: See TracChangeset for help on using the changeset viewer.