Example #1
0
def show_help_popup(event):
    """Displays a pop-up help window for a single trait."""
    control = event.GetEventObject()
    template = help_template()

    # Note: The following check is necessary because under Linux, we get back
    # a control which does not have the 'help' trait defined (it is the parent
    # of the object with the 'help' trait):
    help = getattr(control, "help", None)
    if help is not None:
        html_content = template.item_html % (control.GetLabel(), help)
        HTMLHelpWindow(control, html_content, 0.25, 0.13)
Example #2
0
def show_help_popup ( event ):
    """ Displays a pop-up help window for a single trait.
    """
    control  = event.GetEventObject()
    template = help_template()

    # Note: The following check is necessary because under Linux, we get back
    # a control which does not have the 'help' trait defined (it is the parent
    # of the object with the 'help' trait):
    help = getattr( control, 'help', None )
    if help is not None:
        html = template.item_html % ( control.GetLabel(), help )
        HTMLHelpWindow( control, html, .25, .13 )
Example #3
0
def show_help(ui, button):
    """ Displays a help window for the specified UI's active Group.
    """
    group = ui._groups[ui._active_group]
    template = help_template()
    if group.help != "":
        header = template.group_help % escape(group.help)
    else:
        header = template.no_group_help
    fields = []
    for item in group.get_content(False):
        if not item.is_spacer():
            fields.append(template.item_help % (escape(item.get_label(ui)), escape(item.get_help(ui))))
    html = template.group_html % (header, "\n".join(fields))
    HTMLHelpWindow(button, html, 0.25, 0.33)
Example #4
0
def show_help(ui, button):
    """ Displays a help window for the specified UI's active Group.
    """
    group = ui._groups[ui._active_group]
    template = help_template()
    if group.help != '':
        header = template.group_help % cgi.escape(group.help)
    else:
        header = template.no_group_help
    fields = []
    for item in group.get_content(False):
        if not item.is_spacer():
            fields.append(template.item_help % (cgi.escape(
                item.get_label(ui)), cgi.escape(item.get_help(ui))))
    html = template.group_html % (header, '\n'.join(fields))
    HTMLHelpWindow(button, html, .25, .33)