2
0

TextField.hx 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. package flash.text;
  2. extern class TextField extends flash.display.InteractiveObject {
  3. @:flash.property var alwaysShowSelection(get,set) : Bool;
  4. @:flash.property var antiAliasType(get,set) : AntiAliasType;
  5. @:flash.property var autoSize(get,set) : TextFieldAutoSize;
  6. @:flash.property var background(get,set) : Bool;
  7. @:flash.property var backgroundColor(get,set) : UInt;
  8. @:flash.property var border(get,set) : Bool;
  9. @:flash.property var borderColor(get,set) : UInt;
  10. @:flash.property var bottomScrollV(get,never) : Int;
  11. @:flash.property var caretIndex(get,never) : Int;
  12. @:flash.property var condenseWhite(get,set) : Bool;
  13. @:flash.property var defaultTextFormat(get,set) : TextFormat;
  14. @:flash.property var displayAsPassword(get,set) : Bool;
  15. @:flash.property var embedFonts(get,set) : Bool;
  16. @:flash.property var gridFitType(get,set) : GridFitType;
  17. @:flash.property var htmlText(get,set) : String;
  18. @:flash.property var length(get,never) : Int;
  19. @:flash.property var maxChars(get,set) : Int;
  20. @:flash.property var maxScrollH(get,never) : Int;
  21. @:flash.property var maxScrollV(get,never) : Int;
  22. @:flash.property var mouseWheelEnabled(get,set) : Bool;
  23. @:flash.property var multiline(get,set) : Bool;
  24. @:flash.property var numLines(get,never) : Int;
  25. @:flash.property var restrict(get,set) : String;
  26. @:flash.property var scrollH(get,set) : Int;
  27. @:flash.property var scrollV(get,set) : Int;
  28. @:flash.property var selectable(get,set) : Bool;
  29. @:flash.property var selectedText(get,never) : String;
  30. @:flash.property var selectionBeginIndex(get,never) : Int;
  31. @:flash.property var selectionEndIndex(get,never) : Int;
  32. @:flash.property var sharpness(get,set) : Float;
  33. @:flash.property var styleSheet(get,set) : StyleSheet;
  34. @:flash.property var text(get,set) : String;
  35. @:flash.property var textColor(get,set) : UInt;
  36. @:flash.property var textHeight(get,never) : Float;
  37. @:flash.property @:require(flash11) var textInteractionMode(get,never) : TextInteractionMode;
  38. @:flash.property var textWidth(get,never) : Float;
  39. @:flash.property var thickness(get,set) : Float;
  40. @:flash.property var type(get,set) : TextFieldType;
  41. @:flash.property var useRichTextClipboard(get,set) : Bool;
  42. @:flash.property var wordWrap(get,set) : Bool;
  43. function new() : Void;
  44. function appendText(newText : String) : Void;
  45. @:ns("flash.text",internal) function copyRichText() : String;
  46. function getCharBoundaries(charIndex : Int) : flash.geom.Rectangle;
  47. function getCharIndexAtPoint(x : Float, y : Float) : Int;
  48. function getFirstCharInParagraph(charIndex : Int) : Int;
  49. function getImageReference(id : String) : flash.display.DisplayObject;
  50. function getLineIndexAtPoint(x : Float, y : Float) : Int;
  51. function getLineIndexOfChar(charIndex : Int) : Int;
  52. function getLineLength(lineIndex : Int) : Int;
  53. function getLineMetrics(lineIndex : Int) : TextLineMetrics;
  54. function getLineOffset(lineIndex : Int) : Int;
  55. function getLineText(lineIndex : Int) : String;
  56. function getParagraphLength(charIndex : Int) : Int;
  57. function getRawText() : String;
  58. function getTextFormat(beginIndex : Int = -1, endIndex : Int = -1) : TextFormat;
  59. function getTextRuns(beginIndex : Int = 0, endIndex : Int = 2147483647) : Array<Dynamic>;
  60. function getXMLText(beginIndex : Int = 0, endIndex : Int = 2147483647) : String;
  61. private function get_alwaysShowSelection() : Bool;
  62. private function get_antiAliasType() : AntiAliasType;
  63. private function get_autoSize() : TextFieldAutoSize;
  64. private function get_background() : Bool;
  65. private function get_backgroundColor() : UInt;
  66. private function get_border() : Bool;
  67. private function get_borderColor() : UInt;
  68. private function get_bottomScrollV() : Int;
  69. private function get_caretIndex() : Int;
  70. private function get_condenseWhite() : Bool;
  71. private function get_defaultTextFormat() : TextFormat;
  72. private function get_displayAsPassword() : Bool;
  73. private function get_embedFonts() : Bool;
  74. private function get_gridFitType() : GridFitType;
  75. private function get_htmlText() : String;
  76. private function get_length() : Int;
  77. private function get_maxChars() : Int;
  78. private function get_maxScrollH() : Int;
  79. private function get_maxScrollV() : Int;
  80. private function get_mouseWheelEnabled() : Bool;
  81. private function get_multiline() : Bool;
  82. private function get_numLines() : Int;
  83. private function get_restrict() : String;
  84. private function get_scrollH() : Int;
  85. private function get_scrollV() : Int;
  86. private function get_selectable() : Bool;
  87. private function get_selectedText() : String;
  88. private function get_selectionBeginIndex() : Int;
  89. private function get_selectionEndIndex() : Int;
  90. private function get_sharpness() : Float;
  91. private function get_styleSheet() : StyleSheet;
  92. private function get_text() : String;
  93. private function get_textColor() : UInt;
  94. private function get_textHeight() : Float;
  95. private function get_textInteractionMode() : TextInteractionMode;
  96. private function get_textWidth() : Float;
  97. private function get_thickness() : Float;
  98. private function get_type() : TextFieldType;
  99. private function get_useRichTextClipboard() : Bool;
  100. private function get_wordWrap() : Bool;
  101. function insertXMLText(beginIndex : Int, endIndex : Int, richText : String, pasting : Bool = false) : Void;
  102. @:ns("flash.text",internal) function pasteRichText(richText : String) : Bool;
  103. function replaceSelectedText(value : String) : Void;
  104. function replaceText(beginIndex : Int, endIndex : Int, newText : String) : Void;
  105. function setSelection(beginIndex : Int, endIndex : Int) : Void;
  106. function setTextFormat(format : TextFormat, beginIndex : Int = -1, endIndex : Int = -1) : Void;
  107. private function set_alwaysShowSelection(value : Bool) : Bool;
  108. private function set_antiAliasType(value : AntiAliasType) : AntiAliasType;
  109. private function set_autoSize(value : TextFieldAutoSize) : TextFieldAutoSize;
  110. private function set_background(value : Bool) : Bool;
  111. private function set_backgroundColor(value : UInt) : UInt;
  112. private function set_border(value : Bool) : Bool;
  113. private function set_borderColor(value : UInt) : UInt;
  114. private function set_condenseWhite(value : Bool) : Bool;
  115. private function set_defaultTextFormat(value : TextFormat) : TextFormat;
  116. private function set_displayAsPassword(value : Bool) : Bool;
  117. private function set_embedFonts(value : Bool) : Bool;
  118. private function set_gridFitType(value : GridFitType) : GridFitType;
  119. private function set_htmlText(value : String) : String;
  120. private function set_maxChars(value : Int) : Int;
  121. private function set_mouseWheelEnabled(value : Bool) : Bool;
  122. private function set_multiline(value : Bool) : Bool;
  123. private function set_restrict(value : String) : String;
  124. private function set_scrollH(value : Int) : Int;
  125. private function set_scrollV(value : Int) : Int;
  126. private function set_selectable(value : Bool) : Bool;
  127. private function set_sharpness(value : Float) : Float;
  128. private function set_styleSheet(value : StyleSheet) : StyleSheet;
  129. private function set_text(value : String) : String;
  130. private function set_textColor(value : UInt) : UInt;
  131. private function set_thickness(value : Float) : Float;
  132. private function set_type(value : TextFieldType) : TextFieldType;
  133. private function set_useRichTextClipboard(value : Bool) : Bool;
  134. private function set_wordWrap(value : Bool) : Bool;
  135. @:require(flash10) static function isFontCompatible(fontName : String, fontStyle : String) : Bool;
  136. }