User interface programming / Dialog actions |
How are action views of the forms bound to action handlers in the program code?
Action views (such as buttons) are bound to action handlers by the name attribute. Action handlers are defined in interactive instructions with an ON ACTION clause or COMMAND / ON KEY clauses.
BUTTON b1: show_help, TEXT="Show Help";
ON ACTION show_help CALL ShowHelp()
The COMMAND / ON KEY clauses are typically used to write text mode programs. Such clauses define the name of the action and the decoration label. It is recommended that you use ON ACTION clauses instead, because they identify user actions with an abstract name. However, if required, you can use a COMMAND clause in a non-menu dialog to include the corresponding action view in the focus-able form items.
ON ACTION PrintRecord -- will be compiled as "printrecord"
To avoid confusion, always use lower-case names for action names (for example, print_record instead of PrintRecord).