Hot Labels in Xdialog Boxes


## Label_Text ! Event_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.


Character. The name of the event.


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


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%
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.;
##Hot Label !labelevent~~;
<10&OK!ok> <10&Close!close>;

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

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.

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)


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:


Dialog After Cursor


Pop-up Help


See Also