enable specifies whether any user interaction can be performed with a widget (i.e. whether it is active or not).
in Lycia Form Designer
|
Form XML code:
<element_name visible="true" identifier="f1" enable="true">
By default, enable is set implicitly to true and is displayed as unknown in the Properties view and absent from the form XML code:
The property value will appear in the form XML code only once it is set explicitly (the Properties view will change as well):
Possible values: true, false
Default value: true
Associated containers and widgets:
|
|
Associated 4gl syntax:
Associated methods:
SetEnable ↓
GetEnable
Influence and behavior:
With the enable property set to false, widgets and containers become inactive at runtime:
property set in the form |
|
runtime appearance |
To enable/disable a widget at runtime,
CALL widget_id.SetEnable(TRUE)
property set in the form |
|
|
4gl code |
MAIN DEFINE bt_ui ui.Button, tf_ui ui.TextField OPEN WINDOW w1 WITH FORM "ui_enable" ATTRIBUTE(BORDER)
LET bt_ui = ui.Button.forName("bt1") CALL bt_ui.setEnable(TRUE) LET tf_ui = ui.TextField.forName("tf1") CALL tf_ui.setEnable(TRUE)
CALL fgl_getkey()
END MAIN |
|
runtime appearance |
→ initiate input (for input widgets like TextField):
INPUT BY NAME widget_id
INPUT does not affect action widgets: E.g., if the button was disabled in the form, it will not be enabled by INPUT:
→ display ! or * to them using DISPLAY ... TO (for control widgets like Button):
DISPLAY "!" TO widget_id - to activate an inactive widget;
DISPLAY "*" TO widget_id - to deactivate an active widget.
DISPLAY "!" TO and DISPLAY "*" do not affect action widgets: E.g., if the text field was disabled in the form, it will not be enabled by DISPLAY ... TO:
The examples above were taken from the example program.
Example programs:
CVS server: client.querix.com
CVS repository: /lycia_doc_examples
User: client
Project: widgets
Program: enabledState