Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

AppSwitch

An on/off button-like control. More...

Import Statement: import Felgo 3.0

Properties

Signals

Methods

Detailed Description

This displays a slide-able switch which can be used to toggle some functionality on or off.

It has a checked property, that can be modified by the user, either by sliding the switch to the left (off) or to the right (on), or by simply tapping on it (toggles on/off).

It will emit the signal toggled, when the checked state has changed. By default, the styling of the button is changed to match different platforms.

Property Documentation

backgroundBorderColor : color

The color of the background's border. Matches platform specific values by default.

This property was introduced in Felgo 2.7.0.


backgroundBorderWidth : real

The width of the background's border. Matches platform specific values by default.

This property was introduced in Felgo 2.7.0.


backgroundColorOff : color

The background color when the switch is off.

This property was introduced in Felgo 2.6.2.


backgroundColorOffPressed : color

The background color when the switch is off and pressed.

This property was introduced in Felgo 2.6.2.


backgroundColorOn : color

The background color when the switch is on.

This property was introduced in Felgo 2.6.2.


backgroundColorOnPressed : color

The background color when the switch is on and pressed.

This property was introduced in Felgo 2.6.2.


checked : bool

A Boolean property that determines the off/on state of the switch. Set this property to true or false to change the switch's state.

See also toggle() and setChecked().


dropShadow : bool

Whether the knob should drop a shadow.

This property was introduced in Felgo 2.6.2.


knobBorderColor : color

The border color of the knob.

This property was introduced in Felgo 2.6.2.


knobBorderWidth : real

The width of the knobs's border. Matches platform specific values by default.

This property was introduced in Felgo 2.7.0.


knobColorOff : color

The knob color when the switch is off.

This property was introduced in Felgo 2.6.2.


knobColorOn : color

The knob color when the switch is on.

This property was introduced in Felgo 2.6.2.


[read-only] pressed : bool

Whether the switch is currently being pressed.

This property was introduced in Felgo 2.7.0.


updateChecked : bool

If set to false, the checked property is not changed when this control is toggled. Can be useful if it is bound to some other value.


Signal Documentation

toggled()

Emitted each time the checked state of the switch changes. This is the case when the user toggles the button or it gets set from within your code.


Method Documentation

setChecked( = checked)

Call this method to set the current checked state of the switch. This has the same effect as setting the checked property directly.

See also checked and toggle().


toggle()

Call this method to toggle the current checked state of the switch. If the switch is currently off it changes to on and vice-versa.

See also checked and setChecked().