Class TabControl
Assembly: PopcorningGuineaPig.Engine.dll
Syntax
public class TabControl : InteractiveUIElement, IUIElement
Constructors
|
Edit this page
View Source
TabControl(Vector2, Vector2, int)
Declaration
public TabControl(Vector2 position, Vector2 size, int tabHeight = 40)
Parameters
Properties
|
Edit this page
View Source
ContentArea
Gets the content area rectangle for the tab control.
Declaration
public Rectangle ContentArea { get; }
Property Value
| Type |
Description |
| Rectangle |
|
Methods
|
Edit this page
View Source
AddContentToTab(int, IUIElement)
Adds content to a specific tab.
Declaration
public void AddContentToTab(int tabIndex, IUIElement element)
Parameters
|
Edit this page
View Source
AddTab(string, string?, string?)
Adds a new tab to the tab control.
Declaration
public void AddTab(string title, string? localizationKey = null, string? fallbackText = null)
Parameters
|
Edit this page
View Source
Draw()
Draws this element and all children
Declaration
public override void Draw()
Overrides
|
Edit this page
View Source
DrawSelf()
Override DrawSelf to handle label drawing
Derived classes should call base.DrawSelf() to ensure labels are drawn
Declaration
protected override void DrawSelf()
Overrides
|
Edit this page
View Source
GetActiveTab()
Gets the current active tab index.
Declaration
public int GetActiveTab()
Returns
|
Edit this page
View Source
GetElementFromActiveTab<T>(string)
Gets a child element from the active tab by ID.
Declaration
public T? GetElementFromActiveTab<T>(string id) where T : class, IUIElement
Parameters
| Type |
Name |
Description |
| string |
id |
|
Returns
Type Parameters
|
Edit this page
View Source
GetElementFromAnyTab<T>(string)
Gets a child element from any tab by ID.
Declaration
public T? GetElementFromAnyTab<T>(string id) where T : class, IUIElement
Parameters
| Type |
Name |
Description |
| string |
id |
|
Returns
Type Parameters
|
Edit this page
View Source
GetTabCount()
Declaration
Returns
|
Edit this page
View Source
SetActiveTab(int)
Declaration
public void SetActiveTab(int tabIndex)
Parameters
| Type |
Name |
Description |
| int |
tabIndex |
|
|
Edit this page
View Source
SetColors(Color, Color, Color, Color, Color, Color, Color)
Sets the tab control colors.
Declaration
public void SetColors(Color background, Color tab, Color activeTab, Color hoverTab, Color text, Color activeText, Color border)
Parameters
| Type |
Name |
Description |
| Color |
background |
|
| Color |
tab |
|
| Color |
activeTab |
|
| Color |
hoverTab |
|
| Color |
text |
|
| Color |
activeText |
|
| Color |
border |
|
|
Edit this page
View Source
SetFont(Font)
Sets the font for tab headers.
Declaration
public void SetFont(Font font)
Parameters
| Type |
Name |
Description |
| Font |
font |
|
|
Edit this page
View Source
SetLocalizationService(ILocalizationService?)
Sets the localization service for automatic text updates.
Declaration
public override void SetLocalizationService(ILocalizationService? localizationService)
Parameters
Overrides
|
Edit this page
View Source
UpdateSelf()
Override UpdateSelf to provide common interactive element functionality
Derived classes should call base.UpdateSelf() before their own update logic
Declaration
protected override void UpdateSelf()
Overrides
Implements