Reference for the Mosaic class Flat::ToggleButton

Flat::ToggleButton
Active
Caption
Icon
IconColor
IconColorActive
IconIndex
ItemColor
ItemColorActive
OnChange
OnSwitchOff
OnSwitchOn
Outlet
enterLeaveSlot
outletSlot
pressReleaseSlot
Core::Group
AlphaBlended
Buffered
Embedded
Enabled
Focus
Opacity
Visible
Add()
AddBehind()
BroadcastEvent()
BroadcastEventAtPosition()
CountViews()
DispatchEvent()
FindNextView()
FindPrevView()
FindSiblingView()
FindViewAtPosition()
FindViewInDirection()
FindViewWithinArea()
GetContentArea()
GetIndexOfView()
GetViewAtIndex()
GlobalPosition()
HasViewState()
Init()
InvalidateArea()
InvalidateViewState()
LocalPosition()
ObtainFocus()
Remove()
Restack()
RestackBack()
RestackBehind()
RestackTop()
UpdateLayout()
UpdateViewState()
Core::RectView
Bounds
Core::View
Layout
Owner
ArrangeView()
ChangeViewState()
CursorHitTest()
Draw()
GetExtent()
GetRoot()
HandleEvent()
MoveView()

Toggle button widget with a flat design. The widget is used to switch a boolean value on and off.

property bool Active = false;

The property 'Active' stores the current state of the button. As long as the property is 'false', the widget represents the status switched-off and should appear released. As long as the property is 'true', the widget represents the status switched-on and should appear pressed.

property string Caption = "Button";

The property 'Caption' stores the text to display within the item.

property Resources::Bitmap Icon = Flat::FlatDemoIcons;

The property 'Icon' stores the bitmap to show in the left part of the button.

property color IconColor = Flat::ColorOfBackground;

The property 'IconColor' defines the color of the widgets icon when it is not activated. The property is used to assign a color independent from the current theme color.

property color IconColorActive = Flat::ColorOfBackground;

The property 'IconColorActive' defines the color of the widgets icon when it is activated. The property is used to assign a color independent from the current theme color.

property int32 IconIndex = 19;

The property 'IconIndex' stores the frame number of the Icon.

property color ItemColor = Flat::ColorOfTouch;

The property 'ItemColor' defines the color of the widgets touchable member (knob). The property is used to assign a color independent from the current theme color.

property color ItemColorActive = Flat::ColorOfTheme;

The property 'ItemColorActive' defines the color of the widgets touchable member (knob) while it is touched by the user. The property is used to assign a color independent from the current theme color.

property slot OnChange = null;

The property 'OnChange' can refer to a slot method, which will receive a signal as soon the user has pressed the button. Thereupon the method's logic will be executed.

property slot OnSwitchOff = null;

The property 'OnSwitchOff' can refer to a slot method, which will receive a signal as soon the button has changed its state to 'switched-off' (bistable buttons only). Thereupon the method's logic will be executed.

property slot OnSwitchOn = null;

The property 'OnSwitchOn' can refer to a slot method, which will receive a signal as soon the button has changed its state to 'switched-on' (bistable buttons only). Thereupon the method's logic will be executed.

property ^bool Outlet = null;

The property 'Outlet' provides an interface for the Model-View-Controller (MVC). In the MVC, the widgets (views, controllers) and the application logic (model) are always kept apart. An automatism behind this model ensures, that widgets are notified automatically as soon as the affected model has changed its state. On the other hand, user interactions on a widget cause the affected model to execute the application logic. Usually, a model is a simple Chora object containing several properties and the implementation of onget/onset method.

By assigning a property reference, Outlet establishes a connection between the widget and the model object, the affected property belongs to. After this, the widget is able to read and modify the referred property in response to the user interactions. It is also able to adapt the widget appearance, if the value of the referred property has been modified by another widget or by the application logic itself.

slot enterLeaveSlot;

This internal slot method is used to receive the corresponding signals form the touch handler.

slot outletSlot;

This slot method will receive a signal, if the value of the property assigned to Outlet has been changed by another widget or by the application logic. In response to this notification, the widget will update itself.

slot pressReleaseSlot;

This internal slot method is used to receive the corresponding signals form the touch handler.