Training Script Language PRACTICE | 116
©
1989-2024 Lauterbach
Dialog Example
A complete list of dialog controls can be found in “PowerView Command Reference” (ide_ref.pdf). In this
section we will examine a few of them in the context of a complex example. The full version of this script can
be found in ~~/demo/practice/dialogs/dialog_example_generic.cmm
First, declare some local macros to be used in the script. Some of them are given default values. Some lines
have been split using the "\" character to make the script more readable here. Some assignments, like
&instr are made using multiple assignments to build up a longer value.
Display the dialog. The characters "&+" after the opening parenthesis allow for runtime macro substitution
into the dialog controls. The code below will create a header and add a text line and edit field to the dialog.
The next few lines add a box and a group of radio buttons (CHOOSEBOXes) into the box pane. Each
CHOOSEBOX is part of the same group. The label name takes the form <group>.<member> and TRACE32
ensures that only one member of each group can be selected at any one time. Each CHOOSEBOX has a
command associated with it which will be executed when the user selects that control.
LOCAL &bond &batman &captain &bondsel &captainsel &batmansel &expand \
&progress &instr &myname
&bond="Sean Connery,George Lazenby,Roger Moore,Timothy Dalton,"
&bond="&bond"+"Pierce Brosnan,Daniel Craig"
&batman="Adam West,Michael Keaton,Val Kilmer,George Clooney,"
&batman="&batman"+"Christian Bale,Ben Affleck"
&captain="Jonathon Archer,James Kirk,Jean-Luc Picard,"
&captain="&captain"+"Benjamin Sisko,Katherine Janeway"
&expand=0.
&progress=0.
&instr="Instructions for USE"+CONVert.CHAR(10.)
&instr="&instr"+"============="+CONVert.CHAR(10.)
&instr="&instr"+"1) Enter your name. We will not send you spam"
&instr="&instr"+" e-mail ;-)"+CONVert.CHAR(10.)
&instr="&instr"+"2) Select an option in the ""Options"" pane." \
+CONVert.CHAR(10.)
&instr="&instr"+"3) Double-click to select an item from the list." \
+CONVert.CHAR(10.)
&instr="&instr"+"4) Once an item from each category has been"
&instr="&instr"+" selected, click ""OK""."+CONVert.CHAR(10.)
DIALOG.view
(&+
HEADER "Dialog Example"
POS 1. 0. 20. 1.
TEXT "Please enter your name:"
POS 22. 0. 24. 1.
MYNAME: DEFEDIT "" ""