-
Notifications
You must be signed in to change notification settings - Fork 385
/
Check.as
198 lines (174 loc) · 4.62 KB
/
Check.as
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
/*
Feathers
Copyright 2012-2015 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 feathers.skins.IStyleProvider;
import flash.errors.IllegalOperationError;
[Exclude(name="isToggle",kind="property")]
/**
* A toggle control that contains a label and a box that may be checked
* or not to indicate selection.
*
* <p>In the following example, a check is created and selected, and a
* listener for <code>Event.CHANGE</code> is added:</p>
*
* <listing version="3.0">
* var check:Check = new Check();
* check.label = "Pick Me!";
* check.isSelected = true;
* check.addEventListener( Event.CHANGE, check_changeHandler );
* this.addChild( check );</listing>
*
* @see ../../../help/check.html How to use the Feathers Check component
* @see feathers.controls.ToggleSwitch
*/
public class Check extends ToggleButton
{
/**
* @copy feathers.controls.Button#STATE_UP
*
* @see #stateToSkinFunction
* @see #stateToIconFunction
* @see #stateToLabelPropertiesFunction
*/
public static const STATE_UP:String = "up";
/**
* @copy feathers.controls.Button#STATE_DOWN
*
* @see #stateToSkinFunction
* @see #stateToIconFunction
* @see #stateToLabelPropertiesFunction
*/
public static const STATE_DOWN:String = "down";
/**
* @copy feathers.controls.Button#STATE_HOVER
*
* @see #stateToSkinFunction
* @see #stateToIconFunction
* @see #stateToLabelPropertiesFunction
*/
public static const STATE_HOVER:String = "hover";
/**
* @copy feathers.controls.Button#STATE_DISABLED
*
* @see #stateToSkinFunction
* @see #stateToIconFunction
* @see #stateToLabelPropertiesFunction
*/
public static const STATE_DISABLED:String = "disabled";
/**
* @copy feathers.controls.Button#ICON_POSITION_TOP
*
* @see #iconPosition
*/
public static const ICON_POSITION_TOP:String = "top";
/**
* @copy feathers.controls.Button#ICON_POSITION_RIGHT
*
* @see #iconPosition
*/
public static const ICON_POSITION_RIGHT:String = "right";
/**
* @copy feathers.controls.Button#ICON_POSITION_BOTTOM
*
* @see #iconPosition
*/
public static const ICON_POSITION_BOTTOM:String = "bottom";
/**
* @copy feathers.controls.Button#ICON_POSITION_LEFT
*
* @see #iconPosition
*/
public static const ICON_POSITION_LEFT:String = "left";
/**
* @copy feathers.controls.Button#ICON_POSITION_MANUAL
*
* @see #iconPosition
* @see #iconOffsetX
* @see #iconOffsetY
*/
public static const ICON_POSITION_MANUAL:String = "manual";
/**
* @copy feathers.controls.Button#ICON_POSITION_LEFT_BASELINE
*
* @see #iconPosition
*/
public static const ICON_POSITION_LEFT_BASELINE:String = "leftBaseline";
/**
* @copy feathers.controls.Button#ICON_POSITION_RIGHT_BASELINE
*
* @see #iconPosition
*/
public static const ICON_POSITION_RIGHT_BASELINE:String = "rightBaseline";
/**
* @copy feathers.controls.Button#HORIZONTAL_ALIGN_LEFT
*
* @see #horizontalAlign
*/
public static const HORIZONTAL_ALIGN_LEFT:String = "left";
/**
* @copy feathers.controls.Button#HORIZONTAL_ALIGN_CENTER
*
* @see #horizontalAlign
*/
public static const HORIZONTAL_ALIGN_CENTER:String = "center";
/**
* @copy feathers.controls.Button#HORIZONTAL_ALIGN_RIGHT
*
* @see #horizontalAlign
*/
public static const HORIZONTAL_ALIGN_RIGHT:String = "right";
/**
* @copy feathers.controls.Button#VERTICAL_ALIGN_TOP
*
* @see #verticalAlign
*/
public static const VERTICAL_ALIGN_TOP:String = "top";
/**
* @copy feathers.controls.Button#VERTICAL_ALIGN_MIDDLE
*
* @see #verticalAlign
*/
public static const VERTICAL_ALIGN_MIDDLE:String = "middle";
/**
* @copy feathers.controls.Button#VERTICAL_ALIGN_BOTTOM
*
* @see #verticalAlign
*/
public static const VERTICAL_ALIGN_BOTTOM:String = "bottom";
/**
* The default <code>IStyleProvider</code> for all <code>Check</code>
* components.
*
* @default null
* @see feathers.core.FeathersControl#styleProvider
*/
public static var globalStyleProvider:IStyleProvider;
/**
* Constructor.
*/
public function Check()
{
super();
super.isToggle = true;
}
/**
* @private
*/
override protected function get defaultStyleProvider():IStyleProvider
{
return Check.globalStyleProvider;
}
/**
* @private
*/
override public function set isToggle(value:Boolean):void
{
throw IllegalOperationError("CheckBox isToggle must always be true.");
}
}
}