diff options
Diffstat (limited to 'doc/classes/LineEdit.xml')
-rw-r--r-- | doc/classes/LineEdit.xml | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index de216563d3..59bad00f25 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="LineEdit" inherits="Control" category="Core" version="3.2"> +<class name="LineEdit" inherits="Control" version="3.2"> <brief_description> Control that provides single-line string editing. </brief_description> <description> - LineEdit provides a single-line string editor, used for text fields. It features many built-in shortcuts which will always be available: + LineEdit provides a single-line string editor, used for text fields. + It features many built-in shortcuts which will always be available ([code]Ctrl[/code] here maps to [code]Command[/code] on macOS): - Ctrl + C: Copy - Ctrl + X: Cut - Ctrl + V or Ctrl + Y: Paste/"yank" @@ -14,6 +15,15 @@ - Ctrl + K: Delete text from the cursor position to the end of the line - Ctrl + A: Select all text - Up/Down arrow: Move the cursor to the beginning/end of the line + On macOS, some extra keyboard shortcuts are available: + - Ctrl + F: Like the right arrow key, move the cursor one character right + - Ctrl + B: Like the left arrow key, move the cursor one character left + - Ctrl + P: Like the up arrow key, move the cursor to the previous line + - Ctrl + N: Like the down arrow key, move the cursor to the next line + - Ctrl + D: Like the Delete key, delete the character on the right side of cursor + - Ctrl + H: Like the Backspace key, delete the character on the left side of the cursor + - Command + Left arrow: Like the Home key, move the cursor to the beginning of the line + - Command + Right arrow: Like the End key, move the cursor to the end of the line </description> <tutorials> </tutorials> @@ -54,7 +64,7 @@ <argument index="0" name="option" type="int"> </argument> <description> - Executes a given action as defined in the[code]MENU_*[/code] enum. + Executes a given action as defined in the [enum MenuItems] enum. </description> </method> <method name="select"> @@ -68,9 +78,9 @@ Selects characters inside [LineEdit] between [code]from[/code] and [code]to[/code]. By default, [code]from[/code] is at the beginning and [code]to[/code] at the end. [codeblock] text = "Welcome" - select() # Will select "Welcome" - select(4) # Will select "ome" - select(2, 5) # Will select "lco" + select() # Will select "Welcome". + select(4) # Will select "ome". + select(2, 5) # Will select "lco". [/codeblock] </description> </method> @@ -84,7 +94,7 @@ </methods> <members> <member name="align" type="int" setter="set_align" getter="get_align" enum="LineEdit.Align" default="0"> - Text alignment as defined in the [code]ALIGN_*[/code] enum. + Text alignment as defined in the [enum Align] enum. </member> <member name="caret_blink" type="bool" setter="cursor_set_blink_enabled" getter="cursor_get_blink_enabled" default="false"> If [code]true[/code], the caret (visual cursor) blinks. @@ -96,7 +106,7 @@ The cursor's position inside the [LineEdit]. When set, the text may scroll to accommodate it. </member> <member name="clear_button_enabled" type="bool" setter="set_clear_button_enabled" getter="is_clear_button_enabled" default="false"> - If [code]true[/code], the [LineEdit] will show a clear button if [code]text[/code] is not empty. + If [code]true[/code], the [LineEdit] will show a clear button if [code]text[/code] is not empty, which can be used to clear the text quickly. </member> <member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled" default="true"> If [code]true[/code], the context menu will appear when right-clicked. @@ -128,14 +138,22 @@ The character to use to mask secret input (defaults to "*"). Only a single character can be used as the secret character. </member> <member name="selecting_enabled" type="bool" setter="set_selecting_enabled" getter="is_selecting_enabled" default="true"> + If [code]false[/code], it's impossible to select the text using mouse nor keyboard. </member> <member name="shortcut_keys_enabled" type="bool" setter="set_shortcut_keys_enabled" getter="is_shortcut_keys_enabled" default="true"> + If [code]false[/code], using shortcuts will be disabled. </member> <member name="text" type="String" setter="set_text" getter="get_text" default=""""> String value of the [LineEdit]. + [b]Note:[/b] Changing text using this property won't emit the [signal text_changed] signal. </member> </members> <signals> + <signal name="text_change_rejected"> + <description> + Emitted when trying to append text that would overflow the [member max_length]. + </description> + </signal> <signal name="text_changed"> <argument index="0" name="new_text" type="String"> </argument> @@ -192,30 +210,43 @@ </constants> <theme_items> <theme_item name="clear" type="Texture"> + Texture for the clear button. See [member clear_button_enabled]. </theme_item> <theme_item name="clear_button_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + Color used as default tint for the clear button. </theme_item> <theme_item name="clear_button_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )"> + Color used for the clear button when it's pressed. </theme_item> <theme_item name="cursor_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )"> + Color of the [LineEdit]'s visual cursor (caret). </theme_item> <theme_item name="focus" type="StyleBox"> + Background used when [LineEdit] has GUI focus. </theme_item> <theme_item name="font" type="Font"> + Font used for the text. </theme_item> <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )"> + Default font color. </theme_item> <theme_item name="font_color_selected" type="Color" default="Color( 0, 0, 0, 1 )"> + Font color for selected text (inside the selection rectangle). </theme_item> <theme_item name="font_color_uneditable" type="Color" default="Color( 0.88, 0.88, 0.88, 0.5 )"> + Font color when editing is disabled. </theme_item> <theme_item name="minimum_spaces" type="int" default="12"> + Minimum horizontal space for the text (not counting the clear button and content margins). This value is measured in count of space characters (i.e. this amount of space characters can be displayed without scrolling). </theme_item> <theme_item name="normal" type="StyleBox"> + Default background for the [LineEdit]. </theme_item> <theme_item name="read_only" type="StyleBox"> + Background used when [LineEdit] is in read-only mode ([member editable] is set to [code]false[/code]). </theme_item> <theme_item name="selection_color" type="Color" default="Color( 0.49, 0.49, 0.49, 1 )"> + Color of the selection rectangle. </theme_item> </theme_items> </class> |