Class TabContainer

Namespace
Forma
Assembly
Forma.dll

Displays one child page at a time and provides tabs for switching the selected page.

public sealed class TabContainer : TemplatedControl, IAddChild<Control>, IAddChild, INotifyPropertyChanged, IDisposable
Inheritance
TabContainer
Implements
Inherited Members

Constructors

TabContainer()

public TabContainer()

Properties

AccessibilityRole

public override AccessibilityRole AccessibilityRole { get; }

Property Value

AccessibilityRole

CurrentTab

public int CurrentTab { get; set; }

Property Value

int

DeselectEnabled

Allows CurrentTab to become -1, matching Godot's deselect_enabled property.

public bool DeselectEnabled { get; set; }

Property Value

bool

DragToRearrangeEnabled

Enables pointer drag reordering of tab pages, like Godot's TabContainer.

public bool DragToRearrangeEnabled { get; set; }

Property Value

bool

Font

public SpriteFont Font { get; set; }

Property Value

SpriteFont

TabHeight

public float TabHeight { get; set; }

Property Value

float

TabsRearrangeGroup

Optional group identifier reserved for compatibility with Godot tab-container rearrangement groups.

public int TabsRearrangeGroup { get; set; }

Property Value

int

UIFont

public UIFont UIFont { get; set; }

Property Value

UIFont

Methods

ArrangeChildren()

protected override void ArrangeChildren()

GetCurrentTabControl()

Returns the currently selected page Control, or null when deselected, matching Godot's get_current_tab_control.

public Control GetCurrentTabControl()

Returns

Control

GetDeselectEnabled()

public bool GetDeselectEnabled()

Returns

bool

GetMinimumSize()

Matches Godot's TabContainer::_get_minimum_size: the tab-bar height plus (by default) only the CURRENT page's minimum size, not the max over every page - Godot only folds in every page when use_hidden_tabs_for_min_size is enabled, which this port doesn't model. The popup button, when attached, adds its width like Godot's popup_button branch.

public override Vector2 GetMinimumSize()

Returns

Vector2

GetPopup()

Returns the popup attached with SetPopup(Popup), matching Godot's TabContainer::get_popup.

public Popup GetPopup()

Returns

Popup

GetPopupButtonRectangle()

Returns the header rectangle of the popup button, empty when no popup is attached.

public Rectangle GetPopupButtonRectangle()

Returns

Rectangle

GetPreviousTab()

The tab selected immediately before the current one, matching Godot's get_previous_tab.

public int GetPreviousTab()

Returns

int

GetTabButtonIcon(int)

public Texture2D GetTabButtonIcon(int tab)

Parameters

tab int

Returns

Texture2D

GetTabControl(int)

Returns the page Control at the given tab index, matching Godot's get_tab_control.

public Control GetTabControl(int tab)

Parameters

tab int

Returns

Control

GetTabIcon(int)

public Texture2D GetTabIcon(int tab)

Parameters

tab int

Returns

Texture2D

GetTabIconMaxWidth(int)

public int GetTabIconMaxWidth(int tab)

Parameters

tab int

Returns

int

GetTabMetadata(int)

public object GetTabMetadata(int tab)

Parameters

tab int

Returns

object

GetTabTitle(int)

public string GetTabTitle(int tab)

Parameters

tab int

Returns

string

GetTabTooltip(int)

public string GetTabTooltip(int tab)

Parameters

tab int

Returns

string

GetTooltip(Point)

Returns the tooltip at a global pointer position. Override to provide dynamic help text.

public override string GetTooltip(Point position)

Parameters

position Point

Returns

string

IsTabDisabled(int)

public bool IsTabDisabled(int tab)

Parameters

tab int

Returns

bool

IsTabHidden(int)

public bool IsTabHidden(int tab)

Parameters

tab int

Returns

bool

MoveTab(int, int)

Moves a tab page while preserving the selected page.

public void MoveTab(int from, int to)

Parameters

from int
to int

NextTab()

public void NextTab()

PreviousTab()

public void PreviousTab()

SelectNextAvailable()

Selects the nearest available tab after the current one, wrapping around; returns whether one was found, matching Godot's select_next_available.

public bool SelectNextAvailable()

Returns

bool

SelectPreviousAvailable()

Selects the nearest available tab before the current one, wrapping around; returns whether one was found, matching Godot's select_previous_available.

public bool SelectPreviousAvailable()

Returns

bool

SetDeselectEnabled(bool)

public void SetDeselectEnabled(bool enabled)

Parameters

enabled bool

SetPopup(Popup)

Attaches an arbitrary popup opened from a header button, matching Godot's TabContainer::set_popup.

public void SetPopup(Popup popup)

Parameters

popup Popup

SetTabButtonIcon(int, Texture2D)

public void SetTabButtonIcon(int tab, Texture2D icon)

Parameters

tab int
icon Texture2D

SetTabDisabled(int, bool)

public void SetTabDisabled(int tab, bool disabled)

Parameters

tab int
disabled bool

SetTabHidden(int, bool)

public void SetTabHidden(int tab, bool hidden)

Parameters

tab int
hidden bool

SetTabIcon(int, Texture2D)

public void SetTabIcon(int tab, Texture2D icon)

Parameters

tab int
icon Texture2D

SetTabIconMaxWidth(int, int)

public void SetTabIconMaxWidth(int tab, int width)

Parameters

tab int
width int

SetTabMetadata(int, object)

public void SetTabMetadata(int tab, object metadata)

Parameters

tab int
metadata object

SetTabTitle(int, string)

public void SetTabTitle(int tab, string title)

Parameters

tab int
title string

SetTabTooltip(int, string)

public void SetTabTooltip(int tab, string tooltip)

Parameters

tab int
tooltip string

Events

ActiveTabRearranged

Raised while the selected tab page is moved through the header strip.

public event Action<TabContainer, int> ActiveTabRearranged

Event Type

Action<TabContainer, int>

PrePopupPressed

Raised immediately before the attached popup is shown, matching Godot's pre_popup_pressed signal.

public event EventHandler PrePopupPressed

Event Type

EventHandler

TabButtonPressed

Raised when a tab's configured button icon is pressed.

public event Action<TabContainer, int> TabButtonPressed

Event Type

Action<TabContainer, int>

TabChanged

public event Action<TabContainer, int> TabChanged

Event Type

Action<TabContainer, int>

TabClicked

Raised when a (non-disabled) tab is clicked, matching Godot's tab_clicked signal.

public event Action<TabContainer, int> TabClicked

Event Type

Action<TabContainer, int>

TabHovered

Raised when the pointer enters a tab header, matching Godot's tab_hovered signal.

public event Action<TabContainer, int> TabHovered

Event Type

Action<TabContainer, int>

TabSelected

Raised on every tab selection attempt, even reselecting the current tab, matching Godot's tab_selected signal (TabChanged only fires when the selection actually changes).

public event Action<TabContainer, int> TabSelected

Event Type

Action<TabContainer, int>