Tutorial Chapter 12: Changing the User Interface Dynamically
This chapter focuses on using the classes and methods in the
ui
package of built-in classes to modify the user interface at runtime. Among the
techniques illustrated are hiding or disabling form items; changing the text, style or image
associated with a form item; loading a combobox from a database table; and adding toolbars and
topmenus dynamically.
Built-in Classes Included in the predefined functions that are built into Genero are special groups (classes) of functions (methods) that act upon the objects that are created when your program is running. Each class of methods interacts with a specific program object, allowing you to change the appearance or behavior of the objects. Because these methods act upon program objects, the syntax is somewhat different from that of functions.Working with Forms The Form
class provides some methods that allow you to change the appearance or behavior of items on a form.Hiding Form Items You can use Form
class methods to change the value of the hidden
property of form items, hiding parts of the form from the user. Adding toolbars, topmenus, and action defaults The Form
class provides methods that apply topmenus, toolbars, and action defaults to a form, to assist you in standardizing forms. Specifying a Function to Initialize all Forms To assist in standardizing forms, you can create an initializer function in your program that will be called automatically whenever any form is opened. A reference to the form object is passed by the runtime system to the function.Loading a ComboBox List Using the Dialog class in Interactive Statements The Dialog
class provides methods that can only be called from within an interactive instruction (dialog) such as MENU
, INPUT
, INPUT ARRAY
, DISPLAY ARRAY
and CONSTRUCT
. Hiding Default Action Views To hide default action views (the buttons that appear on the form when there is no specific action view for an action), use the following Dialog
class method.Enabling and Disabling Fields This method in the Dialog
class allows you to disable fields on a form during the interactive statement; the field is still visible, but the user cannot edit the value. Using the Interface Class Methods in the Interface
class allow you interact with the user interface, as shown in the examples.