class_lineedit.rst 81 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831
  1. :github_url: hide
  2. .. meta::
  3. :keywords: text, input
  4. .. DO NOT EDIT THIS FILE!!!
  5. .. Generated automatically from Godot engine sources.
  6. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  7. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/LineEdit.xml.
  8. .. _class_LineEdit:
  9. LineEdit
  10. ========
  11. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  12. An input field for single-line text.
  13. .. rst-class:: classref-introduction-group
  14. Description
  15. -----------
  16. **LineEdit** provides an input field for editing a single line of text.
  17. - When the **LineEdit** control is focused using the keyboard arrow keys, it will only gain focus and not enter edit mode.
  18. - To enter edit mode, click on the control with the mouse, see also :ref:`keep_editing_on_text_submit<class_LineEdit_property_keep_editing_on_text_submit>`.
  19. - To exit edit mode, press ``ui_text_submit`` or ``ui_cancel`` (by default :kbd:`Escape`) actions.
  20. - Check :ref:`edit()<class_LineEdit_method_edit>`, :ref:`unedit()<class_LineEdit_method_unedit>`, :ref:`is_editing()<class_LineEdit_method_is_editing>`, and :ref:`editing_toggled<class_LineEdit_signal_editing_toggled>` for more information.
  21. \ **Important:**\
  22. - Focusing the **LineEdit** with ``ui_focus_next`` (by default :kbd:`Tab`) or ``ui_focus_prev`` (by default :kbd:`Shift + Tab`) or :ref:`Control.grab_focus()<class_Control_method_grab_focus>` still enters edit mode (for compatibility).
  23. \ **LineEdit** features many built-in shortcuts that are always available (:kbd:`Ctrl` here maps to :kbd:`Cmd` on macOS):
  24. - :kbd:`Ctrl + C`: Copy
  25. - :kbd:`Ctrl + X`: Cut
  26. - :kbd:`Ctrl + V` or :kbd:`Ctrl + Y`: Paste/"yank"
  27. - :kbd:`Ctrl + Z`: Undo
  28. - :kbd:`Ctrl + ~`: Swap input direction.
  29. - :kbd:`Ctrl + Shift + Z`: Redo
  30. - :kbd:`Ctrl + U`: Delete text from the caret position to the beginning of the line
  31. - :kbd:`Ctrl + K`: Delete text from the caret position to the end of the line
  32. - :kbd:`Ctrl + A`: Select all text
  33. - :kbd:`Up Arrow`/:kbd:`Down Arrow`: Move the caret to the beginning/end of the line
  34. On macOS, some extra keyboard shortcuts are available:
  35. - :kbd:`Cmd + F`: Same as :kbd:`Right Arrow`, move the caret one character right
  36. - :kbd:`Cmd + B`: Same as :kbd:`Left Arrow`, move the caret one character left
  37. - :kbd:`Cmd + P`: Same as :kbd:`Up Arrow`, move the caret to the previous line
  38. - :kbd:`Cmd + N`: Same as :kbd:`Down Arrow`, move the caret to the next line
  39. - :kbd:`Cmd + D`: Same as :kbd:`Delete`, delete the character on the right side of caret
  40. - :kbd:`Cmd + H`: Same as :kbd:`Backspace`, delete the character on the left side of the caret
  41. - :kbd:`Cmd + A`: Same as :kbd:`Home`, move the caret to the beginning of the line
  42. - :kbd:`Cmd + E`: Same as :kbd:`End`, move the caret to the end of the line
  43. - :kbd:`Cmd + Left Arrow`: Same as :kbd:`Home`, move the caret to the beginning of the line
  44. - :kbd:`Cmd + Right Arrow`: Same as :kbd:`End`, move the caret to the end of the line
  45. \ **Note:** Caret movement shortcuts listed above are not affected by :ref:`shortcut_keys_enabled<class_LineEdit_property_shortcut_keys_enabled>`.
  46. .. rst-class:: classref-reftable-group
  47. Properties
  48. ----------
  49. .. table::
  50. :widths: auto
  51. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  52. | :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`alignment<class_LineEdit_property_alignment>` | ``0`` |
  53. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  54. | :ref:`bool<class_bool>` | :ref:`caret_blink<class_LineEdit_property_caret_blink>` | ``false`` |
  55. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  56. | :ref:`float<class_float>` | :ref:`caret_blink_interval<class_LineEdit_property_caret_blink_interval>` | ``0.65`` |
  57. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  58. | :ref:`int<class_int>` | :ref:`caret_column<class_LineEdit_property_caret_column>` | ``0`` |
  59. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  60. | :ref:`bool<class_bool>` | :ref:`caret_force_displayed<class_LineEdit_property_caret_force_displayed>` | ``false`` |
  61. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  62. | :ref:`bool<class_bool>` | :ref:`caret_mid_grapheme<class_LineEdit_property_caret_mid_grapheme>` | ``false`` |
  63. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  64. | :ref:`bool<class_bool>` | :ref:`clear_button_enabled<class_LineEdit_property_clear_button_enabled>` | ``false`` |
  65. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  66. | :ref:`bool<class_bool>` | :ref:`context_menu_enabled<class_LineEdit_property_context_menu_enabled>` | ``true`` |
  67. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  68. | :ref:`bool<class_bool>` | :ref:`deselect_on_focus_loss_enabled<class_LineEdit_property_deselect_on_focus_loss_enabled>` | ``true`` |
  69. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  70. | :ref:`bool<class_bool>` | :ref:`drag_and_drop_selection_enabled<class_LineEdit_property_drag_and_drop_selection_enabled>` | ``true`` |
  71. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  72. | :ref:`bool<class_bool>` | :ref:`draw_control_chars<class_LineEdit_property_draw_control_chars>` | ``false`` |
  73. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  74. | :ref:`bool<class_bool>` | :ref:`editable<class_LineEdit_property_editable>` | ``true`` |
  75. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  76. | :ref:`bool<class_bool>` | :ref:`emoji_menu_enabled<class_LineEdit_property_emoji_menu_enabled>` | ``true`` |
  77. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  78. | :ref:`bool<class_bool>` | :ref:`expand_to_text_length<class_LineEdit_property_expand_to_text_length>` | ``false`` |
  79. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  80. | :ref:`bool<class_bool>` | :ref:`flat<class_LineEdit_property_flat>` | ``false`` |
  81. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  82. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  83. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  84. | :ref:`bool<class_bool>` | :ref:`keep_editing_on_text_submit<class_LineEdit_property_keep_editing_on_text_submit>` | ``false`` |
  85. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  86. | :ref:`String<class_String>` | :ref:`language<class_LineEdit_property_language>` | ``""`` |
  87. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  88. | :ref:`int<class_int>` | :ref:`max_length<class_LineEdit_property_max_length>` | ``0`` |
  89. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  90. | :ref:`bool<class_bool>` | :ref:`middle_mouse_paste_enabled<class_LineEdit_property_middle_mouse_paste_enabled>` | ``true`` |
  91. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  92. | :ref:`CursorShape<enum_Control_CursorShape>` | mouse_default_cursor_shape | ``1`` (overrides :ref:`Control<class_Control_property_mouse_default_cursor_shape>`) |
  93. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  94. | :ref:`String<class_String>` | :ref:`placeholder_text<class_LineEdit_property_placeholder_text>` | ``""`` |
  95. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  96. | :ref:`Texture2D<class_Texture2D>` | :ref:`right_icon<class_LineEdit_property_right_icon>` | |
  97. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  98. | :ref:`bool<class_bool>` | :ref:`secret<class_LineEdit_property_secret>` | ``false`` |
  99. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  100. | :ref:`String<class_String>` | :ref:`secret_character<class_LineEdit_property_secret_character>` | ``"•"`` |
  101. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  102. | :ref:`bool<class_bool>` | :ref:`select_all_on_focus<class_LineEdit_property_select_all_on_focus>` | ``false`` |
  103. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  104. | :ref:`bool<class_bool>` | :ref:`selecting_enabled<class_LineEdit_property_selecting_enabled>` | ``true`` |
  105. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  106. | :ref:`bool<class_bool>` | :ref:`shortcut_keys_enabled<class_LineEdit_property_shortcut_keys_enabled>` | ``true`` |
  107. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  108. | :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` | :ref:`structured_text_bidi_override<class_LineEdit_property_structured_text_bidi_override>` | ``0`` |
  109. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  110. | :ref:`Array<class_Array>` | :ref:`structured_text_bidi_override_options<class_LineEdit_property_structured_text_bidi_override_options>` | ``[]`` |
  111. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  112. | :ref:`String<class_String>` | :ref:`text<class_LineEdit_property_text>` | ``""`` |
  113. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  114. | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`text_direction<class_LineEdit_property_text_direction>` | ``0`` |
  115. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  116. | :ref:`bool<class_bool>` | :ref:`virtual_keyboard_enabled<class_LineEdit_property_virtual_keyboard_enabled>` | ``true`` |
  117. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  118. | :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` | :ref:`virtual_keyboard_type<class_LineEdit_property_virtual_keyboard_type>` | ``0`` |
  119. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  120. .. rst-class:: classref-reftable-group
  121. Methods
  122. -------
  123. .. table::
  124. :widths: auto
  125. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  126. | |void| | :ref:`apply_ime<class_LineEdit_method_apply_ime>`\ (\ ) |
  127. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  128. | |void| | :ref:`cancel_ime<class_LineEdit_method_cancel_ime>`\ (\ ) |
  129. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  130. | |void| | :ref:`clear<class_LineEdit_method_clear>`\ (\ ) |
  131. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  132. | |void| | :ref:`delete_char_at_caret<class_LineEdit_method_delete_char_at_caret>`\ (\ ) |
  133. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  134. | |void| | :ref:`delete_text<class_LineEdit_method_delete_text>`\ (\ from_column\: :ref:`int<class_int>`, to_column\: :ref:`int<class_int>`\ ) |
  135. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  136. | |void| | :ref:`deselect<class_LineEdit_method_deselect>`\ (\ ) |
  137. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  138. | |void| | :ref:`edit<class_LineEdit_method_edit>`\ (\ ) |
  139. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  140. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_menu<class_LineEdit_method_get_menu>`\ (\ ) |const| |
  141. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  142. | :ref:`float<class_float>` | :ref:`get_scroll_offset<class_LineEdit_method_get_scroll_offset>`\ (\ ) |const| |
  143. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  144. | :ref:`String<class_String>` | :ref:`get_selected_text<class_LineEdit_method_get_selected_text>`\ (\ ) |
  145. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  146. | :ref:`int<class_int>` | :ref:`get_selection_from_column<class_LineEdit_method_get_selection_from_column>`\ (\ ) |const| |
  147. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  148. | :ref:`int<class_int>` | :ref:`get_selection_to_column<class_LineEdit_method_get_selection_to_column>`\ (\ ) |const| |
  149. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  150. | :ref:`bool<class_bool>` | :ref:`has_ime_text<class_LineEdit_method_has_ime_text>`\ (\ ) |const| |
  151. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  152. | :ref:`bool<class_bool>` | :ref:`has_redo<class_LineEdit_method_has_redo>`\ (\ ) |const| |
  153. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  154. | :ref:`bool<class_bool>` | :ref:`has_selection<class_LineEdit_method_has_selection>`\ (\ ) |const| |
  155. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  156. | :ref:`bool<class_bool>` | :ref:`has_undo<class_LineEdit_method_has_undo>`\ (\ ) |const| |
  157. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  158. | |void| | :ref:`insert_text_at_caret<class_LineEdit_method_insert_text_at_caret>`\ (\ text\: :ref:`String<class_String>`\ ) |
  159. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  160. | :ref:`bool<class_bool>` | :ref:`is_editing<class_LineEdit_method_is_editing>`\ (\ ) |const| |
  161. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  162. | :ref:`bool<class_bool>` | :ref:`is_menu_visible<class_LineEdit_method_is_menu_visible>`\ (\ ) |const| |
  163. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  164. | |void| | :ref:`menu_option<class_LineEdit_method_menu_option>`\ (\ option\: :ref:`int<class_int>`\ ) |
  165. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  166. | |void| | :ref:`select<class_LineEdit_method_select>`\ (\ from\: :ref:`int<class_int>` = 0, to\: :ref:`int<class_int>` = -1\ ) |
  167. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  168. | |void| | :ref:`select_all<class_LineEdit_method_select_all>`\ (\ ) |
  169. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  170. | |void| | :ref:`unedit<class_LineEdit_method_unedit>`\ (\ ) |
  171. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  172. .. rst-class:: classref-reftable-group
  173. Theme Properties
  174. ----------------
  175. .. table::
  176. :widths: auto
  177. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  178. | :ref:`Color<class_Color>` | :ref:`caret_color<class_LineEdit_theme_color_caret_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
  179. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  180. | :ref:`Color<class_Color>` | :ref:`clear_button_color<class_LineEdit_theme_color_clear_button_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  181. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  182. | :ref:`Color<class_Color>` | :ref:`clear_button_color_pressed<class_LineEdit_theme_color_clear_button_color_pressed>` | ``Color(1, 1, 1, 1)`` |
  183. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  184. | :ref:`Color<class_Color>` | :ref:`font_color<class_LineEdit_theme_color_font_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  185. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  186. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_LineEdit_theme_color_font_outline_color>` | ``Color(0, 0, 0, 1)`` |
  187. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  188. | :ref:`Color<class_Color>` | :ref:`font_placeholder_color<class_LineEdit_theme_color_font_placeholder_color>` | ``Color(0.875, 0.875, 0.875, 0.6)`` |
  189. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  190. | :ref:`Color<class_Color>` | :ref:`font_selected_color<class_LineEdit_theme_color_font_selected_color>` | ``Color(1, 1, 1, 1)`` |
  191. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  192. | :ref:`Color<class_Color>` | :ref:`font_uneditable_color<class_LineEdit_theme_color_font_uneditable_color>` | ``Color(0.875, 0.875, 0.875, 0.5)`` |
  193. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  194. | :ref:`Color<class_Color>` | :ref:`selection_color<class_LineEdit_theme_color_selection_color>` | ``Color(0.5, 0.5, 0.5, 1)`` |
  195. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  196. | :ref:`int<class_int>` | :ref:`caret_width<class_LineEdit_theme_constant_caret_width>` | ``1`` |
  197. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  198. | :ref:`int<class_int>` | :ref:`minimum_character_width<class_LineEdit_theme_constant_minimum_character_width>` | ``4`` |
  199. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  200. | :ref:`int<class_int>` | :ref:`outline_size<class_LineEdit_theme_constant_outline_size>` | ``0`` |
  201. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  202. | :ref:`Font<class_Font>` | :ref:`font<class_LineEdit_theme_font_font>` | |
  203. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  204. | :ref:`int<class_int>` | :ref:`font_size<class_LineEdit_theme_font_size_font_size>` | |
  205. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  206. | :ref:`Texture2D<class_Texture2D>` | :ref:`clear<class_LineEdit_theme_icon_clear>` | |
  207. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  208. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_LineEdit_theme_style_focus>` | |
  209. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  210. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_LineEdit_theme_style_normal>` | |
  211. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  212. | :ref:`StyleBox<class_StyleBox>` | :ref:`read_only<class_LineEdit_theme_style_read_only>` | |
  213. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  214. .. rst-class:: classref-section-separator
  215. ----
  216. .. rst-class:: classref-descriptions-group
  217. Signals
  218. -------
  219. .. _class_LineEdit_signal_editing_toggled:
  220. .. rst-class:: classref-signal
  221. **editing_toggled**\ (\ toggled_on\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_LineEdit_signal_editing_toggled>`
  222. Emitted when the **LineEdit** switches in or out of edit mode.
  223. .. rst-class:: classref-item-separator
  224. ----
  225. .. _class_LineEdit_signal_text_change_rejected:
  226. .. rst-class:: classref-signal
  227. **text_change_rejected**\ (\ rejected_substring\: :ref:`String<class_String>`\ ) :ref:`🔗<class_LineEdit_signal_text_change_rejected>`
  228. Emitted when appending text that overflows the :ref:`max_length<class_LineEdit_property_max_length>`. The appended text is truncated to fit :ref:`max_length<class_LineEdit_property_max_length>`, and the part that couldn't fit is passed as the ``rejected_substring`` argument.
  229. .. rst-class:: classref-item-separator
  230. ----
  231. .. _class_LineEdit_signal_text_changed:
  232. .. rst-class:: classref-signal
  233. **text_changed**\ (\ new_text\: :ref:`String<class_String>`\ ) :ref:`🔗<class_LineEdit_signal_text_changed>`
  234. Emitted when the text changes.
  235. .. rst-class:: classref-item-separator
  236. ----
  237. .. _class_LineEdit_signal_text_submitted:
  238. .. rst-class:: classref-signal
  239. **text_submitted**\ (\ new_text\: :ref:`String<class_String>`\ ) :ref:`🔗<class_LineEdit_signal_text_submitted>`
  240. Emitted when the user presses the ``ui_text_submit`` action (by default: :kbd:`Enter` or :kbd:`Kp Enter`) while the **LineEdit** has focus.
  241. .. rst-class:: classref-section-separator
  242. ----
  243. .. rst-class:: classref-descriptions-group
  244. Enumerations
  245. ------------
  246. .. _enum_LineEdit_MenuItems:
  247. .. rst-class:: classref-enumeration
  248. enum **MenuItems**: :ref:`🔗<enum_LineEdit_MenuItems>`
  249. .. _class_LineEdit_constant_MENU_CUT:
  250. .. rst-class:: classref-enumeration-constant
  251. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_CUT** = ``0``
  252. Cuts (copies and clears) the selected text.
  253. .. _class_LineEdit_constant_MENU_COPY:
  254. .. rst-class:: classref-enumeration-constant
  255. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_COPY** = ``1``
  256. Copies the selected text.
  257. .. _class_LineEdit_constant_MENU_PASTE:
  258. .. rst-class:: classref-enumeration-constant
  259. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_PASTE** = ``2``
  260. Pastes the clipboard text over the selected text (or at the caret's position).
  261. Non-printable escape characters are automatically stripped from the OS clipboard via :ref:`String.strip_escapes()<class_String_method_strip_escapes>`.
  262. .. _class_LineEdit_constant_MENU_CLEAR:
  263. .. rst-class:: classref-enumeration-constant
  264. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_CLEAR** = ``3``
  265. Erases the whole **LineEdit** text.
  266. .. _class_LineEdit_constant_MENU_SELECT_ALL:
  267. .. rst-class:: classref-enumeration-constant
  268. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_SELECT_ALL** = ``4``
  269. Selects the whole **LineEdit** text.
  270. .. _class_LineEdit_constant_MENU_UNDO:
  271. .. rst-class:: classref-enumeration-constant
  272. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_UNDO** = ``5``
  273. Undoes the previous action.
  274. .. _class_LineEdit_constant_MENU_REDO:
  275. .. rst-class:: classref-enumeration-constant
  276. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_REDO** = ``6``
  277. Reverse the last undo action.
  278. .. _class_LineEdit_constant_MENU_SUBMENU_TEXT_DIR:
  279. .. rst-class:: classref-enumeration-constant
  280. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_SUBMENU_TEXT_DIR** = ``7``
  281. ID of "Text Writing Direction" submenu.
  282. .. _class_LineEdit_constant_MENU_DIR_INHERITED:
  283. .. rst-class:: classref-enumeration-constant
  284. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_INHERITED** = ``8``
  285. Sets text direction to inherited.
  286. .. _class_LineEdit_constant_MENU_DIR_AUTO:
  287. .. rst-class:: classref-enumeration-constant
  288. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_AUTO** = ``9``
  289. Sets text direction to automatic.
  290. .. _class_LineEdit_constant_MENU_DIR_LTR:
  291. .. rst-class:: classref-enumeration-constant
  292. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_LTR** = ``10``
  293. Sets text direction to left-to-right.
  294. .. _class_LineEdit_constant_MENU_DIR_RTL:
  295. .. rst-class:: classref-enumeration-constant
  296. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_RTL** = ``11``
  297. Sets text direction to right-to-left.
  298. .. _class_LineEdit_constant_MENU_DISPLAY_UCC:
  299. .. rst-class:: classref-enumeration-constant
  300. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DISPLAY_UCC** = ``12``
  301. Toggles control character display.
  302. .. _class_LineEdit_constant_MENU_SUBMENU_INSERT_UCC:
  303. .. rst-class:: classref-enumeration-constant
  304. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_SUBMENU_INSERT_UCC** = ``13``
  305. ID of "Insert Control Character" submenu.
  306. .. _class_LineEdit_constant_MENU_INSERT_LRM:
  307. .. rst-class:: classref-enumeration-constant
  308. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRM** = ``14``
  309. Inserts left-to-right mark (LRM) character.
  310. .. _class_LineEdit_constant_MENU_INSERT_RLM:
  311. .. rst-class:: classref-enumeration-constant
  312. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLM** = ``15``
  313. Inserts right-to-left mark (RLM) character.
  314. .. _class_LineEdit_constant_MENU_INSERT_LRE:
  315. .. rst-class:: classref-enumeration-constant
  316. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRE** = ``16``
  317. Inserts start of left-to-right embedding (LRE) character.
  318. .. _class_LineEdit_constant_MENU_INSERT_RLE:
  319. .. rst-class:: classref-enumeration-constant
  320. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLE** = ``17``
  321. Inserts start of right-to-left embedding (RLE) character.
  322. .. _class_LineEdit_constant_MENU_INSERT_LRO:
  323. .. rst-class:: classref-enumeration-constant
  324. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRO** = ``18``
  325. Inserts start of left-to-right override (LRO) character.
  326. .. _class_LineEdit_constant_MENU_INSERT_RLO:
  327. .. rst-class:: classref-enumeration-constant
  328. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLO** = ``19``
  329. Inserts start of right-to-left override (RLO) character.
  330. .. _class_LineEdit_constant_MENU_INSERT_PDF:
  331. .. rst-class:: classref-enumeration-constant
  332. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_PDF** = ``20``
  333. Inserts pop direction formatting (PDF) character.
  334. .. _class_LineEdit_constant_MENU_INSERT_ALM:
  335. .. rst-class:: classref-enumeration-constant
  336. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_ALM** = ``21``
  337. Inserts Arabic letter mark (ALM) character.
  338. .. _class_LineEdit_constant_MENU_INSERT_LRI:
  339. .. rst-class:: classref-enumeration-constant
  340. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRI** = ``22``
  341. Inserts left-to-right isolate (LRI) character.
  342. .. _class_LineEdit_constant_MENU_INSERT_RLI:
  343. .. rst-class:: classref-enumeration-constant
  344. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLI** = ``23``
  345. Inserts right-to-left isolate (RLI) character.
  346. .. _class_LineEdit_constant_MENU_INSERT_FSI:
  347. .. rst-class:: classref-enumeration-constant
  348. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_FSI** = ``24``
  349. Inserts first strong isolate (FSI) character.
  350. .. _class_LineEdit_constant_MENU_INSERT_PDI:
  351. .. rst-class:: classref-enumeration-constant
  352. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_PDI** = ``25``
  353. Inserts pop direction isolate (PDI) character.
  354. .. _class_LineEdit_constant_MENU_INSERT_ZWJ:
  355. .. rst-class:: classref-enumeration-constant
  356. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_ZWJ** = ``26``
  357. Inserts zero width joiner (ZWJ) character.
  358. .. _class_LineEdit_constant_MENU_INSERT_ZWNJ:
  359. .. rst-class:: classref-enumeration-constant
  360. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_ZWNJ** = ``27``
  361. Inserts zero width non-joiner (ZWNJ) character.
  362. .. _class_LineEdit_constant_MENU_INSERT_WJ:
  363. .. rst-class:: classref-enumeration-constant
  364. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_WJ** = ``28``
  365. Inserts word joiner (WJ) character.
  366. .. _class_LineEdit_constant_MENU_INSERT_SHY:
  367. .. rst-class:: classref-enumeration-constant
  368. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_SHY** = ``29``
  369. Inserts soft hyphen (SHY) character.
  370. .. _class_LineEdit_constant_MENU_EMOJI_AND_SYMBOL:
  371. .. rst-class:: classref-enumeration-constant
  372. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_EMOJI_AND_SYMBOL** = ``30``
  373. Opens system emoji and symbol picker.
  374. .. _class_LineEdit_constant_MENU_MAX:
  375. .. rst-class:: classref-enumeration-constant
  376. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_MAX** = ``31``
  377. Represents the size of the :ref:`MenuItems<enum_LineEdit_MenuItems>` enum.
  378. .. rst-class:: classref-item-separator
  379. ----
  380. .. _enum_LineEdit_VirtualKeyboardType:
  381. .. rst-class:: classref-enumeration
  382. enum **VirtualKeyboardType**: :ref:`🔗<enum_LineEdit_VirtualKeyboardType>`
  383. .. _class_LineEdit_constant_KEYBOARD_TYPE_DEFAULT:
  384. .. rst-class:: classref-enumeration-constant
  385. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_DEFAULT** = ``0``
  386. Default text virtual keyboard.
  387. .. _class_LineEdit_constant_KEYBOARD_TYPE_MULTILINE:
  388. .. rst-class:: classref-enumeration-constant
  389. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_MULTILINE** = ``1``
  390. Multiline virtual keyboard.
  391. .. _class_LineEdit_constant_KEYBOARD_TYPE_NUMBER:
  392. .. rst-class:: classref-enumeration-constant
  393. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER** = ``2``
  394. Virtual number keypad, useful for PIN entry.
  395. .. _class_LineEdit_constant_KEYBOARD_TYPE_NUMBER_DECIMAL:
  396. .. rst-class:: classref-enumeration-constant
  397. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER_DECIMAL** = ``3``
  398. Virtual number keypad, useful for entering fractional numbers.
  399. .. _class_LineEdit_constant_KEYBOARD_TYPE_PHONE:
  400. .. rst-class:: classref-enumeration-constant
  401. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_PHONE** = ``4``
  402. Virtual phone number keypad.
  403. .. _class_LineEdit_constant_KEYBOARD_TYPE_EMAIL_ADDRESS:
  404. .. rst-class:: classref-enumeration-constant
  405. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_EMAIL_ADDRESS** = ``5``
  406. Virtual keyboard with additional keys to assist with typing email addresses.
  407. .. _class_LineEdit_constant_KEYBOARD_TYPE_PASSWORD:
  408. .. rst-class:: classref-enumeration-constant
  409. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_PASSWORD** = ``6``
  410. Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization.
  411. \ **Note:** This is not supported on Web. Instead, this behaves identically to :ref:`KEYBOARD_TYPE_DEFAULT<class_LineEdit_constant_KEYBOARD_TYPE_DEFAULT>`.
  412. .. _class_LineEdit_constant_KEYBOARD_TYPE_URL:
  413. .. rst-class:: classref-enumeration-constant
  414. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_URL** = ``7``
  415. Virtual keyboard with additional keys to assist with typing URLs.
  416. .. rst-class:: classref-section-separator
  417. ----
  418. .. rst-class:: classref-descriptions-group
  419. Property Descriptions
  420. ---------------------
  421. .. _class_LineEdit_property_alignment:
  422. .. rst-class:: classref-property
  423. :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **alignment** = ``0`` :ref:`🔗<class_LineEdit_property_alignment>`
  424. .. rst-class:: classref-property-setget
  425. - |void| **set_horizontal_alignment**\ (\ value\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>`\ )
  426. - :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **get_horizontal_alignment**\ (\ )
  427. Text alignment as defined in the :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` enum.
  428. .. rst-class:: classref-item-separator
  429. ----
  430. .. _class_LineEdit_property_caret_blink:
  431. .. rst-class:: classref-property
  432. :ref:`bool<class_bool>` **caret_blink** = ``false`` :ref:`🔗<class_LineEdit_property_caret_blink>`
  433. .. rst-class:: classref-property-setget
  434. - |void| **set_caret_blink_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  435. - :ref:`bool<class_bool>` **is_caret_blink_enabled**\ (\ )
  436. If ``true``, makes the caret blink.
  437. .. rst-class:: classref-item-separator
  438. ----
  439. .. _class_LineEdit_property_caret_blink_interval:
  440. .. rst-class:: classref-property
  441. :ref:`float<class_float>` **caret_blink_interval** = ``0.65`` :ref:`🔗<class_LineEdit_property_caret_blink_interval>`
  442. .. rst-class:: classref-property-setget
  443. - |void| **set_caret_blink_interval**\ (\ value\: :ref:`float<class_float>`\ )
  444. - :ref:`float<class_float>` **get_caret_blink_interval**\ (\ )
  445. The interval at which the caret blinks (in seconds).
  446. .. rst-class:: classref-item-separator
  447. ----
  448. .. _class_LineEdit_property_caret_column:
  449. .. rst-class:: classref-property
  450. :ref:`int<class_int>` **caret_column** = ``0`` :ref:`🔗<class_LineEdit_property_caret_column>`
  451. .. rst-class:: classref-property-setget
  452. - |void| **set_caret_column**\ (\ value\: :ref:`int<class_int>`\ )
  453. - :ref:`int<class_int>` **get_caret_column**\ (\ )
  454. The caret's column position inside the **LineEdit**. When set, the text may scroll to accommodate it.
  455. .. rst-class:: classref-item-separator
  456. ----
  457. .. _class_LineEdit_property_caret_force_displayed:
  458. .. rst-class:: classref-property
  459. :ref:`bool<class_bool>` **caret_force_displayed** = ``false`` :ref:`🔗<class_LineEdit_property_caret_force_displayed>`
  460. .. rst-class:: classref-property-setget
  461. - |void| **set_caret_force_displayed**\ (\ value\: :ref:`bool<class_bool>`\ )
  462. - :ref:`bool<class_bool>` **is_caret_force_displayed**\ (\ )
  463. If ``true``, the **LineEdit** will always show the caret, even if focus is lost.
  464. .. rst-class:: classref-item-separator
  465. ----
  466. .. _class_LineEdit_property_caret_mid_grapheme:
  467. .. rst-class:: classref-property
  468. :ref:`bool<class_bool>` **caret_mid_grapheme** = ``false`` :ref:`🔗<class_LineEdit_property_caret_mid_grapheme>`
  469. .. rst-class:: classref-property-setget
  470. - |void| **set_caret_mid_grapheme_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  471. - :ref:`bool<class_bool>` **is_caret_mid_grapheme_enabled**\ (\ )
  472. Allow moving caret, selecting and removing the individual composite character components.
  473. \ **Note:** :kbd:`Backspace` is always removing individual composite character components.
  474. .. rst-class:: classref-item-separator
  475. ----
  476. .. _class_LineEdit_property_clear_button_enabled:
  477. .. rst-class:: classref-property
  478. :ref:`bool<class_bool>` **clear_button_enabled** = ``false`` :ref:`🔗<class_LineEdit_property_clear_button_enabled>`
  479. .. rst-class:: classref-property-setget
  480. - |void| **set_clear_button_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  481. - :ref:`bool<class_bool>` **is_clear_button_enabled**\ (\ )
  482. If ``true``, the **LineEdit** will show a clear button if :ref:`text<class_LineEdit_property_text>` is not empty, which can be used to clear the text quickly.
  483. .. rst-class:: classref-item-separator
  484. ----
  485. .. _class_LineEdit_property_context_menu_enabled:
  486. .. rst-class:: classref-property
  487. :ref:`bool<class_bool>` **context_menu_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_context_menu_enabled>`
  488. .. rst-class:: classref-property-setget
  489. - |void| **set_context_menu_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  490. - :ref:`bool<class_bool>` **is_context_menu_enabled**\ (\ )
  491. If ``true``, the context menu will appear when right-clicked.
  492. .. rst-class:: classref-item-separator
  493. ----
  494. .. _class_LineEdit_property_deselect_on_focus_loss_enabled:
  495. .. rst-class:: classref-property
  496. :ref:`bool<class_bool>` **deselect_on_focus_loss_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_deselect_on_focus_loss_enabled>`
  497. .. rst-class:: classref-property-setget
  498. - |void| **set_deselect_on_focus_loss_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  499. - :ref:`bool<class_bool>` **is_deselect_on_focus_loss_enabled**\ (\ )
  500. If ``true``, the selected text will be deselected when focus is lost.
  501. .. rst-class:: classref-item-separator
  502. ----
  503. .. _class_LineEdit_property_drag_and_drop_selection_enabled:
  504. .. rst-class:: classref-property
  505. :ref:`bool<class_bool>` **drag_and_drop_selection_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_drag_and_drop_selection_enabled>`
  506. .. rst-class:: classref-property-setget
  507. - |void| **set_drag_and_drop_selection_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  508. - :ref:`bool<class_bool>` **is_drag_and_drop_selection_enabled**\ (\ )
  509. If ``true``, allow drag and drop of selected text.
  510. .. rst-class:: classref-item-separator
  511. ----
  512. .. _class_LineEdit_property_draw_control_chars:
  513. .. rst-class:: classref-property
  514. :ref:`bool<class_bool>` **draw_control_chars** = ``false`` :ref:`🔗<class_LineEdit_property_draw_control_chars>`
  515. .. rst-class:: classref-property-setget
  516. - |void| **set_draw_control_chars**\ (\ value\: :ref:`bool<class_bool>`\ )
  517. - :ref:`bool<class_bool>` **get_draw_control_chars**\ (\ )
  518. If ``true``, control characters are displayed.
  519. .. rst-class:: classref-item-separator
  520. ----
  521. .. _class_LineEdit_property_editable:
  522. .. rst-class:: classref-property
  523. :ref:`bool<class_bool>` **editable** = ``true`` :ref:`🔗<class_LineEdit_property_editable>`
  524. .. rst-class:: classref-property-setget
  525. - |void| **set_editable**\ (\ value\: :ref:`bool<class_bool>`\ )
  526. - :ref:`bool<class_bool>` **is_editable**\ (\ )
  527. If ``false``, existing text cannot be modified and new text cannot be added.
  528. .. rst-class:: classref-item-separator
  529. ----
  530. .. _class_LineEdit_property_emoji_menu_enabled:
  531. .. rst-class:: classref-property
  532. :ref:`bool<class_bool>` **emoji_menu_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_emoji_menu_enabled>`
  533. .. rst-class:: classref-property-setget
  534. - |void| **set_emoji_menu_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  535. - :ref:`bool<class_bool>` **is_emoji_menu_enabled**\ (\ )
  536. If ``true``, "Emoji and Symbols" menu is enabled.
  537. .. rst-class:: classref-item-separator
  538. ----
  539. .. _class_LineEdit_property_expand_to_text_length:
  540. .. rst-class:: classref-property
  541. :ref:`bool<class_bool>` **expand_to_text_length** = ``false`` :ref:`🔗<class_LineEdit_property_expand_to_text_length>`
  542. .. rst-class:: classref-property-setget
  543. - |void| **set_expand_to_text_length_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  544. - :ref:`bool<class_bool>` **is_expand_to_text_length_enabled**\ (\ )
  545. If ``true``, the **LineEdit** width will increase to stay longer than the :ref:`text<class_LineEdit_property_text>`. It will **not** compress if the :ref:`text<class_LineEdit_property_text>` is shortened.
  546. .. rst-class:: classref-item-separator
  547. ----
  548. .. _class_LineEdit_property_flat:
  549. .. rst-class:: classref-property
  550. :ref:`bool<class_bool>` **flat** = ``false`` :ref:`🔗<class_LineEdit_property_flat>`
  551. .. rst-class:: classref-property-setget
  552. - |void| **set_flat**\ (\ value\: :ref:`bool<class_bool>`\ )
  553. - :ref:`bool<class_bool>` **is_flat**\ (\ )
  554. If ``true``, the **LineEdit** doesn't display decoration.
  555. .. rst-class:: classref-item-separator
  556. ----
  557. .. _class_LineEdit_property_keep_editing_on_text_submit:
  558. .. rst-class:: classref-property
  559. :ref:`bool<class_bool>` **keep_editing_on_text_submit** = ``false`` :ref:`🔗<class_LineEdit_property_keep_editing_on_text_submit>`
  560. .. rst-class:: classref-property-setget
  561. - |void| **set_keep_editing_on_text_submit**\ (\ value\: :ref:`bool<class_bool>`\ )
  562. - :ref:`bool<class_bool>` **is_editing_kept_on_text_submit**\ (\ )
  563. If ``true``, the **LineEdit** will not exit edit mode when text is submitted by pressing ``ui_text_submit`` action (by default: :kbd:`Enter` or :kbd:`Kp Enter`).
  564. .. rst-class:: classref-item-separator
  565. ----
  566. .. _class_LineEdit_property_language:
  567. .. rst-class:: classref-property
  568. :ref:`String<class_String>` **language** = ``""`` :ref:`🔗<class_LineEdit_property_language>`
  569. .. rst-class:: classref-property-setget
  570. - |void| **set_language**\ (\ value\: :ref:`String<class_String>`\ )
  571. - :ref:`String<class_String>` **get_language**\ (\ )
  572. Language code used for line-breaking and text shaping algorithms. If left empty, current locale is used instead.
  573. .. rst-class:: classref-item-separator
  574. ----
  575. .. _class_LineEdit_property_max_length:
  576. .. rst-class:: classref-property
  577. :ref:`int<class_int>` **max_length** = ``0`` :ref:`🔗<class_LineEdit_property_max_length>`
  578. .. rst-class:: classref-property-setget
  579. - |void| **set_max_length**\ (\ value\: :ref:`int<class_int>`\ )
  580. - :ref:`int<class_int>` **get_max_length**\ (\ )
  581. Maximum number of characters that can be entered inside the **LineEdit**. If ``0``, there is no limit.
  582. When a limit is defined, characters that would exceed :ref:`max_length<class_LineEdit_property_max_length>` are truncated. This happens both for existing :ref:`text<class_LineEdit_property_text>` contents when setting the max length, or for new text inserted in the **LineEdit**, including pasting.
  583. If any input text is truncated, the :ref:`text_change_rejected<class_LineEdit_signal_text_change_rejected>` signal is emitted with the truncated substring as parameter:
  584. .. tabs::
  585. .. code-tab:: gdscript
  586. text = "Hello world"
  587. max_length = 5
  588. # `text` becomes "Hello".
  589. max_length = 10
  590. text += " goodbye"
  591. # `text` becomes "Hello good".
  592. # `text_change_rejected` is emitted with "bye" as parameter.
  593. .. code-tab:: csharp
  594. Text = "Hello world";
  595. MaxLength = 5;
  596. // `Text` becomes "Hello".
  597. MaxLength = 10;
  598. Text += " goodbye";
  599. // `Text` becomes "Hello good".
  600. // `text_change_rejected` is emitted with "bye" as parameter.
  601. .. rst-class:: classref-item-separator
  602. ----
  603. .. _class_LineEdit_property_middle_mouse_paste_enabled:
  604. .. rst-class:: classref-property
  605. :ref:`bool<class_bool>` **middle_mouse_paste_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_middle_mouse_paste_enabled>`
  606. .. rst-class:: classref-property-setget
  607. - |void| **set_middle_mouse_paste_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  608. - :ref:`bool<class_bool>` **is_middle_mouse_paste_enabled**\ (\ )
  609. If ``false``, using middle mouse button to paste clipboard will be disabled.
  610. \ **Note:** This method is only implemented on Linux.
  611. .. rst-class:: classref-item-separator
  612. ----
  613. .. _class_LineEdit_property_placeholder_text:
  614. .. rst-class:: classref-property
  615. :ref:`String<class_String>` **placeholder_text** = ``""`` :ref:`🔗<class_LineEdit_property_placeholder_text>`
  616. .. rst-class:: classref-property-setget
  617. - |void| **set_placeholder**\ (\ value\: :ref:`String<class_String>`\ )
  618. - :ref:`String<class_String>` **get_placeholder**\ (\ )
  619. Text shown when the **LineEdit** is empty. It is **not** the **LineEdit**'s default value (see :ref:`text<class_LineEdit_property_text>`).
  620. .. rst-class:: classref-item-separator
  621. ----
  622. .. _class_LineEdit_property_right_icon:
  623. .. rst-class:: classref-property
  624. :ref:`Texture2D<class_Texture2D>` **right_icon** :ref:`🔗<class_LineEdit_property_right_icon>`
  625. .. rst-class:: classref-property-setget
  626. - |void| **set_right_icon**\ (\ value\: :ref:`Texture2D<class_Texture2D>`\ )
  627. - :ref:`Texture2D<class_Texture2D>` **get_right_icon**\ (\ )
  628. Sets the icon that will appear in the right end of the **LineEdit** if there's no :ref:`text<class_LineEdit_property_text>`, or always, if :ref:`clear_button_enabled<class_LineEdit_property_clear_button_enabled>` is set to ``false``.
  629. .. rst-class:: classref-item-separator
  630. ----
  631. .. _class_LineEdit_property_secret:
  632. .. rst-class:: classref-property
  633. :ref:`bool<class_bool>` **secret** = ``false`` :ref:`🔗<class_LineEdit_property_secret>`
  634. .. rst-class:: classref-property-setget
  635. - |void| **set_secret**\ (\ value\: :ref:`bool<class_bool>`\ )
  636. - :ref:`bool<class_bool>` **is_secret**\ (\ )
  637. If ``true``, every character is replaced with the secret character (see :ref:`secret_character<class_LineEdit_property_secret_character>`).
  638. .. rst-class:: classref-item-separator
  639. ----
  640. .. _class_LineEdit_property_secret_character:
  641. .. rst-class:: classref-property
  642. :ref:`String<class_String>` **secret_character** = ``"•"`` :ref:`🔗<class_LineEdit_property_secret_character>`
  643. .. rst-class:: classref-property-setget
  644. - |void| **set_secret_character**\ (\ value\: :ref:`String<class_String>`\ )
  645. - :ref:`String<class_String>` **get_secret_character**\ (\ )
  646. The character to use to mask secret input. Only a single character can be used as the secret character. If it is longer than one character, only the first one will be used. If it is empty, a space will be used instead.
  647. .. rst-class:: classref-item-separator
  648. ----
  649. .. _class_LineEdit_property_select_all_on_focus:
  650. .. rst-class:: classref-property
  651. :ref:`bool<class_bool>` **select_all_on_focus** = ``false`` :ref:`🔗<class_LineEdit_property_select_all_on_focus>`
  652. .. rst-class:: classref-property-setget
  653. - |void| **set_select_all_on_focus**\ (\ value\: :ref:`bool<class_bool>`\ )
  654. - :ref:`bool<class_bool>` **is_select_all_on_focus**\ (\ )
  655. If ``true``, the **LineEdit** will select the whole text when it gains focus.
  656. .. rst-class:: classref-item-separator
  657. ----
  658. .. _class_LineEdit_property_selecting_enabled:
  659. .. rst-class:: classref-property
  660. :ref:`bool<class_bool>` **selecting_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_selecting_enabled>`
  661. .. rst-class:: classref-property-setget
  662. - |void| **set_selecting_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  663. - :ref:`bool<class_bool>` **is_selecting_enabled**\ (\ )
  664. If ``false``, it's impossible to select the text using mouse nor keyboard.
  665. .. rst-class:: classref-item-separator
  666. ----
  667. .. _class_LineEdit_property_shortcut_keys_enabled:
  668. .. rst-class:: classref-property
  669. :ref:`bool<class_bool>` **shortcut_keys_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_shortcut_keys_enabled>`
  670. .. rst-class:: classref-property-setget
  671. - |void| **set_shortcut_keys_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  672. - :ref:`bool<class_bool>` **is_shortcut_keys_enabled**\ (\ )
  673. If ``true``, shortcut keys for context menu items are enabled, even if the context menu is disabled.
  674. .. rst-class:: classref-item-separator
  675. ----
  676. .. _class_LineEdit_property_structured_text_bidi_override:
  677. .. rst-class:: classref-property
  678. :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **structured_text_bidi_override** = ``0`` :ref:`🔗<class_LineEdit_property_structured_text_bidi_override>`
  679. .. rst-class:: classref-property-setget
  680. - |void| **set_structured_text_bidi_override**\ (\ value\: :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>`\ )
  681. - :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **get_structured_text_bidi_override**\ (\ )
  682. Set BiDi algorithm override for the structured text.
  683. .. rst-class:: classref-item-separator
  684. ----
  685. .. _class_LineEdit_property_structured_text_bidi_override_options:
  686. .. rst-class:: classref-property
  687. :ref:`Array<class_Array>` **structured_text_bidi_override_options** = ``[]`` :ref:`🔗<class_LineEdit_property_structured_text_bidi_override_options>`
  688. .. rst-class:: classref-property-setget
  689. - |void| **set_structured_text_bidi_override_options**\ (\ value\: :ref:`Array<class_Array>`\ )
  690. - :ref:`Array<class_Array>` **get_structured_text_bidi_override_options**\ (\ )
  691. Set additional options for BiDi override.
  692. .. rst-class:: classref-item-separator
  693. ----
  694. .. _class_LineEdit_property_text:
  695. .. rst-class:: classref-property
  696. :ref:`String<class_String>` **text** = ``""`` :ref:`🔗<class_LineEdit_property_text>`
  697. .. rst-class:: classref-property-setget
  698. - |void| **set_text**\ (\ value\: :ref:`String<class_String>`\ )
  699. - :ref:`String<class_String>` **get_text**\ (\ )
  700. String value of the **LineEdit**.
  701. \ **Note:** Changing text using this property won't emit the :ref:`text_changed<class_LineEdit_signal_text_changed>` signal.
  702. .. rst-class:: classref-item-separator
  703. ----
  704. .. _class_LineEdit_property_text_direction:
  705. .. rst-class:: classref-property
  706. :ref:`TextDirection<enum_Control_TextDirection>` **text_direction** = ``0`` :ref:`🔗<class_LineEdit_property_text_direction>`
  707. .. rst-class:: classref-property-setget
  708. - |void| **set_text_direction**\ (\ value\: :ref:`TextDirection<enum_Control_TextDirection>`\ )
  709. - :ref:`TextDirection<enum_Control_TextDirection>` **get_text_direction**\ (\ )
  710. Base text writing direction.
  711. .. rst-class:: classref-item-separator
  712. ----
  713. .. _class_LineEdit_property_virtual_keyboard_enabled:
  714. .. rst-class:: classref-property
  715. :ref:`bool<class_bool>` **virtual_keyboard_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_virtual_keyboard_enabled>`
  716. .. rst-class:: classref-property-setget
  717. - |void| **set_virtual_keyboard_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  718. - :ref:`bool<class_bool>` **is_virtual_keyboard_enabled**\ (\ )
  719. If ``true``, the native virtual keyboard is shown when focused on platforms that support it.
  720. .. rst-class:: classref-item-separator
  721. ----
  722. .. _class_LineEdit_property_virtual_keyboard_type:
  723. .. rst-class:: classref-property
  724. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **virtual_keyboard_type** = ``0`` :ref:`🔗<class_LineEdit_property_virtual_keyboard_type>`
  725. .. rst-class:: classref-property-setget
  726. - |void| **set_virtual_keyboard_type**\ (\ value\: :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>`\ )
  727. - :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **get_virtual_keyboard_type**\ (\ )
  728. Specifies the type of virtual keyboard to show.
  729. .. rst-class:: classref-section-separator
  730. ----
  731. .. rst-class:: classref-descriptions-group
  732. Method Descriptions
  733. -------------------
  734. .. _class_LineEdit_method_apply_ime:
  735. .. rst-class:: classref-method
  736. |void| **apply_ime**\ (\ ) :ref:`🔗<class_LineEdit_method_apply_ime>`
  737. Applies text from the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ (IME) and closes the IME if it is open.
  738. .. rst-class:: classref-item-separator
  739. ----
  740. .. _class_LineEdit_method_cancel_ime:
  741. .. rst-class:: classref-method
  742. |void| **cancel_ime**\ (\ ) :ref:`🔗<class_LineEdit_method_cancel_ime>`
  743. Closes the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ (IME) if it is open. Any text in the IME will be lost.
  744. .. rst-class:: classref-item-separator
  745. ----
  746. .. _class_LineEdit_method_clear:
  747. .. rst-class:: classref-method
  748. |void| **clear**\ (\ ) :ref:`🔗<class_LineEdit_method_clear>`
  749. Erases the **LineEdit**'s :ref:`text<class_LineEdit_property_text>`.
  750. .. rst-class:: classref-item-separator
  751. ----
  752. .. _class_LineEdit_method_delete_char_at_caret:
  753. .. rst-class:: classref-method
  754. |void| **delete_char_at_caret**\ (\ ) :ref:`🔗<class_LineEdit_method_delete_char_at_caret>`
  755. Deletes one character at the caret's current position (equivalent to pressing :kbd:`Delete`).
  756. .. rst-class:: classref-item-separator
  757. ----
  758. .. _class_LineEdit_method_delete_text:
  759. .. rst-class:: classref-method
  760. |void| **delete_text**\ (\ from_column\: :ref:`int<class_int>`, to_column\: :ref:`int<class_int>`\ ) :ref:`🔗<class_LineEdit_method_delete_text>`
  761. Deletes a section of the :ref:`text<class_LineEdit_property_text>` going from position ``from_column`` to ``to_column``. Both parameters should be within the text's length.
  762. .. rst-class:: classref-item-separator
  763. ----
  764. .. _class_LineEdit_method_deselect:
  765. .. rst-class:: classref-method
  766. |void| **deselect**\ (\ ) :ref:`🔗<class_LineEdit_method_deselect>`
  767. Clears the current selection.
  768. .. rst-class:: classref-item-separator
  769. ----
  770. .. _class_LineEdit_method_edit:
  771. .. rst-class:: classref-method
  772. |void| **edit**\ (\ ) :ref:`🔗<class_LineEdit_method_edit>`
  773. Allows entering edit mode whether the **LineEdit** is focused or not.
  774. See also :ref:`keep_editing_on_text_submit<class_LineEdit_property_keep_editing_on_text_submit>`.
  775. .. rst-class:: classref-item-separator
  776. ----
  777. .. _class_LineEdit_method_get_menu:
  778. .. rst-class:: classref-method
  779. :ref:`PopupMenu<class_PopupMenu>` **get_menu**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_get_menu>`
  780. Returns the :ref:`PopupMenu<class_PopupMenu>` of this **LineEdit**. By default, this menu is displayed when right-clicking on the **LineEdit**.
  781. You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see :ref:`MenuItems<enum_LineEdit_MenuItems>`). For example:
  782. .. tabs::
  783. .. code-tab:: gdscript
  784. func _ready():
  785. var menu = get_menu()
  786. # Remove all items after "Redo".
  787. menu.item_count = menu.get_item_index(MENU_REDO) + 1
  788. # Add custom items.
  789. menu.add_separator()
  790. menu.add_item("Insert Date", MENU_MAX + 1)
  791. # Connect callback.
  792. menu.id_pressed.connect(_on_item_pressed)
  793. func _on_item_pressed(id):
  794. if id == MENU_MAX + 1:
  795. insert_text_at_caret(Time.get_date_string_from_system())
  796. .. code-tab:: csharp
  797. public override void _Ready()
  798. {
  799. var menu = GetMenu();
  800. // Remove all items after "Redo".
  801. menu.ItemCount = menu.GetItemIndex(LineEdit.MenuItems.Redo) + 1;
  802. // Add custom items.
  803. menu.AddSeparator();
  804. menu.AddItem("Insert Date", LineEdit.MenuItems.Max + 1);
  805. // Add event handler.
  806. menu.IdPressed += OnItemPressed;
  807. }
  808. public void OnItemPressed(int id)
  809. {
  810. if (id == LineEdit.MenuItems.Max + 1)
  811. {
  812. InsertTextAtCaret(Time.GetDateStringFromSystem());
  813. }
  814. }
  815. \ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`Window.visible<class_Window_property_visible>` property.
  816. .. rst-class:: classref-item-separator
  817. ----
  818. .. _class_LineEdit_method_get_scroll_offset:
  819. .. rst-class:: classref-method
  820. :ref:`float<class_float>` **get_scroll_offset**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_get_scroll_offset>`
  821. Returns the scroll offset due to :ref:`caret_column<class_LineEdit_property_caret_column>`, as a number of characters.
  822. .. rst-class:: classref-item-separator
  823. ----
  824. .. _class_LineEdit_method_get_selected_text:
  825. .. rst-class:: classref-method
  826. :ref:`String<class_String>` **get_selected_text**\ (\ ) :ref:`🔗<class_LineEdit_method_get_selected_text>`
  827. Returns the text inside the selection.
  828. .. rst-class:: classref-item-separator
  829. ----
  830. .. _class_LineEdit_method_get_selection_from_column:
  831. .. rst-class:: classref-method
  832. :ref:`int<class_int>` **get_selection_from_column**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_get_selection_from_column>`
  833. Returns the selection begin column.
  834. .. rst-class:: classref-item-separator
  835. ----
  836. .. _class_LineEdit_method_get_selection_to_column:
  837. .. rst-class:: classref-method
  838. :ref:`int<class_int>` **get_selection_to_column**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_get_selection_to_column>`
  839. Returns the selection end column.
  840. .. rst-class:: classref-item-separator
  841. ----
  842. .. _class_LineEdit_method_has_ime_text:
  843. .. rst-class:: classref-method
  844. :ref:`bool<class_bool>` **has_ime_text**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_has_ime_text>`
  845. Returns ``true`` if the user has text in the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ (IME).
  846. .. rst-class:: classref-item-separator
  847. ----
  848. .. _class_LineEdit_method_has_redo:
  849. .. rst-class:: classref-method
  850. :ref:`bool<class_bool>` **has_redo**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_has_redo>`
  851. Returns ``true`` if a "redo" action is available.
  852. .. rst-class:: classref-item-separator
  853. ----
  854. .. _class_LineEdit_method_has_selection:
  855. .. rst-class:: classref-method
  856. :ref:`bool<class_bool>` **has_selection**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_has_selection>`
  857. Returns ``true`` if the user has selected text.
  858. .. rst-class:: classref-item-separator
  859. ----
  860. .. _class_LineEdit_method_has_undo:
  861. .. rst-class:: classref-method
  862. :ref:`bool<class_bool>` **has_undo**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_has_undo>`
  863. Returns ``true`` if an "undo" action is available.
  864. .. rst-class:: classref-item-separator
  865. ----
  866. .. _class_LineEdit_method_insert_text_at_caret:
  867. .. rst-class:: classref-method
  868. |void| **insert_text_at_caret**\ (\ text\: :ref:`String<class_String>`\ ) :ref:`🔗<class_LineEdit_method_insert_text_at_caret>`
  869. Inserts ``text`` at the caret. If the resulting value is longer than :ref:`max_length<class_LineEdit_property_max_length>`, nothing happens.
  870. .. rst-class:: classref-item-separator
  871. ----
  872. .. _class_LineEdit_method_is_editing:
  873. .. rst-class:: classref-method
  874. :ref:`bool<class_bool>` **is_editing**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_is_editing>`
  875. Returns whether the **LineEdit** is being edited.
  876. .. rst-class:: classref-item-separator
  877. ----
  878. .. _class_LineEdit_method_is_menu_visible:
  879. .. rst-class:: classref-method
  880. :ref:`bool<class_bool>` **is_menu_visible**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_is_menu_visible>`
  881. Returns whether the menu is visible. Use this instead of ``get_menu().visible`` to improve performance (so the creation of the menu is avoided).
  882. .. rst-class:: classref-item-separator
  883. ----
  884. .. _class_LineEdit_method_menu_option:
  885. .. rst-class:: classref-method
  886. |void| **menu_option**\ (\ option\: :ref:`int<class_int>`\ ) :ref:`🔗<class_LineEdit_method_menu_option>`
  887. Executes a given action as defined in the :ref:`MenuItems<enum_LineEdit_MenuItems>` enum.
  888. .. rst-class:: classref-item-separator
  889. ----
  890. .. _class_LineEdit_method_select:
  891. .. rst-class:: classref-method
  892. |void| **select**\ (\ from\: :ref:`int<class_int>` = 0, to\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_LineEdit_method_select>`
  893. Selects characters inside **LineEdit** between ``from`` and ``to``. By default, ``from`` is at the beginning and ``to`` at the end.
  894. .. tabs::
  895. .. code-tab:: gdscript
  896. text = "Welcome"
  897. select() # Will select "Welcome".
  898. select(4) # Will select "ome".
  899. select(2, 5) # Will select "lco".
  900. .. code-tab:: csharp
  901. Text = "Welcome";
  902. Select(); // Will select "Welcome".
  903. Select(4); // Will select "ome".
  904. Select(2, 5); // Will select "lco".
  905. .. rst-class:: classref-item-separator
  906. ----
  907. .. _class_LineEdit_method_select_all:
  908. .. rst-class:: classref-method
  909. |void| **select_all**\ (\ ) :ref:`🔗<class_LineEdit_method_select_all>`
  910. Selects the whole :ref:`String<class_String>`.
  911. .. rst-class:: classref-item-separator
  912. ----
  913. .. _class_LineEdit_method_unedit:
  914. .. rst-class:: classref-method
  915. |void| **unedit**\ (\ ) :ref:`🔗<class_LineEdit_method_unedit>`
  916. Allows exiting edit mode while preserving focus.
  917. .. rst-class:: classref-section-separator
  918. ----
  919. .. rst-class:: classref-descriptions-group
  920. Theme Property Descriptions
  921. ---------------------------
  922. .. _class_LineEdit_theme_color_caret_color:
  923. .. rst-class:: classref-themeproperty
  924. :ref:`Color<class_Color>` **caret_color** = ``Color(0.95, 0.95, 0.95, 1)`` :ref:`🔗<class_LineEdit_theme_color_caret_color>`
  925. Color of the **LineEdit**'s caret (text cursor). This can be set to a fully transparent color to hide the caret entirely.
  926. .. rst-class:: classref-item-separator
  927. ----
  928. .. _class_LineEdit_theme_color_clear_button_color:
  929. .. rst-class:: classref-themeproperty
  930. :ref:`Color<class_Color>` **clear_button_color** = ``Color(0.875, 0.875, 0.875, 1)`` :ref:`🔗<class_LineEdit_theme_color_clear_button_color>`
  931. Color used as default tint for the clear button.
  932. .. rst-class:: classref-item-separator
  933. ----
  934. .. _class_LineEdit_theme_color_clear_button_color_pressed:
  935. .. rst-class:: classref-themeproperty
  936. :ref:`Color<class_Color>` **clear_button_color_pressed** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_LineEdit_theme_color_clear_button_color_pressed>`
  937. Color used for the clear button when it's pressed.
  938. .. rst-class:: classref-item-separator
  939. ----
  940. .. _class_LineEdit_theme_color_font_color:
  941. .. rst-class:: classref-themeproperty
  942. :ref:`Color<class_Color>` **font_color** = ``Color(0.875, 0.875, 0.875, 1)`` :ref:`🔗<class_LineEdit_theme_color_font_color>`
  943. Default font color.
  944. .. rst-class:: classref-item-separator
  945. ----
  946. .. _class_LineEdit_theme_color_font_outline_color:
  947. .. rst-class:: classref-themeproperty
  948. :ref:`Color<class_Color>` **font_outline_color** = ``Color(0, 0, 0, 1)`` :ref:`🔗<class_LineEdit_theme_color_font_outline_color>`
  949. The tint of text outline of the **LineEdit**.
  950. .. rst-class:: classref-item-separator
  951. ----
  952. .. _class_LineEdit_theme_color_font_placeholder_color:
  953. .. rst-class:: classref-themeproperty
  954. :ref:`Color<class_Color>` **font_placeholder_color** = ``Color(0.875, 0.875, 0.875, 0.6)`` :ref:`🔗<class_LineEdit_theme_color_font_placeholder_color>`
  955. Font color for :ref:`placeholder_text<class_LineEdit_property_placeholder_text>`.
  956. .. rst-class:: classref-item-separator
  957. ----
  958. .. _class_LineEdit_theme_color_font_selected_color:
  959. .. rst-class:: classref-themeproperty
  960. :ref:`Color<class_Color>` **font_selected_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_LineEdit_theme_color_font_selected_color>`
  961. Font color for selected text (inside the selection rectangle).
  962. .. rst-class:: classref-item-separator
  963. ----
  964. .. _class_LineEdit_theme_color_font_uneditable_color:
  965. .. rst-class:: classref-themeproperty
  966. :ref:`Color<class_Color>` **font_uneditable_color** = ``Color(0.875, 0.875, 0.875, 0.5)`` :ref:`🔗<class_LineEdit_theme_color_font_uneditable_color>`
  967. Font color when editing is disabled.
  968. .. rst-class:: classref-item-separator
  969. ----
  970. .. _class_LineEdit_theme_color_selection_color:
  971. .. rst-class:: classref-themeproperty
  972. :ref:`Color<class_Color>` **selection_color** = ``Color(0.5, 0.5, 0.5, 1)`` :ref:`🔗<class_LineEdit_theme_color_selection_color>`
  973. Color of the selection rectangle.
  974. .. rst-class:: classref-item-separator
  975. ----
  976. .. _class_LineEdit_theme_constant_caret_width:
  977. .. rst-class:: classref-themeproperty
  978. :ref:`int<class_int>` **caret_width** = ``1`` :ref:`🔗<class_LineEdit_theme_constant_caret_width>`
  979. The caret's width in pixels. Greater values can be used to improve accessibility by ensuring the caret is easily visible, or to ensure consistency with a large font size.
  980. .. rst-class:: classref-item-separator
  981. ----
  982. .. _class_LineEdit_theme_constant_minimum_character_width:
  983. .. rst-class:: classref-themeproperty
  984. :ref:`int<class_int>` **minimum_character_width** = ``4`` :ref:`🔗<class_LineEdit_theme_constant_minimum_character_width>`
  985. Minimum horizontal space for the text (not counting the clear button and content margins). This value is measured in count of 'M' characters (i.e. this number of 'M' characters can be displayed without scrolling).
  986. .. rst-class:: classref-item-separator
  987. ----
  988. .. _class_LineEdit_theme_constant_outline_size:
  989. .. rst-class:: classref-themeproperty
  990. :ref:`int<class_int>` **outline_size** = ``0`` :ref:`🔗<class_LineEdit_theme_constant_outline_size>`
  991. The size of the text outline.
  992. \ **Note:** If using a font with :ref:`FontFile.multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` enabled, its :ref:`FontFile.msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` must be set to at least *twice* the value of :ref:`outline_size<class_LineEdit_theme_constant_outline_size>` for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
  993. .. rst-class:: classref-item-separator
  994. ----
  995. .. _class_LineEdit_theme_font_font:
  996. .. rst-class:: classref-themeproperty
  997. :ref:`Font<class_Font>` **font** :ref:`🔗<class_LineEdit_theme_font_font>`
  998. Font used for the text.
  999. .. rst-class:: classref-item-separator
  1000. ----
  1001. .. _class_LineEdit_theme_font_size_font_size:
  1002. .. rst-class:: classref-themeproperty
  1003. :ref:`int<class_int>` **font_size** :ref:`🔗<class_LineEdit_theme_font_size_font_size>`
  1004. Font size of the **LineEdit**'s text.
  1005. .. rst-class:: classref-item-separator
  1006. ----
  1007. .. _class_LineEdit_theme_icon_clear:
  1008. .. rst-class:: classref-themeproperty
  1009. :ref:`Texture2D<class_Texture2D>` **clear** :ref:`🔗<class_LineEdit_theme_icon_clear>`
  1010. Texture for the clear button. See :ref:`clear_button_enabled<class_LineEdit_property_clear_button_enabled>`.
  1011. .. rst-class:: classref-item-separator
  1012. ----
  1013. .. _class_LineEdit_theme_style_focus:
  1014. .. rst-class:: classref-themeproperty
  1015. :ref:`StyleBox<class_StyleBox>` **focus** :ref:`🔗<class_LineEdit_theme_style_focus>`
  1016. Background used when **LineEdit** has GUI focus. The :ref:`focus<class_LineEdit_theme_style_focus>` :ref:`StyleBox<class_StyleBox>` is displayed *over* the base :ref:`StyleBox<class_StyleBox>`, so a partially transparent :ref:`StyleBox<class_StyleBox>` should be used to ensure the base :ref:`StyleBox<class_StyleBox>` remains visible. A :ref:`StyleBox<class_StyleBox>` that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a :ref:`StyleBoxEmpty<class_StyleBoxEmpty>` resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
  1017. .. rst-class:: classref-item-separator
  1018. ----
  1019. .. _class_LineEdit_theme_style_normal:
  1020. .. rst-class:: classref-themeproperty
  1021. :ref:`StyleBox<class_StyleBox>` **normal** :ref:`🔗<class_LineEdit_theme_style_normal>`
  1022. Default background for the **LineEdit**.
  1023. .. rst-class:: classref-item-separator
  1024. ----
  1025. .. _class_LineEdit_theme_style_read_only:
  1026. .. rst-class:: classref-themeproperty
  1027. :ref:`StyleBox<class_StyleBox>` **read_only** :ref:`🔗<class_LineEdit_theme_style_read_only>`
  1028. Background used when **LineEdit** is in read-only mode (:ref:`editable<class_LineEdit_property_editable>` is set to ``false``).
  1029. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1030. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1031. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1032. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1033. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1034. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  1035. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  1036. .. |void| replace:: :abbr:`void (No return value.)`