-
Notifications
You must be signed in to change notification settings - Fork 0
TabContainer
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.TabContainer |
| Namespace | Electron2D |
| Kind | class |
| Category | UI and Text |
Displays direct child controls as selectable tab pages.
public class Electron2D.TabContainer : Electron2D.ContainerProfile: Electron2D 0.1.0 2D
Status: Supported / Parity verified
Out of profile: no
Godot reference: TabContainer
Runtime tab container that treats direct child controls as tab pages, stores titles/icons/disabled/hidden state, switches by pointer input and emits tab_changed.
TabContainer is a runtime UI container. Each direct child
Electron2D.Control becomes a tab page; non-control children remain in the
node tree but are ignored by tab layout and tab metadata queries.
The 0.1.0 Preview implementation stores tab titles, icons, disabled state and hidden state, routes pointer presses on the tab header and fits the selected page into the remaining rectangle.
This type is not synchronized. Create and mutate tab containers on the main scene thread.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.ContainerElectron2D.Control
| Member | Kind | Summary |
|---|---|---|
AllTabsInFront |
Property | Gets or sets whether all tab buttons should be drawn in front. |
CurrentTab |
Property | Gets or sets the current selected tab index. |
DeselectEnabled |
Property | Gets or sets whether the container may have no selected tab. |
TabAlignment |
Property | Gets or sets tab button alignment inside the header. |
TabsPosition |
Property | Gets or sets the tab header position. |
TabsVisible |
Property | Gets or sets whether the tab header is visible. |
UseHiddenTabsForMinSize |
Property | Gets or sets whether hidden tabs contribute to minimum size. |
Electron2D.TabContainer() |
Constructor | Initializes a new instance of the Electron2D.TabContainer class. |
GetCurrentTabControl() |
Method | Gets the control displayed by the current tab. |
GetPreviousTab() |
Method | Gets the tab index that was selected before the current tab. |
GetTabControl(System.Int32) |
Method | Gets the control displayed by a tab. |
GetTabCount() |
Method | Gets the number of direct child controls treated as tabs. |
GetTabIcon(System.Int32) |
Method | Gets the icon displayed by a tab button. |
GetTabIdxAtPoint(Electron2D.Vector2) |
Method | Gets the tab index whose button contains a local point. |
GetTabIdxFromControl(Electron2D.Control) |
Method | Gets the tab index for a direct child control. |
GetTabTitle(System.Int32) |
Method | Gets the title displayed by a tab button. |
IsTabDisabled(System.Int32) |
Method | Reports whether a tab is disabled. |
IsTabHidden(System.Int32) |
Method | Reports whether a tab is hidden. |
SelectNextAvailable() |
Method | Selects the next available tab. |
SelectPreviousAvailable() |
Method | Selects the previous available tab. |
SetTabDisabled(System.Int32, System.Boolean) |
Method | Sets whether a tab is disabled. |
SetTabHidden(System.Int32, System.Boolean) |
Method | Sets whether a tab is hidden. |
SetTabIcon(System.Int32, Electron2D.Texture2D) |
Method | Sets the icon displayed by a tab button. |
SetTabTitle(System.Int32, System.String) |
Method | Sets the title displayed by a tab button. |
_Draw() |
Method | Draws the tab header and tab button labels. |
_GetMinimumSize() |
Method | Gets the minimum size requested by this tab container. |
_GuiInput(Electron2D.InputEvent) |
Method | Handles GUI input routed to this tab container. |
Kind: Property
public System.Boolean AllTabsInFront { get; set; }Gets or sets whether all tab buttons should be drawn in front.
The preview stores this styling policy. Page visibility still follows
Electron2D.TabContainer.CurrentTab.
true to request all tabs in front; otherwise, false.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer._Draw
Kind: Property
public System.Int32 CurrentTab { get; set; }Gets or sets the current selected tab index.
Setting this property updates page visibility and emits
tab_changed when the selected tab changes.
Disabled and hidden tabs are not selected. Assigning -1 is
accepted only when Electron2D.TabContainer.DeselectEnabled is true.
The current tab index, or -1 when no tab is selected.
-
System.ArgumentOutOfRangeException: Thrown when the assigned index is outside the tab range.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.GetCurrentTabControlElectron2D.TabContainer.GetPreviousTab
Kind: Property
public System.Boolean DeselectEnabled { get; set; }Gets or sets whether the container may have no selected tab.
When this value is false, the container selects the first
available tab whenever possible.
true to allow Electron2D.TabContainer.CurrentTab to be -1;
otherwise, false.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.CurrentTab
Kind: Property
public Electron2D.TabContainer.AlignmentModeEnum TabAlignment { get; set; }Gets or sets tab button alignment inside the header.
Changing alignment queues a redraw because tab button hit rectangles and drawing positions use the same calculation.
The current Electron2D.TabContainer.AlignmentModeEnum. The default is
Electron2D.TabContainer.AlignmentModeEnum.Left.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.GetTabIdxAtPoint(Electron2D.Vector2)
Kind: Property
public Electron2D.TabContainer.TabPositionEnum TabsPosition { get; set; }Gets or sets the tab header position.
Changing this value queues a layout pass and redraw.
The current Electron2D.TabContainer.TabPositionEnum. The default is
Electron2D.TabContainer.TabPositionEnum.Top.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.TabsVisible
Kind: Property
public System.Boolean TabsVisible { get; set; }Gets or sets whether the tab header is visible.
Hiding the header does not change the selected page.
true to draw and hit-test the tab header; otherwise,
false.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.TabsPosition
Kind: Property
public System.Boolean UseHiddenTabsForMinSize { get; set; }Gets or sets whether hidden tabs contribute to minimum size.
This setting affects Electron2D.TabContainer._GetMinimumSize only. Hidden tabs
remain unavailable for selection.
true to measure hidden tab pages; otherwise, false.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.SetTabHidden(System.Int32,System.Boolean)
Kind: Constructor
public Electron2D.TabContainer()Initializes a new instance of the Electron2D.TabContainer class.
The constructor registers the tab_changed signal and enables
clipping so tab pages cannot draw outside the container rectangle.
This constructor is not synchronized. Call it from the main scene thread.
This constructor is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer
Kind: Method
public Electron2D.Control GetCurrentTabControl()()Gets the control displayed by the current tab.
This method normalizes Electron2D.TabContainer.CurrentTab before returning the
control.
The selected tab control, or null when no tab is selected.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.CurrentTab
Kind: Method
public System.Int32 GetPreviousTab()()Gets the tab index that was selected before the current tab.
The value is updated only when the selected tab changes.
The previous tab index, or -1 when there was no previous tab.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.CurrentTab
Kind: Method
public Electron2D.Control GetTabControl(System.Int32)(System.Int32 tabIndex)Gets the control displayed by a tab.
The returned control remains owned by the node tree. Removing or moving it changes subsequent tab indices.
-
tabIndex: The zero-based tab index.
The direct child Electron2D.Control for the tab.
-
System.ArgumentOutOfRangeException: Thrown whentabIndexis outside the tab range.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.GetCurrentTabControl
Kind: Method
public System.Int32 GetTabCount()()Gets the number of direct child controls treated as tabs.
Non-control children are ignored by this count.
The current tab count.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.GetTabControl(System.Int32)
Kind: Method
public Electron2D.Texture2D GetTabIcon(System.Int32)(System.Int32 tabIndex)Gets the icon displayed by a tab button.
The returned texture is the same resource assigned by
Electron2D.TabContainer.SetTabIcon(System.Int32,Electron2D.Texture2D).
-
tabIndex: The zero-based tab index.
The icon texture, or null when no icon is assigned.
-
System.ArgumentOutOfRangeException: Thrown whentabIndexis outside the tab range.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.SetTabIcon(System.Int32,Electron2D.Texture2D)
Kind: Method
public System.Int32 GetTabIdxAtPoint(Electron2D.Vector2)(Electron2D.Vector2 point)Gets the tab index whose button contains a local point.
This method uses the same tab rectangles as pointer input. Hidden and disabled tabs are skipped.
-
point: The local point inside this container.
The tab index at the point, or -1 when the point is not over an
enabled visible tab button.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer._GuiInput(Electron2D.InputEvent)
Kind: Method
public System.Int32 GetTabIdxFromControl(Electron2D.Control)(Electron2D.Control control)Gets the tab index for a direct child control.
The method uses reference identity and does not search descendants.
-
control: The direct child control to query.
The tab index, or -1 when control is not a tab.
-
System.ArgumentNullException: Thrown whencontrolisnull.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.GetTabControl(System.Int32)
Kind: Method
public System.String GetTabTitle(System.Int32)(System.Int32 tabIndex)Gets the title displayed by a tab button.
The returned value is never null.
-
tabIndex: The zero-based tab index.
The assigned tab title, or the child control name when no title was assigned.
-
System.ArgumentOutOfRangeException: Thrown whentabIndexis outside the tab range.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.SetTabTitle(System.Int32,System.String)
Kind: Method
public System.Boolean IsTabDisabled(System.Int32)(System.Int32 tabIndex)Reports whether a tab is disabled.
Disabled tabs are still counted by Electron2D.TabContainer.GetTabCount.
-
tabIndex: The zero-based tab index.
true when the tab is disabled; otherwise, false.
-
System.ArgumentOutOfRangeException: Thrown whentabIndexis outside the tab range.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.SetTabDisabled(System.Int32,System.Boolean)
Kind: Method
public System.Boolean IsTabHidden(System.Int32)(System.Int32 tabIndex)Reports whether a tab is hidden.
Hidden tabs remain part of the child list and keep their metadata.
-
tabIndex: The zero-based tab index.
true when the tab is hidden; otherwise, false.
-
System.ArgumentOutOfRangeException: Thrown whentabIndexis outside the tab range.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.SetTabHidden(System.Int32,System.Boolean)
Kind: Method
public System.Boolean SelectNextAvailable()()Selects the next available tab.
Hidden and disabled tabs are skipped. This method does not wrap around to the beginning of the list.
true when a later available tab was selected; otherwise,
false.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.SelectPreviousAvailable
Kind: Method
public System.Boolean SelectPreviousAvailable()()Selects the previous available tab.
Hidden and disabled tabs are skipped. This method does not wrap around to the end of the list.
true when an earlier available tab was selected; otherwise,
false.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.SelectNextAvailable
Kind: Method
public System.Void SetTabDisabled(System.Int32, System.Boolean)(System.Int32 tabIndex, System.Boolean disabled)Sets whether a tab is disabled.
Disabled tabs remain visible but cannot be selected through pointer input or next/previous selection helpers.
-
tabIndex: The zero-based tab index. -
disabled:trueto disable the tab; otherwise,false.
-
System.ArgumentOutOfRangeException: Thrown whentabIndexis outside the tab range.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.IsTabDisabled(System.Int32)
Kind: Method
public System.Void SetTabHidden(System.Int32, System.Boolean)(System.Int32 tabIndex, System.Boolean hidden)Sets whether a tab is hidden.
Hidden tabs are not drawn in the header and cannot be selected. Their pages are also hidden unless selected again after being shown.
-
tabIndex: The zero-based tab index. -
hidden:trueto hide the tab; otherwise,false.
-
System.ArgumentOutOfRangeException: Thrown whentabIndexis outside the tab range.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.IsTabHidden(System.Int32)
Kind: Method
public System.Void SetTabIcon(System.Int32, Electron2D.Texture2D)(System.Int32 tabIndex, Electron2D.Texture2D icon)Sets the icon displayed by a tab button.
Icons are metadata for tab drawing and generated documentation. The preview renderer may omit icon drawing when no texture backend consumes the canvas command.
-
tabIndex: The zero-based tab index. -
icon: The icon texture, ornullto clear it.
-
System.ArgumentOutOfRangeException: Thrown whentabIndexis outside the tab range.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.GetTabIcon(System.Int32)
Kind: Method
public System.Void SetTabTitle(System.Int32, System.String)(System.Int32 tabIndex, System.String title)Sets the title displayed by a tab button.
Empty titles are valid. When no title is assigned, the child control
name is used as a fallback by Electron2D.TabContainer.GetTabTitle(System.Int32).
-
tabIndex: The zero-based tab index. -
title: The title to display.
-
System.ArgumentNullException: Thrown whentitleisnull. -
System.ArgumentOutOfRangeException: Thrown whentabIndexis outside the tab range.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TabContainer.GetTabTitle(System.Int32)
Kind: Method
public System.Void _Draw()()Draws the tab header and tab button labels.
Text drawing is skipped when no theme font is available. Page controls are drawn by their own canvas item callbacks.
This callback is invoked on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.CanvasItem.DrawRect(Electron2D.Rect2,Electron2D.Color,System.Boolean,System.Single,System.Boolean)
Kind: Method
public Electron2D.Vector2 _GetMinimumSize()()Gets the minimum size requested by this tab container.
Hidden tabs contribute to the size only when
Electron2D.TabContainer.UseHiddenTabsForMinSize is true.
A size that can contain the largest measured tab page and the tab header.
This callback is invoked on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetMinimumSize
Kind: Method
public System.Void _GuiInput(Electron2D.InputEvent)(Electron2D.InputEvent inputEvent)Handles GUI input routed to this tab container.
Mouse and touch press over a tab header button select that tab. Disabled and hidden tabs are ignored.
-
inputEvent: The input event delivered by the viewport.
This callback is invoked on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control._GuiInput(Electron2D.InputEvent)
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.