Ignore:
Timestamp:
May 13, 2019 3:23:40 PM (3 years ago)
Author:
toby
Message:

Update help info for Sample Parms & add help button

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r3973 r3977  
    3939                                   a filter to help search through choices.
    4040:class:`HelpButton`                Creates a button labeled with a "?" that when pressed
    41                                    displays help text in a modal message window.
     41                                   displays help text in a modal message window
     42                                   or web browser.
    4243:class:`MultiColumnSelection`      A dialog that builds a multicolumn table, word wrapping
    4344                                   is used for the 2nd, 3rd,... columns.
     
    44594460class HelpButton(wx.Button):
    44604461    '''Create a help button that displays help information.
    4461     The text is displayed in a modal message window.
     4462    The text can be displayed in a modal message window or it can be
     4463    a reference to a location in the gsasII.html help web page, in which
     4464    case that page is opened in a web browser.
    44624465
    44634466    TODO: it might be nice if it were non-modal: e.g. it stays around until
     
    44654468    me.
    44664469
    4467     :param parent: the panel which will be the parent of the button
     4470    :param parent: the panel/frame where the button will be placed
    44684471    :param str msg: the help text to be displayed
     4472    :param str helpIndex: location of the help information in the gsasII.html
     4473      help file in the form of an anchor string. The URL will be
     4474      constructed from: location + gsasII.html + "#" + helpIndex
    44694475    '''
    4470     def __init__(self,parent,msg):
     4476    def __init__(self,parent,msg='',helpIndex=''):
    44714477        if sys.platform == "darwin":
    44724478            wx.Button.__init__(self,parent,wx.ID_HELP)
     
    44764482        self.msg=StripIndents(msg)
    44774483        self.parent = parent
     4484        self.helpIndex = helpIndex
    44784485    def _onClose(self,event):
    44794486        self.dlg.EndModal(wx.ID_CANCEL)
    44804487    def _onPress(self,event):
    44814488        'Respond to a button press by displaying the requested text'
     4489        if self.helpIndex:
     4490            ShowHelp(self.helpIndex,self.parent)
     4491            return
    44824492        #dlg = wx.MessageDialog(self.parent,self.msg,'Help info',wx.OK)
    44834493        self.dlg = wx.Dialog(self.parent,wx.ID_ANY,'Help information',
Note: See TracChangeset for help on using the changeset viewer.