-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathCheck.hx
More file actions
51 lines (40 loc) · 1.23 KB
/
Check.hx
File metadata and controls
51 lines (40 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Feathers UI
Copyright 2026 Bowler Hat LLC. All Rights Reserved.
This program is free software. You can redistribute and/or modify it in
accordance with the terms of the accompanying license agreement.
*/
package feathers.controls;
import openfl.events.Event;
/**
A toggle control that contains a label and a box that may be checked (or
unchecked) to indicate selection.
In the following example, a check is created and selected, and a listener
for `Event.CHANGE` is added:
```haxe
var check = new Check();
check.text = "Pick Me!";
check.selected = true;
check.addEventListener(Event.CHANGE, check_changeHandler);
this.addChild(check);
```
@see [Tutorial: How to use the Check component](https://feathersui.com/learn/haxe-openfl/check/)
@see `feathers.controls.ToggleSwitch`
@since 1.0.0
**/
@:styleContext
class Check extends ToggleButton {
/**
Creates a new `Check` object.
@since 1.0.0
**/
public function new(?text:String, selected:Bool = false, ?changeListener:(Event) -> Void) {
initializeCheckTheme();
super(text, selected, changeListener);
}
private function initializeCheckTheme():Void {
#if !feathersui_disable_default_theme
feathers.themes.steel.components.SteelCheckStyles.initialize();
#end
}
}