Hot Labels in Xdialog Boxes

Syntax

## Label_Text ! Event_Name ~~

Arguments

Variable_Name

Character. The name of a character variable to receive the user selection, or a numeric variable to receive the index value of the selected radio button. The index of the top-most button is 1.

Event_Name

Character. The name of the event.

help_Event_Name

Character. The name of the help text variable associated with Event_Name.

Description

The Xdialog that contains hot labels is constructed in a the following manner. First, the body of the dialog is created as a character variable named dlg_body.

dlg_body = <<%dlg%
{wrap=100}
This example demonstrates how you can create dialog boxes with 'hot' labels. When you click the mouse on a label, a small window pops up offering help to the user on the parameter referenced by the label. This is a convenient alternative to creating a stand-alone help file and hooking the help file into your Xdialog.;
{lf};
##Hot Label !labelevent~~;
{lf};
<10&OK!ok> <10&Close!close>;
%dlg%

Next, the event handling code is created as a character variable named dlg_event.

dlg_event = <<%code%
if a_dlg_button = "ok" then
    ui_msg_box("","User pressed the OK button.")
    a_dlg_button = ""
end if
%code%

The help text is saved as a character variable named help_labelevent. The help text may be of arbitrary length and use any type of HTML coding.

help_labelevent = <<%a%
<body bgcolor="#CCFFCC">
<h4>Standard HTML</h4>
This help text may contain any HTML coding and be of arbitrary length.
%a%

Finally, the dialog body variable is preprocessed and displayed in the following manner.

dim x as P
x = a5_xdialogPreProcess(dlg_body)
ui_dlg_box("Hot Labels", x.dlg_body, x.dlg_event + dlg_event)

Examples

When the mouse is over the label, the label is underlined, indicating that the label can be clicked. When you click the label, a popup window appears, in which you can define help. Use HTML syntax to create beautifully formatted help. Even use a CSS stylesheet to define a consistent look. Dialog Before Cursor:

images/XD_Hot_Labels_1.gif

Dialog After Cursor

images/XD_Hot_Labels_2.gif

Pop-up Help

images/XD_Hot_Labels_3.gif

See Also