| Products | Purchase | Support | Download | News | About |
|
|
Support - Script Examples |
|||
|
Dialog Boxes Project: A script which automates one or more session activities is configurable and needs to prompt the user for selections before proceeding. A custom dialog box is desired so it can use standard Windows controls appropriate for this custom application. Algorithm: The script defines a dialog box with checkboxes, text boxes, combo buttons, listboxs and/or buttons for user selections and waits until the user chooses to proceed by clicking the OK button. When this happens, user selections are read, interpreted and stored for future script operations, and the dialog box is cancelled. Product used in this example: DynaComm Connectivity Series® 9. (release 9.0.0.0) Relevant Commands and Functions:
DIALOG — Beginning of dialog block, also specifies size, position, and attributes of the dialog box Dialog Controls (commands):
(DIALOG) BUTTON — Creates a command button control in a dialog box Dialog Functions, which return user selections from dialog controls:
(DIALOG) CHECKBOX — Determines if the specified checkbox is checked Additional Dialog Commands:
DIALOG DIMENSION — Specifies the size and position of a control in a dialog box A Brief Example: Below is a picure of the dialog box we are creating:
*DialogPrompt
TABLE DEFINE 0 FIELDS CHAR 15
DIALOG CONTROL 1 RADIOGROUP 1 DISABLE
%HostSystem = LISTBOX(1,1)
*ToggleRadioGroup
IF CHECKBOX(1,1) = 1 RETURN
This example is developed in two routines, a main one which presents the dialog box and a worker routine which toggles the state of some of the dialog box controls. Writing scripts in procedures and passing arguments are discussed further in the Program Flow example. A few lines preceed the dialog box definition in this example. These are to define a table and load it with the names of several host systems since the Listbox dialog control uses a table to display available values. Alternatively, the table could be loaded from a file using the TABLE LOAD command. Further illustration of data table manipulation can be found in the example of Data Tables. The DIALOG command begins the dialog block and the DIALOG END command ends it. The commands between them define the dialog controls to be displayed, their properties, and where appropriate, what they do when activated. The order of the controls within the dialog box determines the tab order within the dialog. In addition, several of the controls allow definition of accelerator keys for easy access from the keyboard. This example contains a listbox of available host systems, edittext boxes for the user to enter their userid and password, a checkbox for an optional script feature, and if checked, a set of radiobuttons used to configure that timeout feature. The DIALOG CONTROL command is used to update the Radiobutton controls to be disabled/enabled based on the state of the checkbox, and for simplicity, this part of the script was offloaded to a separate routine which is called from the dialog and returns after making the changes. A WAIT RESUME command is commonly used at the end of the Dialog block to pause script execution until the user makes selections and chooses to continue. The user clicks on the OK button which issues the necessary RESUME script command to move past the WAIT RESUME, the selections are read from the dialog controls and stored to variables, and the DIALOG CANCEL command removes the dialog box. This example illustrates the use of the the EDITTEXT( ), LISTBOX( ), RADIOGROUP( ), and CHECKBOX( ) functions to return the user selections, and the TRIM( ) function to remove trailing spaces from strings. Finally, the DIALOG CANCEL command terminates the dialog box and the RETURN command returns to the line following the command which called this DialogPrompt routine. Further development:
Additional Examples: Several of the examples examined here use dialog boxes for input/output. See the Session Manager example and the Data Tables example. MULTIDLG - This example lists files and subdirectories in the root directory of the PC in a listbox. When you click on an item in the listbox, it uses a secondary dialog to report the properties of the object. DDECLNT - This example exhibits DDE Client functionality, but is also a good illustration of enabling/disabling dialog controls based on user actions. |
|||
![]() |
Purchase | Contact | Privacy Policy | Terms of Use | Sitemap | Blog |
© 2010 FutureSoft, Inc. All Rights Reserved
|
||||||
|
DynaComm i:filter |
Internet Filtering |
Employee Internet Monitoring |
Managing Internet Access |
Web Filtering |
Internet Monitoring |
DCS Terminal Emulation | TN 3270 | ProComm Plus Replacement | Windows Terminal Emulation | TN 5250 | DynaComm Connectivity Series | MultiView |
||||||