PageRenderTime 135ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://bitbucket.org/kkszysiu/flashdevelop
ActionScript | 148 lines | 48 code | 4 blank | 96 comment | 0 complexity | c0031f130ae1162241ff52319cd0ba43 MD5 | raw file
  1. package fl.controls
  2. {
  3. import fl.core.InvalidationType;
  4. import fl.core.UIComponent;
  5. import fl.events.ComponentEvent;
  6. import flash.display.Sprite;
  7. import flash.events.Event;
  8. import flash.events.TextEvent;
  9. import fl.controls.TextInput;
  10. import flash.text.TextField;
  11. import flash.text.TextFieldAutoSize;
  12. import flash.text.TextFieldType;
  13. import flash.text.TextFormat;
  14. /**
  15. * Dispatched after there is a change in the width or height of the component. * <p><strong>Note:</strong> This event does not occur if you use ActionScript code to change the label text.</p> * * @eventType fl.events.ComponentEvent.RESIZE * * @includeExample examples/Label.resize.1.as -noswf * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  16. */
  17. [Event(name="resize", type="fl.events.ComponentEvent")]
  18. /**
  19. * @copy fl.controls.LabelButton#style:embedFonts * * @default false * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  20. */
  21. [Style(name="embedFonts", type="Boolean")]
  22. /**
  23. * A Label component displays one or more lines of plain or * HTML-formatted text that can be formatted for alignment and * size. Label components do not have borders and cannot receive * focus. * * <p>A live preview of each Label instance reflects the changes * that were made to parameters in the Property inspector or Component * inspector during authoring. Because a Label component does not have a border, * the only way to see the live preview for a Label instance is to set * its <code>text</code> property. The <code>autoSize</code> property is not supported * in live preview.</p> * * @includeExample examples/LabelExample.as * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  24. */
  25. public class Label extends UIComponent
  26. {
  27. /**
  28. * A reference to the internal text field of the Label component. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  29. */
  30. public var textField : TextField;
  31. /**
  32. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  33. */
  34. protected var actualWidth : Number;
  35. /**
  36. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  37. */
  38. protected var actualHeight : Number;
  39. /**
  40. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  41. */
  42. protected var defaultLabel : String;
  43. /**
  44. * @private (protected)
  45. */
  46. protected var _savedHTML : String;
  47. /**
  48. * @private (protected)
  49. */
  50. protected var _html : Boolean;
  51. /**
  52. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  53. */
  54. private static var defaultStyles : Object;
  55. /**
  56. * Gets or sets the plain text to be displayed by the Label component. * * <p>Note that characters that represent HTML markup have no special * meaning in the string and will appear as they were entered.</p> * * <p>To display text that contains HTML tags, use the <code>htmlText</code> * property. The HTML replaces any text that you set by using the <code>htmlText</code> * property, and the <code>text</code> property returns a plain text version of * the HTML text, with the HTML tags removed.</p> * * <p>If the <code>text</code> property is changed from the default value in the * property inspector, it takes precedence over the <code>htmlText</code> * property in the property inspector.</p> * * @default "Label" * * @see #htmlText * @see flash.text.TextField#text * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  57. */
  58. public function get text () : String;
  59. /**
  60. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  61. */
  62. public function set text (value:String) : void;
  63. /**
  64. * Gets or sets the text to be displayed by the Label component, including * HTML markup that expresses the styles of that text. You can specify HTML * text in this property by using the subset of HTML tags that are supported * by the TextField object. * * <p>If the default value of the <code>text</code> property is changed in the * Property inspector, this changed value takes precedence over any value in the * <code>htmlText</code> property field in the Property inspector. To use the * <code>htmlText</code> property in the Property inspector, the <code>text</code> property * field must contain the value <code>Label</code>, exactly as shown. When coding with * ActionScript, you do not need to set the value of the <code>text</code> property; the * default value is <code>Label</code>.</p> * * @default "" * * @see #text * @see flash.text.TextField#htmlText * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  65. */
  66. public function get htmlText () : String;
  67. /**
  68. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  69. */
  70. public function set htmlText (value:String) : void;
  71. /**
  72. * Gets or sets a value that indicates whether extra white space such as spaces * and line breaks should be removed from a Label component that contains HTML text. * A value of <code>true</code> indicates that white space is to be removed; a * value of <code>false</code> indicates that it remains. * * <p>The <code>condenseWhite</code> property affects only text that was set by * using the <code>htmlText</code> property, not the <code>text</code> property. * If you set text by using the <code>text</code> property, the <code>condenseWhite</code> * property is ignored.</p> * * <p>If you set the <code>condenseWhite</code> property to <code>true</code>, * you must use standard HTML commands, such as &lt;br&gt; and &lt;p&gt;, to break * the lines of the text in the text field.</p> * * @default false * * @includeExample examples/Label.condenseWhite.1.as -noswf * * @see #htmlText * @see flash.text.TextField#condenseWhite * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  73. */
  74. public function get condenseWhite () : Boolean;
  75. /**
  76. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  77. */
  78. public function set condenseWhite (value:Boolean) : void;
  79. /**
  80. * Gets or sets a value that indicates whether the text can be selected. A value * of <code>true</code> indicates that it can be selected; a value of <code>false</code> * indicates that it cannot. * * <p>Text that can be selected can be copied from the Label component by the user.</p> * * @default false * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  81. */
  82. public function get selectable () : Boolean;
  83. /**
  84. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  85. */
  86. public function set selectable (value:Boolean) : void;
  87. /**
  88. * Gets or sets a value that indicates whether the text field supports word wrapping. * A value of <code>true</code> indicates that it does; a value of <code>false</code> * indicates that it does not. * * @default false * * @includeExample examples/Label.wordWrap.1.as -noswf * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  89. */
  90. public function get wordWrap () : Boolean;
  91. /**
  92. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  93. */
  94. public function set wordWrap (value:Boolean) : void;
  95. /**
  96. * Gets or sets a string that indicates how a label is sized and aligned to * fit the value of its <code>text</code> property. The following are * valid values: * <ul> * <li><code>TextFieldAutoSize.NONE</code>: The label is not resized or aligned to fit the text.</li> * <li><code>TextFieldAutoSize.LEFT</code>: The right and bottom sides of the label are resized to fit the text. * The left and top sides are not resized.</li> * <li><code>TextFieldAutoSize.CENTER</code>: The left and right sides of the label resize to fit the text. * The horizontal center of the label stays anchored at its original horizontal * center position.</li> * <li><code>TextFieldAutoSize.RIGHT</code>: The left and bottom sides of the label are resized to fit * the text. The top and right sides are not resized.</li> * </ul> * * @default TextFieldAutoSize.NONE * * @includeExample examples/Label.autoSize.1.as -noswf * * @see flash.text.TextFieldAutoSize TextFieldAutoSize * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  97. */
  98. public function get autoSize () : String;
  99. /**
  100. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  101. */
  102. public function set autoSize (value:String) : void;
  103. /**
  104. * @copy fl.core.UIComponent#width * * @see #height * @see fl.core.UIComponent#setSize() * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  105. */
  106. public function get width () : Number;
  107. /**
  108. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  109. */
  110. public function set width (value:Number) : void;
  111. /**
  112. * @copy fl.core.UIComponent#height * * @see #width * @see fl.core.UIComponent#setSize() * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  113. */
  114. public function get height () : Number;
  115. /**
  116. * @copy fl.core.UIComponent#getStyleDefinition() * * @includeExample ../core/examples/UIComponent.getStyleDefinition.1.as -noswf * * @see fl.core.UIComponent#getStyle() UIComponent#getStyle() * @see fl.core.UIComponent#setStyle() UIComponent#setStyle() * @see fl.managers.StyleManager StyleManager * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  117. */
  118. public static function getStyleDefinition () : Object;
  119. /**
  120. * Creates a new Label component instance. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  121. */
  122. public function Label ();
  123. /**
  124. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  125. */
  126. public function setSize (width:Number, height:Number) : void;
  127. /**
  128. * @private (protected)
  129. */
  130. protected function configUI () : void;
  131. /**
  132. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  133. */
  134. protected function draw () : void;
  135. /**
  136. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  137. */
  138. protected function drawTextFormat () : void;
  139. /**
  140. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  141. */
  142. protected function drawLayout () : void;
  143. }
  144. }