class_textedit.rst 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  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_property_breakpoint_gutter>` |
  16. +-----------------------------+-------------------------------------------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`caret_blink<class_TextEdit_property_caret_blink>` |
  18. +-----------------------------+-------------------------------------------------------------------------------------------+
  19. | :ref:`float<class_float>` | :ref:`caret_blink_speed<class_TextEdit_property_caret_blink_speed>` |
  20. +-----------------------------+-------------------------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`caret_block_mode<class_TextEdit_property_caret_block_mode>` |
  22. +-----------------------------+-------------------------------------------------------------------------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`caret_moving_by_right_click<class_TextEdit_property_caret_moving_by_right_click>` |
  24. +-----------------------------+-------------------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`context_menu_enabled<class_TextEdit_property_context_menu_enabled>` |
  26. +-----------------------------+-------------------------------------------------------------------------------------------+
  27. | :ref:`int<class_int>` | :ref:`hiding_enabled<class_TextEdit_property_hiding_enabled>` |
  28. +-----------------------------+-------------------------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`highlight_all_occurrences<class_TextEdit_property_highlight_all_occurrences>` |
  30. +-----------------------------+-------------------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`highlight_current_line<class_TextEdit_property_highlight_current_line>` |
  32. +-----------------------------+-------------------------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`override_selected_font_color<class_TextEdit_property_override_selected_font_color>` |
  34. +-----------------------------+-------------------------------------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`readonly<class_TextEdit_property_readonly>` |
  36. +-----------------------------+-------------------------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`show_line_numbers<class_TextEdit_property_show_line_numbers>` |
  38. +-----------------------------+-------------------------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`smooth_scrolling<class_TextEdit_property_smooth_scrolling>` |
  40. +-----------------------------+-------------------------------------------------------------------------------------------+
  41. | :ref:`bool<class_bool>` | :ref:`syntax_highlighting<class_TextEdit_property_syntax_highlighting>` |
  42. +-----------------------------+-------------------------------------------------------------------------------------------+
  43. | :ref:`String<class_String>` | :ref:`text<class_TextEdit_property_text>` |
  44. +-----------------------------+-------------------------------------------------------------------------------------------+
  45. | :ref:`float<class_float>` | :ref:`v_scroll_speed<class_TextEdit_property_v_scroll_speed>` |
  46. +-----------------------------+-------------------------------------------------------------------------------------------+
  47. | :ref:`bool<class_bool>` | :ref:`wrap_enabled<class_TextEdit_property_wrap_enabled>` |
  48. +-----------------------------+-------------------------------------------------------------------------------------------+
  49. Methods
  50. -------
  51. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | void | :ref:`add_color_region<class_TextEdit_method_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_method_add_keyword_color>` **(** :ref:`String<class_String>` keyword, :ref:`Color<class_Color>` color **)** |
  55. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`bool<class_bool>` | :ref:`can_fold<class_TextEdit_method_can_fold>` **(** :ref:`int<class_int>` line **)** const |
  57. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | void | :ref:`clear_colors<class_TextEdit_method_clear_colors>` **(** **)** |
  59. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | void | :ref:`clear_undo_history<class_TextEdit_method_clear_undo_history>` **(** **)** |
  61. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | void | :ref:`copy<class_TextEdit_method_copy>` **(** **)** |
  63. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`int<class_int>` | :ref:`cursor_get_column<class_TextEdit_method_cursor_get_column>` **(** **)** const |
  65. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`int<class_int>` | :ref:`cursor_get_line<class_TextEdit_method_cursor_get_line>` **(** **)** const |
  67. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | void | :ref:`cursor_set_column<class_TextEdit_method_cursor_set_column>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true **)** |
  69. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | void | :ref:`cursor_set_line<class_TextEdit_method_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_method_cut>` **(** **)** |
  73. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`deselect<class_TextEdit_method_deselect>` **(** **)** |
  75. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`fold_all_lines<class_TextEdit_method_fold_all_lines>` **(** **)** |
  77. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`fold_line<class_TextEdit_method_fold_line>` **(** :ref:`int<class_int>` line **)** |
  79. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`Array<class_Array>` | :ref:`get_breakpoints<class_TextEdit_method_get_breakpoints>` **(** **)** const |
  81. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`Color<class_Color>` | :ref:`get_keyword_color<class_TextEdit_method_get_keyword_color>` **(** :ref:`String<class_String>` keyword **)** const |
  83. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`String<class_String>` | :ref:`get_line<class_TextEdit_method_get_line>` **(** :ref:`int<class_int>` line **)** const |
  85. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`int<class_int>` | :ref:`get_line_count<class_TextEdit_method_get_line_count>` **(** **)** const |
  87. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_menu<class_TextEdit_method_get_menu>` **(** **)** const |
  89. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`int<class_int>` | :ref:`get_selection_from_column<class_TextEdit_method_get_selection_from_column>` **(** **)** const |
  91. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`int<class_int>` | :ref:`get_selection_from_line<class_TextEdit_method_get_selection_from_line>` **(** **)** const |
  93. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`String<class_String>` | :ref:`get_selection_text<class_TextEdit_method_get_selection_text>` **(** **)** const |
  95. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`int<class_int>` | :ref:`get_selection_to_column<class_TextEdit_method_get_selection_to_column>` **(** **)** const |
  97. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`int<class_int>` | :ref:`get_selection_to_line<class_TextEdit_method_get_selection_to_line>` **(** **)** const |
  99. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`String<class_String>` | :ref:`get_word_under_cursor<class_TextEdit_method_get_word_under_cursor>` **(** **)** const |
  101. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`bool<class_bool>` | :ref:`has_keyword_color<class_TextEdit_method_has_keyword_color>` **(** :ref:`String<class_String>` keyword **)** const |
  103. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | void | :ref:`insert_text_at_cursor<class_TextEdit_method_insert_text_at_cursor>` **(** :ref:`String<class_String>` text **)** |
  105. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`bool<class_bool>` | :ref:`is_folded<class_TextEdit_method_is_folded>` **(** :ref:`int<class_int>` line **)** const |
  107. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`bool<class_bool>` | :ref:`is_line_hidden<class_TextEdit_method_is_line_hidden>` **(** :ref:`int<class_int>` line **)** const |
  109. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`bool<class_bool>` | :ref:`is_selection_active<class_TextEdit_method_is_selection_active>` **(** **)** const |
  111. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | void | :ref:`menu_option<class_TextEdit_method_menu_option>` **(** :ref:`int<class_int>` option **)** |
  113. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | void | :ref:`paste<class_TextEdit_method_paste>` **(** **)** |
  115. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | void | :ref:`redo<class_TextEdit_method_redo>` **(** **)** |
  117. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | void | :ref:`remove_breakpoints<class_TextEdit_method_remove_breakpoints>` **(** **)** |
  119. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`search<class_TextEdit_method_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_method_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_method_select_all>` **(** **)** |
  125. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | void | :ref:`set_line_as_hidden<class_TextEdit_method_set_line_as_hidden>` **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` enable **)** |
  127. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | void | :ref:`toggle_fold_line<class_TextEdit_method_toggle_fold_line>` **(** :ref:`int<class_int>` line **)** |
  129. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | void | :ref:`undo<class_TextEdit_method_undo>` **(** **)** |
  131. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | void | :ref:`unfold_line<class_TextEdit_method_unfold_line>` **(** :ref:`int<class_int>` line **)** |
  133. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | void | :ref:`unhide_all_lines<class_TextEdit_method_unhide_all_lines>` **(** **)** |
  135. +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. Theme Properties
  137. ----------------
  138. +---------------------------------+-----------------------------+
  139. | :ref:`Color<class_Color>` | background_color |
  140. +---------------------------------+-----------------------------+
  141. | :ref:`Color<class_Color>` | brace_mismatch_color |
  142. +---------------------------------+-----------------------------+
  143. | :ref:`Color<class_Color>` | breakpoint_color |
  144. +---------------------------------+-----------------------------+
  145. | :ref:`Color<class_Color>` | caret_background_color |
  146. +---------------------------------+-----------------------------+
  147. | :ref:`Color<class_Color>` | caret_color |
  148. +---------------------------------+-----------------------------+
  149. | :ref:`Color<class_Color>` | code_folding_color |
  150. +---------------------------------+-----------------------------+
  151. | :ref:`StyleBox<class_StyleBox>` | completion |
  152. +---------------------------------+-----------------------------+
  153. | :ref:`Color<class_Color>` | completion_background_color |
  154. +---------------------------------+-----------------------------+
  155. | :ref:`Color<class_Color>` | completion_existing_color |
  156. +---------------------------------+-----------------------------+
  157. | :ref:`Color<class_Color>` | completion_font_color |
  158. +---------------------------------+-----------------------------+
  159. | :ref:`int<class_int>` | completion_lines |
  160. +---------------------------------+-----------------------------+
  161. | :ref:`int<class_int>` | completion_max_width |
  162. +---------------------------------+-----------------------------+
  163. | :ref:`Color<class_Color>` | completion_scroll_color |
  164. +---------------------------------+-----------------------------+
  165. | :ref:`int<class_int>` | completion_scroll_width |
  166. +---------------------------------+-----------------------------+
  167. | :ref:`Color<class_Color>` | completion_selected_color |
  168. +---------------------------------+-----------------------------+
  169. | :ref:`Color<class_Color>` | current_line_color |
  170. +---------------------------------+-----------------------------+
  171. | :ref:`StyleBox<class_StyleBox>` | focus |
  172. +---------------------------------+-----------------------------+
  173. | :ref:`Font<class_Font>` | font |
  174. +---------------------------------+-----------------------------+
  175. | :ref:`Color<class_Color>` | font_color |
  176. +---------------------------------+-----------------------------+
  177. | :ref:`Color<class_Color>` | font_color_selected |
  178. +---------------------------------+-----------------------------+
  179. | :ref:`Color<class_Color>` | function_color |
  180. +---------------------------------+-----------------------------+
  181. | :ref:`Color<class_Color>` | line_number_color |
  182. +---------------------------------+-----------------------------+
  183. | :ref:`int<class_int>` | line_spacing |
  184. +---------------------------------+-----------------------------+
  185. | :ref:`Color<class_Color>` | mark_color |
  186. +---------------------------------+-----------------------------+
  187. | :ref:`Color<class_Color>` | member_variable_color |
  188. +---------------------------------+-----------------------------+
  189. | :ref:`StyleBox<class_StyleBox>` | normal |
  190. +---------------------------------+-----------------------------+
  191. | :ref:`Color<class_Color>` | number_color |
  192. +---------------------------------+-----------------------------+
  193. | :ref:`StyleBox<class_StyleBox>` | read_only |
  194. +---------------------------------+-----------------------------+
  195. | :ref:`Color<class_Color>` | safe_line_number_color |
  196. +---------------------------------+-----------------------------+
  197. | :ref:`Color<class_Color>` | selection_color |
  198. +---------------------------------+-----------------------------+
  199. | :ref:`Color<class_Color>` | symbol_color |
  200. +---------------------------------+-----------------------------+
  201. | :ref:`Texture<class_Texture>` | tab |
  202. +---------------------------------+-----------------------------+
  203. | :ref:`Color<class_Color>` | word_highlighted_color |
  204. +---------------------------------+-----------------------------+
  205. Signals
  206. -------
  207. .. _class_TextEdit_signal_breakpoint_toggled:
  208. - **breakpoint_toggled** **(** :ref:`int<class_int>` row **)**
  209. Emitted when a breakpoint is placed via the breakpoint gutter.
  210. .. _class_TextEdit_signal_cursor_changed:
  211. - **cursor_changed** **(** **)**
  212. Emitted when the cursor changes.
  213. .. _class_TextEdit_signal_request_completion:
  214. - **request_completion** **(** **)**
  215. .. _class_TextEdit_signal_symbol_lookup:
  216. - **symbol_lookup** **(** :ref:`String<class_String>` symbol, :ref:`int<class_int>` row, :ref:`int<class_int>` column **)**
  217. .. _class_TextEdit_signal_text_changed:
  218. - **text_changed** **(** **)**
  219. Emitted when the text changes.
  220. Enumerations
  221. ------------
  222. .. _enum_TextEdit_SearchFlags:
  223. .. _class_TextEdit_constant_SEARCH_MATCH_CASE:
  224. .. _class_TextEdit_constant_SEARCH_WHOLE_WORDS:
  225. .. _class_TextEdit_constant_SEARCH_BACKWARDS:
  226. enum **SearchFlags**:
  227. - **SEARCH_MATCH_CASE** = **1** --- Match case when searching.
  228. - **SEARCH_WHOLE_WORDS** = **2** --- Match whole words when searching.
  229. - **SEARCH_BACKWARDS** = **4** --- Search from end to beginning.
  230. .. _enum_TextEdit_MenuItems:
  231. .. _class_TextEdit_constant_MENU_CUT:
  232. .. _class_TextEdit_constant_MENU_COPY:
  233. .. _class_TextEdit_constant_MENU_PASTE:
  234. .. _class_TextEdit_constant_MENU_CLEAR:
  235. .. _class_TextEdit_constant_MENU_SELECT_ALL:
  236. .. _class_TextEdit_constant_MENU_UNDO:
  237. .. _class_TextEdit_constant_MENU_REDO:
  238. .. _class_TextEdit_constant_MENU_MAX:
  239. enum **MenuItems**:
  240. - **MENU_CUT** = **0** --- Cuts (Copies and clears) the selected text.
  241. - **MENU_COPY** = **1** --- Copies the selected text.
  242. - **MENU_PASTE** = **2** --- Pastes the clipboard text over the selected text (or at the cursor's position).
  243. - **MENU_CLEAR** = **3** --- Erases the whole :ref:`TextEdit<class_TextEdit>` text.
  244. - **MENU_SELECT_ALL** = **4** --- Selects the whole :ref:`TextEdit<class_TextEdit>` text.
  245. - **MENU_UNDO** = **5** --- Undoes the previous action.
  246. - **MENU_REDO** = **6**
  247. - **MENU_MAX** = **7**
  248. Description
  249. -----------
  250. 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.
  251. Property Descriptions
  252. ---------------------
  253. .. _class_TextEdit_property_breakpoint_gutter:
  254. - :ref:`bool<class_bool>` **breakpoint_gutter**
  255. +----------+--------------------------------------+
  256. | *Setter* | set_breakpoint_gutter_enabled(value) |
  257. +----------+--------------------------------------+
  258. | *Getter* | is_breakpoint_gutter_enabled() |
  259. +----------+--------------------------------------+
  260. If ``true``, the breakpoint gutter is visible.
  261. .. _class_TextEdit_property_caret_blink:
  262. - :ref:`bool<class_bool>` **caret_blink**
  263. +----------+---------------------------------+
  264. | *Setter* | cursor_set_blink_enabled(value) |
  265. +----------+---------------------------------+
  266. | *Getter* | cursor_get_blink_enabled() |
  267. +----------+---------------------------------+
  268. If ``true``, the caret (visual cursor) blinks.
  269. .. _class_TextEdit_property_caret_blink_speed:
  270. - :ref:`float<class_float>` **caret_blink_speed**
  271. +----------+-------------------------------+
  272. | *Setter* | cursor_set_blink_speed(value) |
  273. +----------+-------------------------------+
  274. | *Getter* | cursor_get_blink_speed() |
  275. +----------+-------------------------------+
  276. Duration (in seconds) of a caret's blinking cycle.
  277. .. _class_TextEdit_property_caret_block_mode:
  278. - :ref:`bool<class_bool>` **caret_block_mode**
  279. +----------+------------------------------+
  280. | *Setter* | cursor_set_block_mode(value) |
  281. +----------+------------------------------+
  282. | *Getter* | cursor_is_block_mode() |
  283. +----------+------------------------------+
  284. If ``true``, the caret displays as a rectangle.
  285. If ``false``, the caret displays as a bar.
  286. .. _class_TextEdit_property_caret_moving_by_right_click:
  287. - :ref:`bool<class_bool>` **caret_moving_by_right_click**
  288. +----------+------------------------------------+
  289. | *Setter* | set_right_click_moves_caret(value) |
  290. +----------+------------------------------------+
  291. | *Getter* | is_right_click_moving_caret() |
  292. +----------+------------------------------------+
  293. If ``true``, a right click moves the cursor at the mouse position before displaying the context menu.
  294. If ``false``, the context menu disregards mouse location.
  295. .. _class_TextEdit_property_context_menu_enabled:
  296. - :ref:`bool<class_bool>` **context_menu_enabled**
  297. +----------+---------------------------------+
  298. | *Setter* | set_context_menu_enabled(value) |
  299. +----------+---------------------------------+
  300. | *Getter* | is_context_menu_enabled() |
  301. +----------+---------------------------------+
  302. If ``true``, a right click displays the context menu.
  303. .. _class_TextEdit_property_hiding_enabled:
  304. - :ref:`int<class_int>` **hiding_enabled**
  305. +----------+---------------------------+
  306. | *Setter* | set_hiding_enabled(value) |
  307. +----------+---------------------------+
  308. | *Getter* | is_hiding_enabled() |
  309. +----------+---------------------------+
  310. .. _class_TextEdit_property_highlight_all_occurrences:
  311. - :ref:`bool<class_bool>` **highlight_all_occurrences**
  312. +----------+----------------------------------------+
  313. | *Setter* | set_highlight_all_occurrences(value) |
  314. +----------+----------------------------------------+
  315. | *Getter* | is_highlight_all_occurrences_enabled() |
  316. +----------+----------------------------------------+
  317. .. _class_TextEdit_property_highlight_current_line:
  318. - :ref:`bool<class_bool>` **highlight_current_line**
  319. +----------+-------------------------------------+
  320. | *Setter* | set_highlight_current_line(value) |
  321. +----------+-------------------------------------+
  322. | *Getter* | is_highlight_current_line_enabled() |
  323. +----------+-------------------------------------+
  324. If ``true``, the line containing the cursor is highlighted.
  325. .. _class_TextEdit_property_override_selected_font_color:
  326. - :ref:`bool<class_bool>` **override_selected_font_color**
  327. +----------+-----------------------------------------+
  328. | *Setter* | set_override_selected_font_color(value) |
  329. +----------+-----------------------------------------+
  330. | *Getter* | is_overriding_selected_font_color() |
  331. +----------+-----------------------------------------+
  332. .. _class_TextEdit_property_readonly:
  333. - :ref:`bool<class_bool>` **readonly**
  334. +----------+---------------------+
  335. | *Setter* | set_readonly(value) |
  336. +----------+---------------------+
  337. | *Getter* | is_readonly() |
  338. +----------+---------------------+
  339. If ``true``, read-only mode is enabled. Existing text cannot be modified and new text cannot be added.
  340. .. _class_TextEdit_property_show_line_numbers:
  341. - :ref:`bool<class_bool>` **show_line_numbers**
  342. +----------+--------------------------------+
  343. | *Setter* | set_show_line_numbers(value) |
  344. +----------+--------------------------------+
  345. | *Getter* | is_show_line_numbers_enabled() |
  346. +----------+--------------------------------+
  347. If ``true``, line numbers are displayed to the left of the text.
  348. .. _class_TextEdit_property_smooth_scrolling:
  349. - :ref:`bool<class_bool>` **smooth_scrolling**
  350. +----------+---------------------------------+
  351. | *Setter* | set_smooth_scroll_enable(value) |
  352. +----------+---------------------------------+
  353. | *Getter* | is_smooth_scroll_enabled() |
  354. +----------+---------------------------------+
  355. .. _class_TextEdit_property_syntax_highlighting:
  356. - :ref:`bool<class_bool>` **syntax_highlighting**
  357. +----------+------------------------------+
  358. | *Setter* | set_syntax_coloring(value) |
  359. +----------+------------------------------+
  360. | *Getter* | is_syntax_coloring_enabled() |
  361. +----------+------------------------------+
  362. .. _class_TextEdit_property_text:
  363. - :ref:`String<class_String>` **text**
  364. +----------+-----------------+
  365. | *Setter* | set_text(value) |
  366. +----------+-----------------+
  367. | *Getter* | get_text() |
  368. +----------+-----------------+
  369. String value of the :ref:`TextEdit<class_TextEdit>`.
  370. .. _class_TextEdit_property_v_scroll_speed:
  371. - :ref:`float<class_float>` **v_scroll_speed**
  372. +----------+---------------------------+
  373. | *Setter* | set_v_scroll_speed(value) |
  374. +----------+---------------------------+
  375. | *Getter* | get_v_scroll_speed() |
  376. +----------+---------------------------+
  377. If ``true``, enables text wrapping when it goes beyond he edge of what is visible.
  378. .. _class_TextEdit_property_wrap_enabled:
  379. - :ref:`bool<class_bool>` **wrap_enabled**
  380. +----------+-------------------------+
  381. | *Setter* | set_wrap_enabled(value) |
  382. +----------+-------------------------+
  383. | *Getter* | is_wrap_enabled() |
  384. +----------+-------------------------+
  385. Method Descriptions
  386. -------------------
  387. .. _class_TextEdit_method_add_color_region:
  388. - 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 **)**
  389. Add color region (given the delimiters) and its colors.
  390. .. _class_TextEdit_method_add_keyword_color:
  391. - void **add_keyword_color** **(** :ref:`String<class_String>` keyword, :ref:`Color<class_Color>` color **)**
  392. Add a keyword and its color.
  393. .. _class_TextEdit_method_can_fold:
  394. - :ref:`bool<class_bool>` **can_fold** **(** :ref:`int<class_int>` line **)** const
  395. .. _class_TextEdit_method_clear_colors:
  396. - void **clear_colors** **(** **)**
  397. Clear all the syntax coloring information.
  398. .. _class_TextEdit_method_clear_undo_history:
  399. - void **clear_undo_history** **(** **)**
  400. Clear the undo history.
  401. .. _class_TextEdit_method_copy:
  402. - void **copy** **(** **)**
  403. Copy the current selection.
  404. .. _class_TextEdit_method_cursor_get_column:
  405. - :ref:`int<class_int>` **cursor_get_column** **(** **)** const
  406. Return the column the editing cursor is at.
  407. .. _class_TextEdit_method_cursor_get_line:
  408. - :ref:`int<class_int>` **cursor_get_line** **(** **)** const
  409. Return the line the editing cursor is at.
  410. .. _class_TextEdit_method_cursor_set_column:
  411. - void **cursor_set_column** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true **)**
  412. .. _class_TextEdit_method_cursor_set_line:
  413. - 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 **)**
  414. .. _class_TextEdit_method_cut:
  415. - void **cut** **(** **)**
  416. Cut the current selection.
  417. .. _class_TextEdit_method_deselect:
  418. - void **deselect** **(** **)**
  419. Clears the current selection.
  420. .. _class_TextEdit_method_fold_all_lines:
  421. - void **fold_all_lines** **(** **)**
  422. .. _class_TextEdit_method_fold_line:
  423. - void **fold_line** **(** :ref:`int<class_int>` line **)**
  424. .. _class_TextEdit_method_get_breakpoints:
  425. - :ref:`Array<class_Array>` **get_breakpoints** **(** **)** const
  426. Return an array containing the line number of each breakpoint.
  427. .. _class_TextEdit_method_get_keyword_color:
  428. - :ref:`Color<class_Color>` **get_keyword_color** **(** :ref:`String<class_String>` keyword **)** const
  429. .. _class_TextEdit_method_get_line:
  430. - :ref:`String<class_String>` **get_line** **(** :ref:`int<class_int>` line **)** const
  431. Return the text of a specific line.
  432. .. _class_TextEdit_method_get_line_count:
  433. - :ref:`int<class_int>` **get_line_count** **(** **)** const
  434. Return the amount of total lines in the text.
  435. .. _class_TextEdit_method_get_menu:
  436. - :ref:`PopupMenu<class_PopupMenu>` **get_menu** **(** **)** const
  437. .. _class_TextEdit_method_get_selection_from_column:
  438. - :ref:`int<class_int>` **get_selection_from_column** **(** **)** const
  439. Return the selection begin column.
  440. .. _class_TextEdit_method_get_selection_from_line:
  441. - :ref:`int<class_int>` **get_selection_from_line** **(** **)** const
  442. Return the selection begin line.
  443. .. _class_TextEdit_method_get_selection_text:
  444. - :ref:`String<class_String>` **get_selection_text** **(** **)** const
  445. Return the text inside the selection.
  446. .. _class_TextEdit_method_get_selection_to_column:
  447. - :ref:`int<class_int>` **get_selection_to_column** **(** **)** const
  448. Return the selection end column.
  449. .. _class_TextEdit_method_get_selection_to_line:
  450. - :ref:`int<class_int>` **get_selection_to_line** **(** **)** const
  451. Return the selection end line.
  452. .. _class_TextEdit_method_get_word_under_cursor:
  453. - :ref:`String<class_String>` **get_word_under_cursor** **(** **)** const
  454. .. _class_TextEdit_method_has_keyword_color:
  455. - :ref:`bool<class_bool>` **has_keyword_color** **(** :ref:`String<class_String>` keyword **)** const
  456. .. _class_TextEdit_method_insert_text_at_cursor:
  457. - void **insert_text_at_cursor** **(** :ref:`String<class_String>` text **)**
  458. Insert a given text at the cursor position.
  459. .. _class_TextEdit_method_is_folded:
  460. - :ref:`bool<class_bool>` **is_folded** **(** :ref:`int<class_int>` line **)** const
  461. .. _class_TextEdit_method_is_line_hidden:
  462. - :ref:`bool<class_bool>` **is_line_hidden** **(** :ref:`int<class_int>` line **)** const
  463. .. _class_TextEdit_method_is_selection_active:
  464. - :ref:`bool<class_bool>` **is_selection_active** **(** **)** const
  465. Return true if the selection is active.
  466. .. _class_TextEdit_method_menu_option:
  467. - void **menu_option** **(** :ref:`int<class_int>` option **)**
  468. .. _class_TextEdit_method_paste:
  469. - void **paste** **(** **)**
  470. Paste the current selection.
  471. .. _class_TextEdit_method_redo:
  472. - void **redo** **(** **)**
  473. Perform redo operation.
  474. .. _class_TextEdit_method_remove_breakpoints:
  475. - void **remove_breakpoints** **(** **)**
  476. Removes all the breakpoints (without firing "breakpoint_toggled" signal).
  477. .. _class_TextEdit_method_search:
  478. - :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
  479. Perform a search inside the text. Search flags can be specified in the SEARCH\_\* enum.
  480. .. _class_TextEdit_method_select:
  481. - 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 **)**
  482. Perform selection, from line/column to line/column.
  483. .. _class_TextEdit_method_select_all:
  484. - void **select_all** **(** **)**
  485. Select all the text.
  486. .. _class_TextEdit_method_set_line_as_hidden:
  487. - void **set_line_as_hidden** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` enable **)**
  488. .. _class_TextEdit_method_toggle_fold_line:
  489. - void **toggle_fold_line** **(** :ref:`int<class_int>` line **)**
  490. Toggle the folding of the code block at the given line.
  491. .. _class_TextEdit_method_undo:
  492. - void **undo** **(** **)**
  493. Perform undo operation.
  494. .. _class_TextEdit_method_unfold_line:
  495. - void **unfold_line** **(** :ref:`int<class_int>` line **)**
  496. .. _class_TextEdit_method_unhide_all_lines:
  497. - void **unhide_all_lines** **(** **)**