diff options
Diffstat (limited to 'doc/classes/TextEdit.xml')
-rw-r--r-- | doc/classes/TextEdit.xml | 120 |
1 files changed, 80 insertions, 40 deletions
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index b8e2f7f03c..a4edaa79c7 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TextEdit" inherits="Control" version="4.0"> +<class name="TextEdit" inherits="Control" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Multiline text editing control. </brief_description> @@ -201,7 +201,7 @@ <method name="get_last_full_visible_line" qualifiers="const"> <return type="int" /> <description> - Return the last visible line. Use [method get_last_full_visible_line_wrap_index] for the wrap index. + Returns the last visible line. Use [method get_last_full_visible_line_wrap_index] for the wrap index. </description> </method> <method name="get_last_full_visible_line_wrap_index" qualifiers="const"> @@ -233,8 +233,9 @@ <method name="get_line_column_at_pos" qualifiers="const"> <return type="Vector2i" /> <argument index="0" name="position" type="Vector2i" /> + <argument index="1" name="allow_out_of_bounds" type="bool" default="true" /> <description> - Returns the line and column at the given position. In the returned vector, [code]x[/code] is the column, [code]y[/code] is the line. + Returns the line and column at the given position. In the returned vector, [code]x[/code] is the column, [code]y[/code] is the line. If [code]allow_out_of_bounds[/code] is [code]false[/code] and the position is not over the text, both vector values will be set to [code]-1[/code]. </description> </method> <method name="get_line_count" qualifiers="const"> @@ -361,6 +362,24 @@ Returns OpenType feature [code]tag[/code]. </description> </method> + <method name="get_pos_at_line_column" qualifiers="const"> + <return type="Vector2i" /> + <argument index="0" name="line" type="int" /> + <argument index="1" name="column" type="int" /> + <description> + Returns the local position for the given [code]line[/code] and [code]column[/code]. If [code]x[/code] or [code]y[/code] of the returned vector equal [code]-1[/code], the position is outside of the viewable area of the control. + [b]Note:[/b] The Y position corresponds to the bottom side of the line. Use [method get_rect_at_line_column] to get the top side position. + </description> + </method> + <method name="get_rect_at_line_column" qualifiers="const"> + <return type="Rect2i" /> + <argument index="0" name="line" type="int" /> + <argument index="1" name="column" type="int" /> + <description> + Returns the local position and size for the grapheme at the given [code]line[/code] and [code]column[/code]. If [code]x[/code] or [code]y[/code] position of the returned rect equal [code]-1[/code], the position is outside of the viewable area of the control. + [b]Note:[/b] The Y position of the returned rect corresponds to the top side of the line, unlike [method get_pos_at_line_column] which returns the bottom side. + </description> + </method> <method name="get_saved_version" qualifiers="const"> <return type="int" /> <description> @@ -453,6 +472,14 @@ Returns the number of visible lines, including wrapped text. </description> </method> + <method name="get_visible_line_count_in_range" qualifiers="const"> + <return type="int" /> + <argument index="0" name="from_line" type="int" /> + <argument index="1" name="to_line" type="int" /> + <description> + Returns the total number of visible + wrapped lines between the two lines. + </description> + </method> <method name="get_word_at_pos" qualifiers="const"> <return type="String" /> <argument index="0" name="position" type="Vector2" /> @@ -559,6 +586,13 @@ Returns whether the menu is visible. Use this instead of [code]get_menu().visible[/code] to improve performance (so the creation of the menu is avoided). </description> </method> + <method name="is_mouse_over_selection" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="edges" type="bool" /> + <description> + Returns whether the mouse is over selection. If [code]edges[/code] is [code]true[/code], the edges are considered part of the selection. + </description> + </method> <method name="is_overtype_mode_enabled" qualifiers="const"> <return type="bool" /> <description> @@ -695,8 +729,7 @@ <method name="set_gutter_custom_draw"> <return type="void" /> <argument index="0" name="column" type="int" /> - <argument index="1" name="object" type="Object" /> - <argument index="2" name="callback" type="StringName" /> + <argument index="1" name="draw_callback" type="Callable" /> <description> Set a custom draw method for the gutter. The callback method must take the following args: [code]line: int, gutter: int, Area: Rect2[/code]. </description> @@ -873,11 +906,9 @@ </method> <method name="set_tooltip_request_func"> <return type="void" /> - <argument index="0" name="object" type="Object" /> - <argument index="1" name="callback" type="StringName" /> - <argument index="2" name="data" type="Variant" /> + <argument index="0" name="callback" type="Callable" /> <description> - Provide custom tooltip text. The callback method must take the following args: [code]hovered_word: String, data: Variant[/code] + Provide custom tooltip text. The callback method must take the following args: [code]hovered_word: String[/code] </description> </method> <method name="swap_lines"> @@ -908,7 +939,7 @@ <member name="caret_blink_speed" type="float" setter="set_caret_blink_speed" getter="get_caret_blink_speed" default="0.65"> Duration (in seconds) of a caret's blinking cycle. </member> - <member name="caret_mid_grapheme" type="bool" setter="set_caret_mid_grapheme_enabled" getter="is_caret_mid_grapheme_enabled" default="false"> + <member name="caret_mid_grapheme" type="bool" setter="set_caret_mid_grapheme_enabled" getter="is_caret_mid_grapheme_enabled" default="true"> Allow moving caret, selecting and removing the individual composite character components. [b]Note:[/b] [kbd]Backspace[/kbd] is always removing individual composite character components. </member> @@ -937,7 +968,7 @@ <member name="editable" type="bool" setter="set_editable" getter="is_editable" default="true"> If [code]false[/code], existing text cannot be modified and new text cannot be added. </member> - <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="2" /> + <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="2" /> <member name="highlight_all_occurrences" type="bool" setter="set_highlight_all_occurrences" getter="is_highlight_all_occurrences_enabled" default="false"> If [code]true[/code], all occurrences of the selected text will be highlighted. </member> @@ -957,10 +988,13 @@ <member name="minimap_width" type="int" setter="set_minimap_width" getter="get_minimap_width" default="80"> The width, in pixels, of the minimap. </member> - <member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" override="true" enum="Control.CursorShape" default="1" /> + <member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" overrides="Control" enum="Control.CursorShape" default="1" /> <member name="override_selected_font_color" type="bool" setter="set_override_selected_font_color" getter="is_overriding_selected_font_color" default="false"> If [code]true[/code], custom [code]font_selected_color[/code] will be used for selected text. </member> + <member name="placeholder_text" type="String" setter="set_placeholder" getter="get_placeholder" default=""""> + Text shown when the [TextEdit] is empty. It is [b]not[/b] the [TextEdit]'s default value (see [member text]). + </member> <member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0"> If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels. </member> @@ -1188,53 +1222,53 @@ <theme_item name="caret_background_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> [Color] of the text behind the caret when using a block caret. </theme_item> - <theme_item name="caret_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> - [Color] of the caret. + <theme_item name="caret_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)"> + [Color] of the caret. This can be set to a fully transparent color to hide the caret entirely. </theme_item> <theme_item name="current_line_color" data_type="color" type="Color" default="Color(0.25, 0.25, 0.26, 0.8)"> Background [Color] of the line containing the caret. </theme_item> - <theme_item name="focus" data_type="style" type="StyleBox"> - Sets the [StyleBox] when in focus. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - Sets the default [Font]. - </theme_item> - <theme_item name="font_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> + <theme_item name="font_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)"> Sets the font [Color]. </theme_item> <theme_item name="font_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the [TextEdit]. </theme_item> - <theme_item name="font_readonly_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 0.5)"> + <theme_item name="font_placeholder_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.6)"> + Font color for [member placeholder_text]. + </theme_item> + <theme_item name="font_readonly_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.5)"> Sets the font [Color] when [member editable] is disabled. </theme_item> - <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> + <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Sets the [Color] of the selected text. [member override_selected_font_color] has to be enabled. </theme_item> - <theme_item name="font_size" data_type="font_size" type="int"> - Sets default font size. + <theme_item name="search_result_border_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 0.4)"> + [Color] of the border around text that matches the search query. + </theme_item> + <theme_item name="search_result_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 1)"> + [Color] behind the text that matches the search query. + </theme_item> + <theme_item name="selection_color" data_type="color" type="Color" default="Color(0.5, 0.5, 0.5, 1)"> + Sets the highlight [Color] of text selections. + </theme_item> + <theme_item name="word_highlighted_color" data_type="color" type="Color" default="Color(0.5, 0.5, 0.5, 0.25)"> + Sets the highlight [Color] of multiple occurrences. [member highlight_all_occurrences] has to be enabled. + </theme_item> + <theme_item name="caret_width" data_type="constant" type="int" default="1"> + 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. If set to [code]0[/code] or lower, the caret width is automatically set to 1 pixel and multiplied by the display scaling factor. </theme_item> <theme_item name="line_spacing" data_type="constant" type="int" default="4"> Sets the spacing between the lines. </theme_item> - <theme_item name="normal" data_type="style" type="StyleBox"> - Sets the [StyleBox] of this [TextEdit]. - </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. </theme_item> - <theme_item name="read_only" data_type="style" type="StyleBox"> - Sets the [StyleBox] of this [TextEdit] when [member editable] is disabled. - </theme_item> - <theme_item name="search_result_border_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 0.4)"> - [Color] of the border around text that matches the search query. - </theme_item> - <theme_item name="search_result_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 1)"> - [Color] behind the text that matches the search query. + <theme_item name="font" data_type="font" type="Font"> + Sets the default [Font]. </theme_item> - <theme_item name="selection_color" data_type="color" type="Color" default="Color(0.49, 0.49, 0.49, 1)"> - Sets the highlight [Color] of text selections. + <theme_item name="font_size" data_type="font_size" type="int"> + Sets default font size. </theme_item> <theme_item name="space" data_type="icon" type="Texture2D"> Sets a custom [Texture2D] for space text characters. @@ -1242,8 +1276,14 @@ <theme_item name="tab" data_type="icon" type="Texture2D"> Sets a custom [Texture2D] for tab text characters. </theme_item> - <theme_item name="word_highlighted_color" data_type="color" type="Color" default="Color(0.8, 0.9, 0.9, 0.15)"> - Sets the highlight [Color] of multiple occurrences. [member highlight_all_occurrences] has to be enabled. + <theme_item name="focus" data_type="style" type="StyleBox"> + Sets the [StyleBox] when in focus. The [code]focus[/code] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. + </theme_item> + <theme_item name="normal" data_type="style" type="StyleBox"> + Sets the [StyleBox] of this [TextEdit]. + </theme_item> + <theme_item name="read_only" data_type="style" type="StyleBox"> + Sets the [StyleBox] of this [TextEdit] when [member editable] is disabled. </theme_item> </theme_items> </class> |