isToggleButton

isToggleButton determines whether the button is released automatically or remains pressed until another click.

 

in Lycia Form Designer

 

 

Form XML code:

 

<Button text="Toggle Button" identifier="bt1" isToggleButton="true">

 

By default, isToggleButton is set implicitly to false and is absent from the form XML code. The property value will appear in the form XML code only once it is set explicitly.

 

 

Possible values: true, false

 

Default value: false

 

Associated containers and widgets: Button

 

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 (see the example below) and manipulated by means of ui methods.

 

lycia form designer

 

4gl code

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

runtime appearance

the button is a simple button:

the button is a toggle button:

pushed

released

 

 

Example programs:

CVS server: client.querix.com

CVS repository: /lycia_doc_examples

User: client

Project: widgets

Program: button_ui