The Command Button tool allows you to place a Push-button on the screen. On activation this button will issue the command you configure. A simple text preprocessing module allows you to prompt for command parameters. Commands can be any valid command you define with your command definition files (*.cpd). Another option to use commands in an easy fashion from the user interface is to configure command menus.
The Command Button tool can also be activated from the toolbar with the
button. After you finish selecting your drawing area the specific dialog to specify your command parameters pops up:
The Command Button dialog lets you specify the button name, that is that text that is displayed on the button, as well as the command string to be executed. Upon execution a new CmdString block will be generated with the contents of this command string copied into the CmdString.Command field and the CmdString.Len set properly. The CmdString in turn is processed by the GSEOS command processor and executes your command as defined in the command definition.
The following snapshot shows the resulting button:
The Command String text allows simple text replacement:
If you specify the $' escape sequence a dialog box will be displayed when the command is executed. The dialog will prompt the user for input. Everything between and including the $' escape sequence and the terminating ' will be replaced by the users input. You can have multiple replacement strings in one Command String, this will pop up multiple input boxes.
The following example will query the user for a command parameter:
L_CAL_SET("E_RANGE1", $'Enter setting [0..255]')
On execution the following dialog will be displayed:
If the user enters 20 the following command will be generated:
L_CAL_SET("E_RANGE1", 20)
When you move the mouse cursor over the button the Command String will be displayed in the GSEOS status bar. The command button object recognizes the following formats: Text, Color.