updated the TabContainer docs for depth and readability.

This commit is contained in:
Will Nations 2017-10-20 23:31:45 -05:00
parent 8bc96cc146
commit 5b10422fba

View file

@ -4,8 +4,10 @@
Tabbed Container. Tabbed Container.
</brief_description> </brief_description>
<description> <description>
Tabbed Container. Contains several children controls, but shows only one at the same time. Clicking on the top tabs allows to change the currently visible one. Sets the active tab's [code]visible[/code] property to the value [code]true[/code]. Sets all other children's to [code]false[/code].
Children controls of this one automatically. Ignores non-[class Control] children.
Individual tabs are always visible unless you use [method set_tab_disabled] and [method set_tab_title] to hide it.
To hide only a tab's content, nest the content inside a child [class Control], so it receives the [class TabContainer]'s visibility setting instead.
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>
@ -23,33 +25,35 @@
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns the current tab index that is being shown. Returns the currently visible tab's index.
</description> </description>
</method> </method>
<method name="get_current_tab_control" qualifiers="const"> <method name="get_current_tab_control" qualifiers="const">
<return type="Control"> <return type="Control">
</return> </return>
<description> <description>
Returns the child [class Control] node located at the active tab index.
</description> </description>
</method> </method>
<method name="get_popup" qualifiers="const"> <method name="get_popup" qualifiers="const">
<return type="Popup"> <return type="Popup">
</return> </return>
<description> <description>
Returns the [class Popup] node instance if one has been set already with [method set_popup].
</description> </description>
</method> </method>
<method name="get_previous_tab" qualifiers="const"> <method name="get_previous_tab" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns the previous tab index that was being shown. Returns the previously active tab index.
</description> </description>
</method> </method>
<method name="get_tab_align" qualifiers="const"> <method name="get_tab_align" qualifiers="const">
<return type="int" enum="TabContainer.TabAlign"> <return type="int" enum="TabContainer.TabAlign">
</return> </return>
<description> <description>
Returns the tab alignment.See the ALIGN_* constants. Returns the tab alignment. See the [code]ALIGN_*[/code] constants.
</description> </description>
</method> </method>
<method name="get_tab_control" qualifiers="const"> <method name="get_tab_control" qualifiers="const">
@ -58,14 +62,14 @@
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Returns the current tab control that is being shown. Returns the currently visible tab's [class Control] node.
</description> </description>
</method> </method>
<method name="get_tab_count" qualifiers="const"> <method name="get_tab_count" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns the amount of tabs. Returns the number of tabs.
</description> </description>
</method> </method>
<method name="get_tab_disabled" qualifiers="const"> <method name="get_tab_disabled" qualifiers="const">
@ -92,7 +96,7 @@
<argument index="0" name="tab_idx" type="int"> <argument index="0" name="tab_idx" type="int">
</argument> </argument>
<description> <description>
Returns the title for the tab at index [code]tab_idx[/code]. Tab titles are by default the children node name, but this can be overridden. Returns the title of the tab at index [code]tab_idx[/code]. Tab titles default to the name of the indexed child node, but this can be overridden with [method set_tab_title].
</description> </description>
</method> </method>
<method name="set_current_tab"> <method name="set_current_tab">
@ -101,7 +105,7 @@
<argument index="0" name="tab_idx" type="int"> <argument index="0" name="tab_idx" type="int">
</argument> </argument>
<description> <description>
Bring a tab (and the Control it represents) to the front, and hide the rest. Sets to [code]false[/code] the [code]visible[/code] property for all [class Control] children except for the tab at [code]tab_idx[/code].
</description> </description>
</method> </method>
<method name="set_popup"> <method name="set_popup">
@ -110,6 +114,7 @@
<argument index="0" name="popup" type="Node"> <argument index="0" name="popup" type="Node">
</argument> </argument>
<description> <description>
If set on a [class Popup] node instance, a popup menu icon appears in the top-right corner of the [class TabContainer]. Clicking it will expand the [class Popup] node.
</description> </description>
</method> </method>
<method name="set_tab_align"> <method name="set_tab_align">
@ -118,7 +123,7 @@
<argument index="0" name="align" type="int" enum="TabContainer.TabAlign"> <argument index="0" name="align" type="int" enum="TabContainer.TabAlign">
</argument> </argument>
<description> <description>
Set tab alignment, from the ALIGN_* enum. Moves tabs to the left, right or center. Sets tab alignment, from the [code]ALIGN_*[/code] constants. Moves tabs to the left, right, or center.
</description> </description>
</method> </method>
<method name="set_tab_disabled"> <method name="set_tab_disabled">
@ -129,7 +134,7 @@
<argument index="1" name="disabled" type="bool"> <argument index="1" name="disabled" type="bool">
</argument> </argument>
<description> <description>
Set tab at index [code]tab_idx[/code] disabled. If [code]disabled[/code] is false, hides the tab at index [code]tab_idx[/code]. Note that its title text will remain, unless also removed with [method set_tab_title].
</description> </description>
</method> </method>
<method name="set_tab_icon"> <method name="set_tab_icon">
@ -140,7 +145,7 @@
<argument index="1" name="icon" type="Texture"> <argument index="1" name="icon" type="Texture">
</argument> </argument>
<description> <description>
Set an icon for a tab at index [code]tab_idx[/code]. Sets an icon for the tab at index [code]tab_idx[/code].
</description> </description>
</method> </method>
<method name="set_tab_title"> <method name="set_tab_title">
@ -151,7 +156,7 @@
<argument index="1" name="title" type="String"> <argument index="1" name="title" type="String">
</argument> </argument>
<description> <description>
Set a title for the tab at index [code]tab_idx[/code]. Tab titles are by default the children node name, but this can be overridden. Sets a title for the tab at index [code]tab_idx[/code]. Tab titles default to the name of the indexed child node, but this can be overridden with [method set_tab_title].
</description> </description>
</method> </method>
<method name="set_tabs_visible"> <method name="set_tabs_visible">
@ -160,38 +165,39 @@
<argument index="0" name="visible" type="bool"> <argument index="0" name="visible" type="bool">
</argument> </argument>
<description> <description>
If [code]true[/code] all the tabs will be visible. If [code]true[/code] tabs are visible. If [code]false[/code] tabs' content and titles are hidden. Default value: [code]true[/code].
</description> </description>
</method> </method>
</methods> </methods>
<members> <members>
<member name="current_tab" type="int" setter="set_current_tab" getter="get_current_tab"> <member name="current_tab" type="int" setter="set_current_tab" getter="get_current_tab">
The current tab. The current tab index. When set, this index's [class Control] node's [code]visible[/code] property is set to [code]true[/code] and all others are set to [code]false[/code].
</member> </member>
<member name="tab_align" type="int" setter="set_tab_align" getter="get_tab_align" enum="TabContainer.TabAlign"> <member name="tab_align" type="int" setter="set_tab_align" getter="get_tab_align" enum="TabContainer.TabAlign">
The alignment of all the tabs of the tab container. See the [code]ALIGN_*[/code] constants. The alignment of all tabs in the tab container. See the [code]ALIGN_*[/code] constants for details.
</member> </member>
<member name="tabs_visible" type="bool" setter="set_tabs_visible" getter="are_tabs_visible"> <member name="tabs_visible" type="bool" setter="set_tabs_visible" getter="are_tabs_visible">
If [code]true[/code] all tabs that are children of the TabContainer will be visible. If [code]true[/code] tabs are visible. If [code]false[/code] tabs' content and titles are hidden. Default value: [code]true[/code].
</member> </member>
</members> </members>
<signals> <signals>
<signal name="pre_popup_pressed"> <signal name="pre_popup_pressed">
<description> <description>
Emitted when the [class TabContainer]'s [class Popup] button is clicked. See [method set_popup] for details.
</description> </description>
</signal> </signal>
<signal name="tab_changed"> <signal name="tab_changed">
<argument index="0" name="tab" type="int"> <argument index="0" name="tab" type="int">
</argument> </argument>
<description> <description>
Emitted only when the current tab changes. Emitted when switching to another tab.
</description> </description>
</signal> </signal>
<signal name="tab_selected"> <signal name="tab_selected">
<argument index="0" name="tab" type="int"> <argument index="0" name="tab" type="int">
</argument> </argument>
<description> <description>
Emitted when a tab is being selected, even if it is the same tab. Emitted when a tab is selected, even if it is the current tab.
</description> </description>
</signal> </signal>
</signals> </signals>