TextEdit.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="TextEdit" inherits="Control" category="Core" version="3.1.2">
  3. <brief_description>
  4. Multiline text editing control.
  5. </brief_description>
  6. <description>
  7. 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.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="add_color_region">
  13. <return type="void">
  14. </return>
  15. <argument index="0" name="begin_key" type="String">
  16. </argument>
  17. <argument index="1" name="end_key" type="String">
  18. </argument>
  19. <argument index="2" name="color" type="Color">
  20. </argument>
  21. <argument index="3" name="line_only" type="bool" default="false">
  22. </argument>
  23. <description>
  24. Add color region (given the delimiters) and its colors.
  25. </description>
  26. </method>
  27. <method name="add_keyword_color">
  28. <return type="void">
  29. </return>
  30. <argument index="0" name="keyword" type="String">
  31. </argument>
  32. <argument index="1" name="color" type="Color">
  33. </argument>
  34. <description>
  35. Add a [code]keyword[/code] and its [Color].
  36. </description>
  37. </method>
  38. <method name="can_fold" qualifiers="const">
  39. <return type="bool">
  40. </return>
  41. <argument index="0" name="line" type="int">
  42. </argument>
  43. <description>
  44. </description>
  45. </method>
  46. <method name="clear_colors">
  47. <return type="void">
  48. </return>
  49. <description>
  50. Clears all the syntax coloring information.
  51. </description>
  52. </method>
  53. <method name="clear_undo_history">
  54. <return type="void">
  55. </return>
  56. <description>
  57. Clears the undo history.
  58. </description>
  59. </method>
  60. <method name="copy">
  61. <return type="void">
  62. </return>
  63. <description>
  64. Copy's the current text selection.
  65. </description>
  66. </method>
  67. <method name="cursor_get_column" qualifiers="const">
  68. <return type="int">
  69. </return>
  70. <description>
  71. Returns the column the editing cursor is at.
  72. </description>
  73. </method>
  74. <method name="cursor_get_line" qualifiers="const">
  75. <return type="int">
  76. </return>
  77. <description>
  78. Returns the line the editing cursor is at.
  79. </description>
  80. </method>
  81. <method name="cursor_set_column">
  82. <return type="void">
  83. </return>
  84. <argument index="0" name="column" type="int">
  85. </argument>
  86. <argument index="1" name="adjust_viewport" type="bool" default="true">
  87. </argument>
  88. <description>
  89. Moves the cursor at the specified [code]column[/code] index.
  90. If [code]adjust_viewport[/code] is set to true, the viewport will center at the cursor position after the move occurs. Default value is [code]true[/code].
  91. </description>
  92. </method>
  93. <method name="cursor_set_line">
  94. <return type="void">
  95. </return>
  96. <argument index="0" name="line" type="int">
  97. </argument>
  98. <argument index="1" name="adjust_viewport" type="bool" default="true">
  99. </argument>
  100. <argument index="2" name="can_be_hidden" type="bool" default="true">
  101. </argument>
  102. <argument index="3" name="wrap_index" type="int" default="0">
  103. </argument>
  104. <description>
  105. Moves the cursor at the specified [code]line[/code] index.
  106. If [code]adjust_viewport[/code] is set to true, the viewport will center at the cursor position after the move occurs. Default value is [code]true[/code].
  107. If [code]can_be_hidden[/code] is set to true, the specified [code]line[/code] can be hidden using [method set_line_as_hidden]. Default value is [code]true[/code].
  108. </description>
  109. </method>
  110. <method name="cut">
  111. <return type="void">
  112. </return>
  113. <description>
  114. Cut's the current selection.
  115. </description>
  116. </method>
  117. <method name="deselect">
  118. <return type="void">
  119. </return>
  120. <description>
  121. Deselects the current selection.
  122. </description>
  123. </method>
  124. <method name="fold_all_lines">
  125. <return type="void">
  126. </return>
  127. <description>
  128. </description>
  129. </method>
  130. <method name="fold_line">
  131. <return type="void">
  132. </return>
  133. <argument index="0" name="line" type="int">
  134. </argument>
  135. <description>
  136. </description>
  137. </method>
  138. <method name="get_breakpoints" qualifiers="const">
  139. <return type="Array">
  140. </return>
  141. <description>
  142. Returns an array containing the line number of each breakpoint.
  143. </description>
  144. </method>
  145. <method name="get_keyword_color" qualifiers="const">
  146. <return type="Color">
  147. </return>
  148. <argument index="0" name="keyword" type="String">
  149. </argument>
  150. <description>
  151. Returns the [Color] of the specified [code]keyword[/code].
  152. </description>
  153. </method>
  154. <method name="get_line" qualifiers="const">
  155. <return type="String">
  156. </return>
  157. <argument index="0" name="line" type="int">
  158. </argument>
  159. <description>
  160. Returns the text of a specific line.
  161. </description>
  162. </method>
  163. <method name="get_line_count" qualifiers="const">
  164. <return type="int">
  165. </return>
  166. <description>
  167. Returns the amount of total lines in the text.
  168. </description>
  169. </method>
  170. <method name="get_menu" qualifiers="const">
  171. <return type="PopupMenu">
  172. </return>
  173. <description>
  174. </description>
  175. </method>
  176. <method name="get_selection_from_column" qualifiers="const">
  177. <return type="int">
  178. </return>
  179. <description>
  180. Returns the selection begin column.
  181. </description>
  182. </method>
  183. <method name="get_selection_from_line" qualifiers="const">
  184. <return type="int">
  185. </return>
  186. <description>
  187. Returns the selection begin line.
  188. </description>
  189. </method>
  190. <method name="get_selection_text" qualifiers="const">
  191. <return type="String">
  192. </return>
  193. <description>
  194. Returns the text inside the selection.
  195. </description>
  196. </method>
  197. <method name="get_selection_to_column" qualifiers="const">
  198. <return type="int">
  199. </return>
  200. <description>
  201. Returns the selection end column.
  202. </description>
  203. </method>
  204. <method name="get_selection_to_line" qualifiers="const">
  205. <return type="int">
  206. </return>
  207. <description>
  208. Returns the selection end line.
  209. </description>
  210. </method>
  211. <method name="get_word_under_cursor" qualifiers="const">
  212. <return type="String">
  213. </return>
  214. <description>
  215. Returns a [String] text with the word under the mouse cursor location.
  216. </description>
  217. </method>
  218. <method name="has_keyword_color" qualifiers="const">
  219. <return type="bool">
  220. </return>
  221. <argument index="0" name="keyword" type="String">
  222. </argument>
  223. <description>
  224. Returns whether the specified [code]keyword[/code] has a color set to it or not.
  225. </description>
  226. </method>
  227. <method name="insert_text_at_cursor">
  228. <return type="void">
  229. </return>
  230. <argument index="0" name="text" type="String">
  231. </argument>
  232. <description>
  233. Insert the specified text at the cursor position.
  234. </description>
  235. </method>
  236. <method name="is_folded" qualifiers="const">
  237. <return type="bool">
  238. </return>
  239. <argument index="0" name="line" type="int">
  240. </argument>
  241. <description>
  242. Returns whether the line at the specified index is folded or not.
  243. </description>
  244. </method>
  245. <method name="is_line_hidden" qualifiers="const">
  246. <return type="bool">
  247. </return>
  248. <argument index="0" name="line" type="int">
  249. </argument>
  250. <description>
  251. Returns whether the line at the specified index is hidden or not.
  252. </description>
  253. </method>
  254. <method name="is_selection_active" qualifiers="const">
  255. <return type="bool">
  256. </return>
  257. <description>
  258. Returns [code]true[/code] if the selection is active.
  259. </description>
  260. </method>
  261. <method name="menu_option">
  262. <return type="void">
  263. </return>
  264. <argument index="0" name="option" type="int">
  265. </argument>
  266. <description>
  267. Triggers a right click menu action by the specified index. See [enum MenuItems] for a list of available indexes.
  268. </description>
  269. </method>
  270. <method name="paste">
  271. <return type="void">
  272. </return>
  273. <description>
  274. Paste the current selection.
  275. </description>
  276. </method>
  277. <method name="redo">
  278. <return type="void">
  279. </return>
  280. <description>
  281. Perform redo operation.
  282. </description>
  283. </method>
  284. <method name="remove_breakpoints">
  285. <return type="void">
  286. </return>
  287. <description>
  288. Removes all the breakpoints (without firing "breakpoint_toggled" signal).
  289. </description>
  290. </method>
  291. <method name="search" qualifiers="const">
  292. <return type="PoolIntArray">
  293. </return>
  294. <argument index="0" name="key" type="String">
  295. </argument>
  296. <argument index="1" name="flags" type="int">
  297. </argument>
  298. <argument index="2" name="from_line" type="int">
  299. </argument>
  300. <argument index="3" name="from_column" type="int">
  301. </argument>
  302. <description>
  303. Perform a search inside the text. Search flags can be specified in the SEARCH_* enum.
  304. </description>
  305. </method>
  306. <method name="select">
  307. <return type="void">
  308. </return>
  309. <argument index="0" name="from_line" type="int">
  310. </argument>
  311. <argument index="1" name="from_column" type="int">
  312. </argument>
  313. <argument index="2" name="to_line" type="int">
  314. </argument>
  315. <argument index="3" name="to_column" type="int">
  316. </argument>
  317. <description>
  318. Perform selection, from line/column to line/column.
  319. </description>
  320. </method>
  321. <method name="select_all">
  322. <return type="void">
  323. </return>
  324. <description>
  325. Select all the text.
  326. </description>
  327. </method>
  328. <method name="set_line_as_hidden">
  329. <return type="void">
  330. </return>
  331. <argument index="0" name="line" type="int">
  332. </argument>
  333. <argument index="1" name="enable" type="bool">
  334. </argument>
  335. <description>
  336. If [code]true[/code], hides the line of the specified index.
  337. </description>
  338. </method>
  339. <method name="toggle_fold_line">
  340. <return type="void">
  341. </return>
  342. <argument index="0" name="line" type="int">
  343. </argument>
  344. <description>
  345. Toggle the folding of the code block at the given line.
  346. </description>
  347. </method>
  348. <method name="undo">
  349. <return type="void">
  350. </return>
  351. <description>
  352. Perform undo operation.
  353. </description>
  354. </method>
  355. <method name="unfold_line">
  356. <return type="void">
  357. </return>
  358. <argument index="0" name="line" type="int">
  359. </argument>
  360. <description>
  361. </description>
  362. </method>
  363. <method name="unhide_all_lines">
  364. <return type="void">
  365. </return>
  366. <description>
  367. Unhide all lines that were previously set to hidden by [method set_line_as_hidden].
  368. </description>
  369. </method>
  370. </methods>
  371. <members>
  372. <member name="breakpoint_gutter" type="bool" setter="set_breakpoint_gutter_enabled" getter="is_breakpoint_gutter_enabled">
  373. If [code]true[/code], the breakpoint gutter is visible.
  374. </member>
  375. <member name="caret_blink" type="bool" setter="cursor_set_blink_enabled" getter="cursor_get_blink_enabled">
  376. If [code]true[/code], the caret (visual cursor) blinks.
  377. </member>
  378. <member name="caret_blink_speed" type="float" setter="cursor_set_blink_speed" getter="cursor_get_blink_speed">
  379. Duration (in seconds) of a caret's blinking cycle.
  380. </member>
  381. <member name="caret_block_mode" type="bool" setter="cursor_set_block_mode" getter="cursor_is_block_mode">
  382. If [code]true[/code], the caret displays as a rectangle.
  383. If [code]false[/code], the caret displays as a bar.
  384. </member>
  385. <member name="caret_moving_by_right_click" type="bool" setter="set_right_click_moves_caret" getter="is_right_click_moving_caret">
  386. If [code]true[/code], a right click moves the cursor at the mouse position before displaying the context menu.
  387. If [code]false[/code], the context menu disregards mouse location.
  388. </member>
  389. <member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled">
  390. If [code]true[/code], a right click displays the context menu.
  391. </member>
  392. <member name="hiding_enabled" type="int" setter="set_hiding_enabled" getter="is_hiding_enabled">
  393. </member>
  394. <member name="highlight_all_occurrences" type="bool" setter="set_highlight_all_occurrences" getter="is_highlight_all_occurrences_enabled">
  395. If [code]true[/code], all occurrences of the selected text will be highlighted.
  396. </member>
  397. <member name="highlight_current_line" type="bool" setter="set_highlight_current_line" getter="is_highlight_current_line_enabled">
  398. If [code]true[/code], the line containing the cursor is highlighted.
  399. </member>
  400. <member name="override_selected_font_color" type="bool" setter="set_override_selected_font_color" getter="is_overriding_selected_font_color">
  401. </member>
  402. <member name="readonly" type="bool" setter="set_readonly" getter="is_readonly">
  403. If [code]true[/code], read-only mode is enabled. Existing text cannot be modified and new text cannot be added.
  404. </member>
  405. <member name="show_line_numbers" type="bool" setter="set_show_line_numbers" getter="is_show_line_numbers_enabled">
  406. If [code]true[/code], line numbers are displayed to the left of the text.
  407. </member>
  408. <member name="smooth_scrolling" type="bool" setter="set_smooth_scroll_enable" getter="is_smooth_scroll_enabled">
  409. If [code]true[/code], sets the [code]step[/code] of the scrollbars to [code]0.25[/code] which results in smoother scrolling.
  410. </member>
  411. <member name="syntax_highlighting" type="bool" setter="set_syntax_coloring" getter="is_syntax_coloring_enabled">
  412. If [code]true[/code], any custom color properties that have been set for this [TextEdit] will be visible.
  413. </member>
  414. <member name="text" type="String" setter="set_text" getter="get_text">
  415. String value of the [TextEdit].
  416. </member>
  417. <member name="v_scroll_speed" type="float" setter="set_v_scroll_speed" getter="get_v_scroll_speed">
  418. Vertical scroll sensitivity.
  419. </member>
  420. <member name="wrap_enabled" type="bool" setter="set_wrap_enabled" getter="is_wrap_enabled">
  421. If [code]true[/code], enables text wrapping when it goes beyond the edge of what is visible.
  422. </member>
  423. </members>
  424. <signals>
  425. <signal name="breakpoint_toggled">
  426. <argument index="0" name="row" type="int">
  427. </argument>
  428. <description>
  429. Emitted when a breakpoint is placed via the breakpoint gutter.
  430. </description>
  431. </signal>
  432. <signal name="cursor_changed">
  433. <description>
  434. Emitted when the cursor changes.
  435. </description>
  436. </signal>
  437. <signal name="request_completion">
  438. <description>
  439. </description>
  440. </signal>
  441. <signal name="symbol_lookup">
  442. <argument index="0" name="symbol" type="String">
  443. </argument>
  444. <argument index="1" name="row" type="int">
  445. </argument>
  446. <argument index="2" name="column" type="int">
  447. </argument>
  448. <description>
  449. </description>
  450. </signal>
  451. <signal name="text_changed">
  452. <description>
  453. Emitted when the text changes.
  454. </description>
  455. </signal>
  456. </signals>
  457. <constants>
  458. <constant name="SEARCH_MATCH_CASE" value="1" enum="SearchFlags">
  459. Match case when searching.
  460. </constant>
  461. <constant name="SEARCH_WHOLE_WORDS" value="2" enum="SearchFlags">
  462. Match whole words when searching.
  463. </constant>
  464. <constant name="SEARCH_BACKWARDS" value="4" enum="SearchFlags">
  465. Search from end to beginning.
  466. </constant>
  467. <constant name="MENU_CUT" value="0" enum="MenuItems">
  468. Cuts (Copies and clears) the selected text.
  469. </constant>
  470. <constant name="MENU_COPY" value="1" enum="MenuItems">
  471. Copies the selected text.
  472. </constant>
  473. <constant name="MENU_PASTE" value="2" enum="MenuItems">
  474. Pastes the clipboard text over the selected text (or at the cursor's position).
  475. </constant>
  476. <constant name="MENU_CLEAR" value="3" enum="MenuItems">
  477. Erases the whole [TextEdit] text.
  478. </constant>
  479. <constant name="MENU_SELECT_ALL" value="4" enum="MenuItems">
  480. Selects the whole [TextEdit] text.
  481. </constant>
  482. <constant name="MENU_UNDO" value="5" enum="MenuItems">
  483. Undoes the previous action.
  484. </constant>
  485. <constant name="MENU_REDO" value="6" enum="MenuItems">
  486. Redoes the previous action.
  487. </constant>
  488. <constant name="MENU_MAX" value="7" enum="MenuItems">
  489. Represents the size of the [enum MenuItems] enum.
  490. </constant>
  491. </constants>
  492. <theme_items>
  493. <theme_item name="background_color" type="Color">
  494. Sets the background [Color] of this [TextEdit]. [member syntax_highlighting] has to be enabled.
  495. </theme_item>
  496. <theme_item name="brace_mismatch_color" type="Color">
  497. </theme_item>
  498. <theme_item name="breakpoint_color" type="Color">
  499. Sets the [Color] of the breakpoints. [member breakpoint_gutter] has to be enabled.
  500. </theme_item>
  501. <theme_item name="caret_background_color" type="Color">
  502. </theme_item>
  503. <theme_item name="caret_color" type="Color">
  504. </theme_item>
  505. <theme_item name="code_folding_color" type="Color">
  506. </theme_item>
  507. <theme_item name="completion" type="StyleBox">
  508. </theme_item>
  509. <theme_item name="completion_background_color" type="Color">
  510. </theme_item>
  511. <theme_item name="completion_existing_color" type="Color">
  512. </theme_item>
  513. <theme_item name="completion_font_color" type="Color">
  514. </theme_item>
  515. <theme_item name="completion_lines" type="int">
  516. </theme_item>
  517. <theme_item name="completion_max_width" type="int">
  518. </theme_item>
  519. <theme_item name="completion_scroll_color" type="Color">
  520. </theme_item>
  521. <theme_item name="completion_scroll_width" type="int">
  522. </theme_item>
  523. <theme_item name="completion_selected_color" type="Color">
  524. </theme_item>
  525. <theme_item name="current_line_color" type="Color">
  526. Sets the current line highlight [Color]. [member highlight_current_line] has to be enabled.
  527. </theme_item>
  528. <theme_item name="focus" type="StyleBox">
  529. </theme_item>
  530. <theme_item name="font" type="Font">
  531. Sets the default [Font].
  532. </theme_item>
  533. <theme_item name="font_color" type="Color">
  534. Sets the font [Color].
  535. </theme_item>
  536. <theme_item name="font_color_selected" type="Color">
  537. </theme_item>
  538. <theme_item name="function_color" type="Color">
  539. </theme_item>
  540. <theme_item name="line_number_color" type="Color">
  541. Sets the [Color] of the line numbers. [member show_line_numbers] has to be enabled.
  542. </theme_item>
  543. <theme_item name="line_spacing" type="int">
  544. Sets the spacing between the lines.
  545. </theme_item>
  546. <theme_item name="mark_color" type="Color">
  547. Sets the [Color] of marked text.
  548. </theme_item>
  549. <theme_item name="member_variable_color" type="Color">
  550. </theme_item>
  551. <theme_item name="normal" type="StyleBox">
  552. Sets the [StyleBox] of this [TextEdit].
  553. </theme_item>
  554. <theme_item name="number_color" type="Color">
  555. </theme_item>
  556. <theme_item name="read_only" type="StyleBox">
  557. Sets the [StyleBox] of this [TextEdit] when [member readonly] is enabled.
  558. </theme_item>
  559. <theme_item name="safe_line_number_color" type="Color">
  560. </theme_item>
  561. <theme_item name="selection_color" type="Color">
  562. Sets the highlight [Color] of text selections.
  563. </theme_item>
  564. <theme_item name="symbol_color" type="Color">
  565. </theme_item>
  566. <theme_item name="tab" type="Texture">
  567. Sets a custom [Texture] for tab text characters.
  568. </theme_item>
  569. <theme_item name="word_highlighted_color" type="Color">
  570. Sets the highlight [Color] of multiple occurrences. [member highlight_all_occurrences] has to be enabled.
  571. </theme_item>
  572. </theme_items>
  573. </class>