class_lineedit.rst 82 KB

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