class_textedit.rst 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the TextEdit.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_TextEdit:
  5. TextEdit
  6. ========
  7. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Multiline text editing control.
  12. Properties
  13. ----------
  14. +-----------------------------+----------------------------------------------------------------------------------+
  15. | :ref:`bool<class_bool>` | :ref:`breakpoint_gutter<class_TextEdit_breakpoint_gutter>` |
  16. +-----------------------------+----------------------------------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`caret_blink<class_TextEdit_caret_blink>` |
  18. +-----------------------------+----------------------------------------------------------------------------------+
  19. | :ref:`float<class_float>` | :ref:`caret_blink_speed<class_TextEdit_caret_blink_speed>` |
  20. +-----------------------------+----------------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`caret_block_mode<class_TextEdit_caret_block_mode>` |
  22. +-----------------------------+----------------------------------------------------------------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`caret_moving_by_right_click<class_TextEdit_caret_moving_by_right_click>` |
  24. +-----------------------------+----------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`context_menu_enabled<class_TextEdit_context_menu_enabled>` |
  26. +-----------------------------+----------------------------------------------------------------------------------+
  27. | :ref:`int<class_int>` | :ref:`hiding_enabled<class_TextEdit_hiding_enabled>` |
  28. +-----------------------------+----------------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`highlight_all_occurrences<class_TextEdit_highlight_all_occurrences>` |
  30. +-----------------------------+----------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`highlight_current_line<class_TextEdit_highlight_current_line>` |
  32. +-----------------------------+----------------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`override_selected_font_color<class_TextEdit_override_selected_font_color>` |
  34. +-----------------------------+----------------------------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`readonly<class_TextEdit_readonly>` |
  36. +-----------------------------+----------------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`show_line_numbers<class_TextEdit_show_line_numbers>` |
  38. +-----------------------------+----------------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`smooth_scrolling<class_TextEdit_smooth_scrolling>` |
  40. +-----------------------------+----------------------------------------------------------------------------------+
  41. | :ref:`bool<class_bool>` | :ref:`syntax_highlighting<class_TextEdit_syntax_highlighting>` |
  42. +-----------------------------+----------------------------------------------------------------------------------+
  43. | :ref:`String<class_String>` | :ref:`text<class_TextEdit_text>` |
  44. +-----------------------------+----------------------------------------------------------------------------------+
  45. | :ref:`float<class_float>` | :ref:`v_scroll_speed<class_TextEdit_v_scroll_speed>` |
  46. +-----------------------------+----------------------------------------------------------------------------------+
  47. | :ref:`bool<class_bool>` | :ref:`wrap_enabled<class_TextEdit_wrap_enabled>` |
  48. +-----------------------------+----------------------------------------------------------------------------------+
  49. Methods
  50. -------
  51. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | void | :ref:`add_color_region<class_TextEdit_add_color_region>` **(** :ref:`String<class_String>` begin_key, :ref:`String<class_String>` end_key, :ref:`Color<class_Color>` color, :ref:`bool<class_bool>` line_only=false **)** |
  53. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | void | :ref:`add_keyword_color<class_TextEdit_add_keyword_color>` **(** :ref:`String<class_String>` keyword, :ref:`Color<class_Color>` color **)** |
  55. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`bool<class_bool>` | :ref:`can_fold<class_TextEdit_can_fold>` **(** :ref:`int<class_int>` line **)** const |
  57. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | void | :ref:`clear_colors<class_TextEdit_clear_colors>` **(** **)** |
  59. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | void | :ref:`clear_undo_history<class_TextEdit_clear_undo_history>` **(** **)** |
  61. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | void | :ref:`copy<class_TextEdit_copy>` **(** **)** |
  63. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`int<class_int>` | :ref:`cursor_get_column<class_TextEdit_cursor_get_column>` **(** **)** const |
  65. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`int<class_int>` | :ref:`cursor_get_line<class_TextEdit_cursor_get_line>` **(** **)** const |
  67. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | void | :ref:`cursor_set_column<class_TextEdit_cursor_set_column>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true **)** |
  69. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | void | :ref:`cursor_set_line<class_TextEdit_cursor_set_line>` **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` adjust_viewport=true, :ref:`bool<class_bool>` can_be_hidden=true, :ref:`int<class_int>` wrap_index=0 **)** |
  71. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | void | :ref:`cut<class_TextEdit_cut>` **(** **)** |
  73. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`deselect<class_TextEdit_deselect>` **(** **)** |
  75. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`fold_all_lines<class_TextEdit_fold_all_lines>` **(** **)** |
  77. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`fold_line<class_TextEdit_fold_line>` **(** :ref:`int<class_int>` line **)** |
  79. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`Array<class_Array>` | :ref:`get_breakpoints<class_TextEdit_get_breakpoints>` **(** **)** const |
  81. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`Color<class_Color>` | :ref:`get_keyword_color<class_TextEdit_get_keyword_color>` **(** :ref:`String<class_String>` keyword **)** const |
  83. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`String<class_String>` | :ref:`get_line<class_TextEdit_get_line>` **(** :ref:`int<class_int>` line **)** const |
  85. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`int<class_int>` | :ref:`get_line_count<class_TextEdit_get_line_count>` **(** **)** const |
  87. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_menu<class_TextEdit_get_menu>` **(** **)** const |
  89. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`int<class_int>` | :ref:`get_selection_from_column<class_TextEdit_get_selection_from_column>` **(** **)** const |
  91. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`int<class_int>` | :ref:`get_selection_from_line<class_TextEdit_get_selection_from_line>` **(** **)** const |
  93. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`String<class_String>` | :ref:`get_selection_text<class_TextEdit_get_selection_text>` **(** **)** const |
  95. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`int<class_int>` | :ref:`get_selection_to_column<class_TextEdit_get_selection_to_column>` **(** **)** const |
  97. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`int<class_int>` | :ref:`get_selection_to_line<class_TextEdit_get_selection_to_line>` **(** **)** const |
  99. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`String<class_String>` | :ref:`get_word_under_cursor<class_TextEdit_get_word_under_cursor>` **(** **)** const |
  101. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`bool<class_bool>` | :ref:`has_keyword_color<class_TextEdit_has_keyword_color>` **(** :ref:`String<class_String>` keyword **)** const |
  103. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | void | :ref:`insert_text_at_cursor<class_TextEdit_insert_text_at_cursor>` **(** :ref:`String<class_String>` text **)** |
  105. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`bool<class_bool>` | :ref:`is_folded<class_TextEdit_is_folded>` **(** :ref:`int<class_int>` line **)** const |
  107. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`bool<class_bool>` | :ref:`is_line_hidden<class_TextEdit_is_line_hidden>` **(** :ref:`int<class_int>` line **)** const |
  109. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`bool<class_bool>` | :ref:`is_selection_active<class_TextEdit_is_selection_active>` **(** **)** const |
  111. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | void | :ref:`menu_option<class_TextEdit_menu_option>` **(** :ref:`int<class_int>` option **)** |
  113. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | void | :ref:`paste<class_TextEdit_paste>` **(** **)** |
  115. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | void | :ref:`redo<class_TextEdit_redo>` **(** **)** |
  117. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | void | :ref:`remove_breakpoints<class_TextEdit_remove_breakpoints>` **(** **)** |
  119. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`search<class_TextEdit_search>` **(** :ref:`String<class_String>` key, :ref:`int<class_int>` flags, :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column **)** const |
  121. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | void | :ref:`select<class_TextEdit_select>` **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column, :ref:`int<class_int>` to_line, :ref:`int<class_int>` to_column **)** |
  123. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | void | :ref:`select_all<class_TextEdit_select_all>` **(** **)** |
  125. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | void | :ref:`set_line_as_hidden<class_TextEdit_set_line_as_hidden>` **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` enable **)** |
  127. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | void | :ref:`toggle_fold_line<class_TextEdit_toggle_fold_line>` **(** :ref:`int<class_int>` line **)** |
  129. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | void | :ref:`undo<class_TextEdit_undo>` **(** **)** |
  131. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | void | :ref:`unfold_line<class_TextEdit_unfold_line>` **(** :ref:`int<class_int>` line **)** |
  133. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | void | :ref:`unhide_all_lines<class_TextEdit_unhide_all_lines>` **(** **)** |
  135. +------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. Theme Properties
  137. ----------------
  138. +---------------------------------+--------------------------------------------------------------------------------+
  139. | :ref:`Color<class_Color>` | :ref:`background_color<class_TextEdit_background_color>` |
  140. +---------------------------------+--------------------------------------------------------------------------------+
  141. | :ref:`Color<class_Color>` | :ref:`brace_mismatch_color<class_TextEdit_brace_mismatch_color>` |
  142. +---------------------------------+--------------------------------------------------------------------------------+
  143. | :ref:`Color<class_Color>` | :ref:`breakpoint_color<class_TextEdit_breakpoint_color>` |
  144. +---------------------------------+--------------------------------------------------------------------------------+
  145. | :ref:`Color<class_Color>` | :ref:`caret_background_color<class_TextEdit_caret_background_color>` |
  146. +---------------------------------+--------------------------------------------------------------------------------+
  147. | :ref:`Color<class_Color>` | :ref:`caret_color<class_TextEdit_caret_color>` |
  148. +---------------------------------+--------------------------------------------------------------------------------+
  149. | :ref:`Color<class_Color>` | :ref:`code_folding_color<class_TextEdit_code_folding_color>` |
  150. +---------------------------------+--------------------------------------------------------------------------------+
  151. | :ref:`StyleBox<class_StyleBox>` | :ref:`completion<class_TextEdit_completion>` |
  152. +---------------------------------+--------------------------------------------------------------------------------+
  153. | :ref:`Color<class_Color>` | :ref:`completion_background_color<class_TextEdit_completion_background_color>` |
  154. +---------------------------------+--------------------------------------------------------------------------------+
  155. | :ref:`Color<class_Color>` | :ref:`completion_existing_color<class_TextEdit_completion_existing_color>` |
  156. +---------------------------------+--------------------------------------------------------------------------------+
  157. | :ref:`Color<class_Color>` | :ref:`completion_font_color<class_TextEdit_completion_font_color>` |
  158. +---------------------------------+--------------------------------------------------------------------------------+
  159. | :ref:`int<class_int>` | :ref:`completion_lines<class_TextEdit_completion_lines>` |
  160. +---------------------------------+--------------------------------------------------------------------------------+
  161. | :ref:`int<class_int>` | :ref:`completion_max_width<class_TextEdit_completion_max_width>` |
  162. +---------------------------------+--------------------------------------------------------------------------------+
  163. | :ref:`Color<class_Color>` | :ref:`completion_scroll_color<class_TextEdit_completion_scroll_color>` |
  164. +---------------------------------+--------------------------------------------------------------------------------+
  165. | :ref:`int<class_int>` | :ref:`completion_scroll_width<class_TextEdit_completion_scroll_width>` |
  166. +---------------------------------+--------------------------------------------------------------------------------+
  167. | :ref:`Color<class_Color>` | :ref:`completion_selected_color<class_TextEdit_completion_selected_color>` |
  168. +---------------------------------+--------------------------------------------------------------------------------+
  169. | :ref:`Color<class_Color>` | :ref:`current_line_color<class_TextEdit_current_line_color>` |
  170. +---------------------------------+--------------------------------------------------------------------------------+
  171. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_TextEdit_focus>` |
  172. +---------------------------------+--------------------------------------------------------------------------------+
  173. | :ref:`Font<class_Font>` | :ref:`font<class_TextEdit_font>` |
  174. +---------------------------------+--------------------------------------------------------------------------------+
  175. | :ref:`Color<class_Color>` | :ref:`font_color<class_TextEdit_font_color>` |
  176. +---------------------------------+--------------------------------------------------------------------------------+
  177. | :ref:`Color<class_Color>` | :ref:`font_color_selected<class_TextEdit_font_color_selected>` |
  178. +---------------------------------+--------------------------------------------------------------------------------+
  179. | :ref:`Color<class_Color>` | :ref:`function_color<class_TextEdit_function_color>` |
  180. +---------------------------------+--------------------------------------------------------------------------------+
  181. | :ref:`Color<class_Color>` | :ref:`line_number_color<class_TextEdit_line_number_color>` |
  182. +---------------------------------+--------------------------------------------------------------------------------+
  183. | :ref:`int<class_int>` | :ref:`line_spacing<class_TextEdit_line_spacing>` |
  184. +---------------------------------+--------------------------------------------------------------------------------+
  185. | :ref:`Color<class_Color>` | :ref:`mark_color<class_TextEdit_mark_color>` |
  186. +---------------------------------+--------------------------------------------------------------------------------+
  187. | :ref:`Color<class_Color>` | :ref:`member_variable_color<class_TextEdit_member_variable_color>` |
  188. +---------------------------------+--------------------------------------------------------------------------------+
  189. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_TextEdit_normal>` |
  190. +---------------------------------+--------------------------------------------------------------------------------+
  191. | :ref:`Color<class_Color>` | :ref:`number_color<class_TextEdit_number_color>` |
  192. +---------------------------------+--------------------------------------------------------------------------------+
  193. | :ref:`StyleBox<class_StyleBox>` | :ref:`read_only<class_TextEdit_read_only>` |
  194. +---------------------------------+--------------------------------------------------------------------------------+
  195. | :ref:`Color<class_Color>` | :ref:`safe_line_number_color<class_TextEdit_safe_line_number_color>` |
  196. +---------------------------------+--------------------------------------------------------------------------------+
  197. | :ref:`Color<class_Color>` | :ref:`selection_color<class_TextEdit_selection_color>` |
  198. +---------------------------------+--------------------------------------------------------------------------------+
  199. | :ref:`Color<class_Color>` | :ref:`symbol_color<class_TextEdit_symbol_color>` |
  200. +---------------------------------+--------------------------------------------------------------------------------+
  201. | :ref:`Texture<class_Texture>` | :ref:`tab<class_TextEdit_tab>` |
  202. +---------------------------------+--------------------------------------------------------------------------------+
  203. | :ref:`Color<class_Color>` | :ref:`word_highlighted_color<class_TextEdit_word_highlighted_color>` |
  204. +---------------------------------+--------------------------------------------------------------------------------+
  205. Signals
  206. -------
  207. .. _class_TextEdit_breakpoint_toggled:
  208. - **breakpoint_toggled** **(** :ref:`int<class_int>` row **)**
  209. Emitted when a breakpoint is placed via the breakpoint gutter.
  210. .. _class_TextEdit_cursor_changed:
  211. - **cursor_changed** **(** **)**
  212. Emitted when the cursor changes.
  213. .. _class_TextEdit_request_completion:
  214. - **request_completion** **(** **)**
  215. .. _class_TextEdit_symbol_lookup:
  216. - **symbol_lookup** **(** :ref:`String<class_String>` symbol, :ref:`int<class_int>` row, :ref:`int<class_int>` column **)**
  217. .. _class_TextEdit_text_changed:
  218. - **text_changed** **(** **)**
  219. Emitted when the text changes.
  220. Enumerations
  221. ------------
  222. .. _enum_TextEdit_SearchFlags:
  223. enum **SearchFlags**:
  224. - **SEARCH_MATCH_CASE** = **1** --- Match case when searching.
  225. - **SEARCH_WHOLE_WORDS** = **2** --- Match whole words when searching.
  226. - **SEARCH_BACKWARDS** = **4** --- Search from end to beginning.
  227. .. _enum_TextEdit_MenuItems:
  228. enum **MenuItems**:
  229. - **MENU_CUT** = **0** --- Cuts (Copies and clears) the selected text.
  230. - **MENU_COPY** = **1** --- Copies the selected text.
  231. - **MENU_PASTE** = **2** --- Pastes the clipboard text over the selected text (or at the cursor's position).
  232. - **MENU_CLEAR** = **3** --- Erases the whole :ref:`TextEdit<class_TextEdit>` text.
  233. - **MENU_SELECT_ALL** = **4** --- Selects the whole :ref:`TextEdit<class_TextEdit>` text.
  234. - **MENU_UNDO** = **5** --- Undoes the previous action.
  235. - **MENU_REDO** = **6**
  236. - **MENU_MAX** = **7**
  237. Description
  238. -----------
  239. TextEdit is meant for editing large, multiline text. It also has facilities for editing code, such as syntax highlighting support and multiple levels of undo/redo.
  240. Property Descriptions
  241. ---------------------
  242. .. _class_TextEdit_breakpoint_gutter:
  243. - :ref:`bool<class_bool>` **breakpoint_gutter**
  244. +----------+--------------------------------------+
  245. | *Setter* | set_breakpoint_gutter_enabled(value) |
  246. +----------+--------------------------------------+
  247. | *Getter* | is_breakpoint_gutter_enabled() |
  248. +----------+--------------------------------------+
  249. If ``true``, the breakpoint gutter is visible.
  250. .. _class_TextEdit_caret_blink:
  251. - :ref:`bool<class_bool>` **caret_blink**
  252. +----------+---------------------------------+
  253. | *Setter* | cursor_set_blink_enabled(value) |
  254. +----------+---------------------------------+
  255. | *Getter* | cursor_get_blink_enabled() |
  256. +----------+---------------------------------+
  257. If ``true``, the caret (visual cursor) blinks.
  258. .. _class_TextEdit_caret_blink_speed:
  259. - :ref:`float<class_float>` **caret_blink_speed**
  260. +----------+-------------------------------+
  261. | *Setter* | cursor_set_blink_speed(value) |
  262. +----------+-------------------------------+
  263. | *Getter* | cursor_get_blink_speed() |
  264. +----------+-------------------------------+
  265. Duration (in seconds) of a caret's blinking cycle.
  266. .. _class_TextEdit_caret_block_mode:
  267. - :ref:`bool<class_bool>` **caret_block_mode**
  268. +----------+------------------------------+
  269. | *Setter* | cursor_set_block_mode(value) |
  270. +----------+------------------------------+
  271. | *Getter* | cursor_is_block_mode() |
  272. +----------+------------------------------+
  273. If ``true``, the caret displays as a rectangle.
  274. If ``false``, the caret displays as a bar.
  275. .. _class_TextEdit_caret_moving_by_right_click:
  276. - :ref:`bool<class_bool>` **caret_moving_by_right_click**
  277. +----------+------------------------------------+
  278. | *Setter* | set_right_click_moves_caret(value) |
  279. +----------+------------------------------------+
  280. | *Getter* | is_right_click_moving_caret() |
  281. +----------+------------------------------------+
  282. If ``true``, a right click moves the cursor at the mouse position before displaying the context menu.
  283. If ``false``, the context menu disregards mouse location.
  284. .. _class_TextEdit_context_menu_enabled:
  285. - :ref:`bool<class_bool>` **context_menu_enabled**
  286. +----------+---------------------------------+
  287. | *Setter* | set_context_menu_enabled(value) |
  288. +----------+---------------------------------+
  289. | *Getter* | is_context_menu_enabled() |
  290. +----------+---------------------------------+
  291. If ``true``, a right click displays the context menu.
  292. .. _class_TextEdit_hiding_enabled:
  293. - :ref:`int<class_int>` **hiding_enabled**
  294. +----------+---------------------------+
  295. | *Setter* | set_hiding_enabled(value) |
  296. +----------+---------------------------+
  297. | *Getter* | is_hiding_enabled() |
  298. +----------+---------------------------+
  299. .. _class_TextEdit_highlight_all_occurrences:
  300. - :ref:`bool<class_bool>` **highlight_all_occurrences**
  301. +----------+----------------------------------------+
  302. | *Setter* | set_highlight_all_occurrences(value) |
  303. +----------+----------------------------------------+
  304. | *Getter* | is_highlight_all_occurrences_enabled() |
  305. +----------+----------------------------------------+
  306. .. _class_TextEdit_highlight_current_line:
  307. - :ref:`bool<class_bool>` **highlight_current_line**
  308. +----------+-------------------------------------+
  309. | *Setter* | set_highlight_current_line(value) |
  310. +----------+-------------------------------------+
  311. | *Getter* | is_highlight_current_line_enabled() |
  312. +----------+-------------------------------------+
  313. If ``true``, the line containing the cursor is highlighted.
  314. .. _class_TextEdit_override_selected_font_color:
  315. - :ref:`bool<class_bool>` **override_selected_font_color**
  316. +----------+-----------------------------------------+
  317. | *Setter* | set_override_selected_font_color(value) |
  318. +----------+-----------------------------------------+
  319. | *Getter* | is_overriding_selected_font_color() |
  320. +----------+-----------------------------------------+
  321. .. _class_TextEdit_readonly:
  322. - :ref:`bool<class_bool>` **readonly**
  323. +----------+---------------------+
  324. | *Setter* | set_readonly(value) |
  325. +----------+---------------------+
  326. | *Getter* | is_readonly() |
  327. +----------+---------------------+
  328. If ``true``, read-only mode is enabled. Existing text cannot be modified and new text cannot be added.
  329. .. _class_TextEdit_show_line_numbers:
  330. - :ref:`bool<class_bool>` **show_line_numbers**
  331. +----------+--------------------------------+
  332. | *Setter* | set_show_line_numbers(value) |
  333. +----------+--------------------------------+
  334. | *Getter* | is_show_line_numbers_enabled() |
  335. +----------+--------------------------------+
  336. If ``true``, line numbers are displayed to the left of the text.
  337. .. _class_TextEdit_smooth_scrolling:
  338. - :ref:`bool<class_bool>` **smooth_scrolling**
  339. +----------+---------------------------------+
  340. | *Setter* | set_smooth_scroll_enable(value) |
  341. +----------+---------------------------------+
  342. | *Getter* | is_smooth_scroll_enabled() |
  343. +----------+---------------------------------+
  344. .. _class_TextEdit_syntax_highlighting:
  345. - :ref:`bool<class_bool>` **syntax_highlighting**
  346. +----------+------------------------------+
  347. | *Setter* | set_syntax_coloring(value) |
  348. +----------+------------------------------+
  349. | *Getter* | is_syntax_coloring_enabled() |
  350. +----------+------------------------------+
  351. .. _class_TextEdit_text:
  352. - :ref:`String<class_String>` **text**
  353. +----------+-----------------+
  354. | *Setter* | set_text(value) |
  355. +----------+-----------------+
  356. | *Getter* | get_text() |
  357. +----------+-----------------+
  358. String value of the :ref:`TextEdit<class_TextEdit>`.
  359. .. _class_TextEdit_v_scroll_speed:
  360. - :ref:`float<class_float>` **v_scroll_speed**
  361. +----------+---------------------------+
  362. | *Setter* | set_v_scroll_speed(value) |
  363. +----------+---------------------------+
  364. | *Getter* | get_v_scroll_speed() |
  365. +----------+---------------------------+
  366. If ``true``, enables text wrapping when it goes beyond he edge of what is visible.
  367. .. _class_TextEdit_wrap_enabled:
  368. - :ref:`bool<class_bool>` **wrap_enabled**
  369. +----------+-------------------------+
  370. | *Setter* | set_wrap_enabled(value) |
  371. +----------+-------------------------+
  372. | *Getter* | is_wrap_enabled() |
  373. +----------+-------------------------+
  374. Method Descriptions
  375. -------------------
  376. .. _class_TextEdit_add_color_region:
  377. - void **add_color_region** **(** :ref:`String<class_String>` begin_key, :ref:`String<class_String>` end_key, :ref:`Color<class_Color>` color, :ref:`bool<class_bool>` line_only=false **)**
  378. Add color region (given the delimiters) and its colors.
  379. .. _class_TextEdit_add_keyword_color:
  380. - void **add_keyword_color** **(** :ref:`String<class_String>` keyword, :ref:`Color<class_Color>` color **)**
  381. Add a keyword and its color.
  382. .. _class_TextEdit_can_fold:
  383. - :ref:`bool<class_bool>` **can_fold** **(** :ref:`int<class_int>` line **)** const
  384. .. _class_TextEdit_clear_colors:
  385. - void **clear_colors** **(** **)**
  386. Clear all the syntax coloring information.
  387. .. _class_TextEdit_clear_undo_history:
  388. - void **clear_undo_history** **(** **)**
  389. Clear the undo history.
  390. .. _class_TextEdit_copy:
  391. - void **copy** **(** **)**
  392. Copy the current selection.
  393. .. _class_TextEdit_cursor_get_column:
  394. - :ref:`int<class_int>` **cursor_get_column** **(** **)** const
  395. Return the column the editing cursor is at.
  396. .. _class_TextEdit_cursor_get_line:
  397. - :ref:`int<class_int>` **cursor_get_line** **(** **)** const
  398. Return the line the editing cursor is at.
  399. .. _class_TextEdit_cursor_set_column:
  400. - void **cursor_set_column** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true **)**
  401. .. _class_TextEdit_cursor_set_line:
  402. - void **cursor_set_line** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` adjust_viewport=true, :ref:`bool<class_bool>` can_be_hidden=true, :ref:`int<class_int>` wrap_index=0 **)**
  403. .. _class_TextEdit_cut:
  404. - void **cut** **(** **)**
  405. Cut the current selection.
  406. .. _class_TextEdit_deselect:
  407. - void **deselect** **(** **)**
  408. Clears the current selection.
  409. .. _class_TextEdit_fold_all_lines:
  410. - void **fold_all_lines** **(** **)**
  411. .. _class_TextEdit_fold_line:
  412. - void **fold_line** **(** :ref:`int<class_int>` line **)**
  413. .. _class_TextEdit_get_breakpoints:
  414. - :ref:`Array<class_Array>` **get_breakpoints** **(** **)** const
  415. Return an array containing the line number of each breakpoint.
  416. .. _class_TextEdit_get_keyword_color:
  417. - :ref:`Color<class_Color>` **get_keyword_color** **(** :ref:`String<class_String>` keyword **)** const
  418. .. _class_TextEdit_get_line:
  419. - :ref:`String<class_String>` **get_line** **(** :ref:`int<class_int>` line **)** const
  420. Return the text of a specific line.
  421. .. _class_TextEdit_get_line_count:
  422. - :ref:`int<class_int>` **get_line_count** **(** **)** const
  423. Return the amount of total lines in the text.
  424. .. _class_TextEdit_get_menu:
  425. - :ref:`PopupMenu<class_PopupMenu>` **get_menu** **(** **)** const
  426. .. _class_TextEdit_get_selection_from_column:
  427. - :ref:`int<class_int>` **get_selection_from_column** **(** **)** const
  428. Return the selection begin column.
  429. .. _class_TextEdit_get_selection_from_line:
  430. - :ref:`int<class_int>` **get_selection_from_line** **(** **)** const
  431. Return the selection begin line.
  432. .. _class_TextEdit_get_selection_text:
  433. - :ref:`String<class_String>` **get_selection_text** **(** **)** const
  434. Return the text inside the selection.
  435. .. _class_TextEdit_get_selection_to_column:
  436. - :ref:`int<class_int>` **get_selection_to_column** **(** **)** const
  437. Return the selection end column.
  438. .. _class_TextEdit_get_selection_to_line:
  439. - :ref:`int<class_int>` **get_selection_to_line** **(** **)** const
  440. Return the selection end line.
  441. .. _class_TextEdit_get_word_under_cursor:
  442. - :ref:`String<class_String>` **get_word_under_cursor** **(** **)** const
  443. .. _class_TextEdit_has_keyword_color:
  444. - :ref:`bool<class_bool>` **has_keyword_color** **(** :ref:`String<class_String>` keyword **)** const
  445. .. _class_TextEdit_insert_text_at_cursor:
  446. - void **insert_text_at_cursor** **(** :ref:`String<class_String>` text **)**
  447. Insert a given text at the cursor position.
  448. .. _class_TextEdit_is_folded:
  449. - :ref:`bool<class_bool>` **is_folded** **(** :ref:`int<class_int>` line **)** const
  450. .. _class_TextEdit_is_line_hidden:
  451. - :ref:`bool<class_bool>` **is_line_hidden** **(** :ref:`int<class_int>` line **)** const
  452. .. _class_TextEdit_is_selection_active:
  453. - :ref:`bool<class_bool>` **is_selection_active** **(** **)** const
  454. Return true if the selection is active.
  455. .. _class_TextEdit_menu_option:
  456. - void **menu_option** **(** :ref:`int<class_int>` option **)**
  457. .. _class_TextEdit_paste:
  458. - void **paste** **(** **)**
  459. Paste the current selection.
  460. .. _class_TextEdit_redo:
  461. - void **redo** **(** **)**
  462. Perform redo operation.
  463. .. _class_TextEdit_remove_breakpoints:
  464. - void **remove_breakpoints** **(** **)**
  465. Removes all the breakpoints (without firing "breakpoint_toggled" signal).
  466. .. _class_TextEdit_search:
  467. - :ref:`PoolIntArray<class_PoolIntArray>` **search** **(** :ref:`String<class_String>` key, :ref:`int<class_int>` flags, :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column **)** const
  468. Perform a search inside the text. Search flags can be specified in the SEARCH\_\* enum.
  469. .. _class_TextEdit_select:
  470. - void **select** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column, :ref:`int<class_int>` to_line, :ref:`int<class_int>` to_column **)**
  471. Perform selection, from line/column to line/column.
  472. .. _class_TextEdit_select_all:
  473. - void **select_all** **(** **)**
  474. Select all the text.
  475. .. _class_TextEdit_set_line_as_hidden:
  476. - void **set_line_as_hidden** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` enable **)**
  477. .. _class_TextEdit_toggle_fold_line:
  478. - void **toggle_fold_line** **(** :ref:`int<class_int>` line **)**
  479. Toggle the folding of the code block at the given line.
  480. .. _class_TextEdit_undo:
  481. - void **undo** **(** **)**
  482. Perform undo operation.
  483. .. _class_TextEdit_unfold_line:
  484. - void **unfold_line** **(** :ref:`int<class_int>` line **)**
  485. .. _class_TextEdit_unhide_all_lines:
  486. - void **unhide_all_lines** **(** **)**