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
CurrentTab
public int CurrentTab { get; set; }
Property Value
DeselectEnabled
Allows CurrentTab to become -1, matching Godot's deselect_enabled property.
public bool DeselectEnabled { get; set; }
Property Value
DragToRearrangeEnabled
Enables pointer drag reordering of tab pages, like Godot's TabContainer.
public bool DragToRearrangeEnabled { get; set; }
Property Value
Font
public SpriteFont Font { get; set; }
Property Value
- SpriteFont
TabHeight
public float TabHeight { get; set; }
Property Value
TabsRearrangeGroup
Optional group identifier reserved for compatibility with Godot tab-container rearrangement groups.
public int TabsRearrangeGroup { get; set; }
Property Value
UIFont
public UIFont UIFont { get; set; }
Property Value
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
GetDeselectEnabled()
public bool GetDeselectEnabled()
Returns
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
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
GetTabButtonIcon(int)
public Texture2D GetTabButtonIcon(int tab)
Parameters
tabint
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
tabint
Returns
GetTabIcon(int)
public Texture2D GetTabIcon(int tab)
Parameters
tabint
Returns
- Texture2D
GetTabIconMaxWidth(int)
public int GetTabIconMaxWidth(int tab)
Parameters
tabint
Returns
GetTabMetadata(int)
public object GetTabMetadata(int tab)
Parameters
tabint
Returns
GetTabTitle(int)
public string GetTabTitle(int tab)
Parameters
tabint
Returns
GetTabTooltip(int)
public string GetTabTooltip(int tab)
Parameters
tabint
Returns
GetTooltip(Point)
Returns the tooltip at a global pointer position. Override to provide dynamic help text.
public override string GetTooltip(Point position)
Parameters
positionPoint
Returns
IsTabDisabled(int)
public bool IsTabDisabled(int tab)
Parameters
tabint
Returns
IsTabHidden(int)
public bool IsTabHidden(int tab)
Parameters
tabint
Returns
MoveTab(int, int)
Moves a tab page while preserving the selected page.
public void MoveTab(int from, int to)
Parameters
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
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
SetDeselectEnabled(bool)
public void SetDeselectEnabled(bool enabled)
Parameters
enabledbool
SetPopup(Popup)
Attaches an arbitrary popup opened from a header button, matching Godot's TabContainer::set_popup.
public void SetPopup(Popup popup)
Parameters
popupPopup
SetTabButtonIcon(int, Texture2D)
public void SetTabButtonIcon(int tab, Texture2D icon)
Parameters
tabinticonTexture2D
SetTabDisabled(int, bool)
public void SetTabDisabled(int tab, bool disabled)
Parameters
SetTabHidden(int, bool)
public void SetTabHidden(int tab, bool hidden)
Parameters
SetTabIcon(int, Texture2D)
public void SetTabIcon(int tab, Texture2D icon)
Parameters
tabinticonTexture2D
SetTabIconMaxWidth(int, int)
public void SetTabIconMaxWidth(int tab, int width)
Parameters
SetTabMetadata(int, object)
public void SetTabMetadata(int tab, object metadata)
Parameters
SetTabTitle(int, string)
public void SetTabTitle(int tab, string title)
Parameters
SetTabTooltip(int, string)
public void SetTabTooltip(int tab, string tooltip)
Parameters
Events
ActiveTabRearranged
Raised while the selected tab page is moved through the header strip.
public event Action<TabContainer, int> ActiveTabRearranged
Event Type
PrePopupPressed
Raised immediately before the attached popup is shown, matching Godot's pre_popup_pressed signal.
public event EventHandler PrePopupPressed
Event Type
TabButtonPressed
Raised when a tab's configured button icon is pressed.
public event Action<TabContainer, int> TabButtonPressed
Event Type
TabChanged
public event Action<TabContainer, int> TabChanged
Event Type
TabClicked
Raised when a (non-disabled) tab is clicked, matching Godot's tab_clicked signal.
public event Action<TabContainer, int> TabClicked
Event Type
TabHovered
Raised when the pointer enters a tab header, matching Godot's tab_hovered signal.
public event Action<TabContainer, int> TabHovered
Event Type
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