isToggleButton determines whether the button is released automatically or remains pressed until another click.
Form XML code:
Possible values:
true, false
Default value:
false
Associated containers and widgets:
Associated ui methods:
SetIsPressed
GetIsPressed
SetIsToggleButton
GetIsToggleButton
Influence and behavior:
By default, button clicks are automatically animated so that the button is pushed and released at one action (without waiting).
When the isToggleButton property is set to true, the button has two states, pushed and released, with the state changed at a button-click.
pushed
|
released
|
The change of the button state does not influence the application response to its specified events.
At runtime, toggle buttons can be created and manipulated by means of ui methods:
MAIN
DEFINE bt_ui2 ui.Button,
isImageSet SMALLINT
OPEN WINDOW w1 WITH FORM "button_ui_setistogglebutton" ATTRIBUTE(BORDER)
LET bt_ui2 = ui.Button.forName("bt2")
LET isImageSet = 0
CALL bt_ui2.SetIsToggleButton(TRUE)
CALL bt_ui2.setText("Toggle Button")
CALL bt_ui2.SetEnable(TRUE)
MENU
ON ACTION "Toggle"
IF bt_ui2.GetIsToggleButton() THEN
CALL bt_ui2.SetIsToggleButton(FALSE)
CALL bt_ui2.setText("Button")
ELSE
CALL bt_ui2.SetIsToggleButton(TRUE)
CALL bt_ui2.setText("Toggle Button")
END IF
ON ACTION exit
EXIT MENU
END MENU
END MAIN
the button is a simple button:
the button is a toggle button (pushed and released):