6 10 4 Modify Default Component Behavior

Visual LANSA

6.10.4 Modify Default Component Behavior

Whenever you create a new form, it is modeled on the standard form (STD_FORM) component in your system. Similarly, all reusable parts are modeled on STD_PANL.

Often, it is desirable to change default behavior for all objects with the aim of enforcing site standards. STD_FORM and STD_PANL are components, just as any forms or reusable parts you create are components, and you could modify them if desired. However, STD_FORM and STD_PANL are shipped as part of a default partition definition with LANSA. When a partition is initalized, any changes you have made will be lost.

Rather than modifying the defaults, the best technique is to create your own base form and panel and to use them as the ancestor of all of the objects you create. Create a new form, and change its behavior as required. For example, you may want all forms to appear in the center of the screen by default. To do this, set the Formposition property to ScreenCenter and save the form.

When you create new forms, set the ancestor property to your default form, and the properties, events and methods that you have defined in your base form will be inherited. Inheritance is a very powerful feature of Visual LANSA. For more information, refer to Ancestor Components.

Ý 6.10 Work with Components