/FD3/FlashDevelop/Bin/Debug/Library/AS3/frameworks/FlashIDE/fl/controls/RadioButton.as

https://bitbucket.org/kkszysiu/flashdevelop · ActionScript · 204 lines · 65 code · 4 blank · 135 comment · 0 complexity · ded775462007e297254d8f19c41c961e MD5 · raw file

  1. package fl.controls
  2. {
  3. import fl.controls.ButtonLabelPlacement;
  4. import fl.controls.LabelButton;
  5. import fl.controls.RadioButtonGroup;
  6. import fl.core.InvalidationType;
  7. import fl.core.UIComponent;
  8. import fl.managers.IFocusManager;
  9. import fl.managers.IFocusManagerGroup;
  10. import flash.display.DisplayObject;
  11. import flash.display.Graphics;
  12. import flash.display.Shape;
  13. import flash.display.Sprite;
  14. import flash.events.Event;
  15. import flash.events.KeyboardEvent;
  16. import flash.events.MouseEvent;
  17. import flash.ui.Keyboard;
  18. /**
  19. * Dispatched when the radio button instance's <code>selected</code> property changes. * * @includeExample examples/RadioButton.change.1.as -noswf * * @eventType flash.events.Event.CHANGE * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  20. */
  21. [Event(name="change" , type="flash.events.Event")]
  22. /**
  23. * Dispatched when the user clicks the radio button with the mouse or spacebar. * * @includeExample examples/RadioButton.change.1.as -noswf * * @eventType flash.events.MouseEvent.CLICK * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  24. */
  25. [Event(name="click" , type="flash.events.MouseEvent")]
  26. /**
  27. * @copy fl.controls.LabelButton#style:icon * * @default null * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  28. */
  29. [Style(name="icon", type="Class")]
  30. /**
  31. * @copy fl.controls.LabelButton#style:upIcon * * @default RadioButton_upIcon * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  32. */
  33. [Style(name="upIcon", type="Class")]
  34. /**
  35. * @copy fl.controls.LabelButton#style:downIcon * * @default RadioButton_downIcon * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  36. */
  37. [Style(name="downIcon", type="Class")]
  38. /**
  39. * @copy fl.controls.LabelButton#style:overIcon * * @default RadioButton_overIcon * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  40. */
  41. [Style(name="overIcon", type="Class")]
  42. /**
  43. * @copy fl.controls.LabelButton#style:disabledIcon * * @default RadioButton_disabledIcon * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  44. */
  45. [Style(name="disabledIcon", type="Class")]
  46. /**
  47. * @copy fl.controls.LabelButton#style:selectedDisabledIcon * * @default RadioButton_selectedDisabledIcon * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  48. */
  49. [Style(name="selectedDisabledIcon", type="Class")]
  50. /**
  51. * @copy fl.controls.LabelButton#style:selectedUpIcon * * @default RadioButton_selectedUpIcon * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  52. */
  53. [Style(name="selectedUpIcon", type="Class")]
  54. /**
  55. * @copy fl.controls.LabelButton#style:selectedDownIcon * * @default RadioButton_selectedDownIcon * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  56. */
  57. [Style(name="selectedDownIcon", type="Class")]
  58. /**
  59. * @copy fl.controls.LabelButton#style:selectedOverIcon * * @default RadioButton_selectedOverIcon * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  60. */
  61. [Style(name="selectedOverIcon", type="Class")]
  62. /**
  63. * @copy fl.controls.LabelButton#style:textPadding * * @default 5 * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  64. */
  65. [Style(name="textPadding", type="Number", format="Length")]
  66. /**
  67. * The RadioButton component lets you force a user to make a single * selection from a set of choices. This component must be used in a * group of at least two RadioButton instances. Only one member of * the group can be selected at any given time. Selecting one radio * button in a group deselects the currently selected radio button * in the group. You set the <code>groupName</code> parameter to indicate which * group a radio button belongs to. When the user clicks or tabs into a RadioButton * component group, only the selected radio button receives focus. * * <p>A radio button can be enabled or disabled. A disabled radio button does not receive mouse or * keyboard input.</p> * * @see RadioButtonGroup * * @includeExample examples/RadioButtonExample.as * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  68. */
  69. public class RadioButton extends LabelButton implements IFocusManagerGroup
  70. {
  71. /**
  72. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  73. */
  74. protected var _value : Object;
  75. /**
  76. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0 * The RadioButtonGroup object to which this RadioButton component instance belongs.
  77. */
  78. protected var _group : RadioButtonGroup;
  79. /**
  80. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  81. */
  82. protected var defaultGroupName : String;
  83. /**
  84. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  85. */
  86. private static var defaultStyles : Object;
  87. /**
  88. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  89. */
  90. public static var createAccessibilityImplementation : Function;
  91. /**
  92. * A radio button is a toggle button; its <code>toggle</code> property is set to * <code>true</code> in the constructor and cannot be changed. * * @throws Error This property cannot be set on the RadioButton. * * @default true * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  93. */
  94. public function get toggle () : Boolean;
  95. /**
  96. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  97. */
  98. public function set toggle (value:Boolean) : void;
  99. /**
  100. * A radio button never auto-repeats by definition, so the <code>autoRepeat</code> property is set to * <code>false</code> in the constructor and cannot be changed. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  101. */
  102. public function get autoRepeat () : Boolean;
  103. /**
  104. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  105. */
  106. public function set autoRepeat (value:Boolean) : void;
  107. /**
  108. * Indicates whether a radio button is currently selected (<code>true</code>) or deselected (<code>false</code>). * You can only set this value to <code>true</code>; setting it to <code>false</code> has no effect. To * achieve the desired effect, select a different radio button in the same radio button group. * * @default false * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  109. */
  110. public function get selected () : Boolean;
  111. /**
  112. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  113. */
  114. public function set selected (value:Boolean) : void;
  115. /**
  116. * The group name for a radio button instance or group. You can use this property to get * or set a group name for a radio button instance or for a radio button group. * * @default "RadioButtonGroup" * * @includeExample examples/RadioButton.groupName.1.as -noswf * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  117. */
  118. public function get groupName () : String;
  119. /**
  120. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  121. */
  122. public function set groupName (group:String) : void;
  123. /**
  124. * The RadioButtonGroup object to which this RadioButton belongs. * * @includeExample examples/RadioButton.group.1.as -noswf * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  125. */
  126. public function get group () : RadioButtonGroup;
  127. /**
  128. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  129. */
  130. public function set group (name:RadioButtonGroup) : void;
  131. /**
  132. * A user-defined value that is associated with a radio button. * * @default null * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  133. */
  134. public function get value () : Object;
  135. /**
  136. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  137. */
  138. public function set value (val:Object) : void;
  139. /**
  140. * @copy fl.core.UIComponent#getStyleDefinition() * * @includeExample ../core/examples/UIComponent.getStyleDefinition.1.as -noswf * * @see fl.core.UIComponent#getStyle() * @see fl.core.UIComponent#setStyle() * @see fl.managers.StyleManager * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  141. */
  142. public static function getStyleDefinition () : Object;
  143. /**
  144. * Creates a new RadioButton component instance. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  145. */
  146. public function RadioButton ();
  147. /**
  148. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  149. */
  150. protected function configUI () : void;
  151. /**
  152. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  153. */
  154. protected function drawLayout () : void;
  155. /**
  156. * Shows or hides the focus indicator around this component instance. * * @param focused Show or hide the focus indicator. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  157. */
  158. public function drawFocus (focused:Boolean) : void;
  159. /**
  160. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  161. */
  162. protected function handleChange (event:Event) : void;
  163. /**
  164. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  165. */
  166. protected function handleClick (event:MouseEvent) : void;
  167. /**
  168. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  169. */
  170. protected function draw () : void;
  171. /**
  172. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  173. */
  174. protected function drawBackground () : void;
  175. /**
  176. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  177. */
  178. protected function initializeAccessibility () : void;
  179. /**
  180. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  181. */
  182. protected function keyDownHandler (event:KeyboardEvent) : void;
  183. /**
  184. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  185. */
  186. protected function keyUpHandler (event:KeyboardEvent) : void;
  187. /**
  188. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  189. */
  190. private function setPrev (moveSelection:Boolean = true) : void;
  191. /**
  192. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  193. */
  194. private function setNext (moveSelection:Boolean = true) : void;
  195. /**
  196. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  197. */
  198. private function setThis () : void;
  199. }
  200. }