Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Gui.Layouts.TabLayout Class Reference

Arrange widgets to fill entire container while showing only one of them. More...

Inheritance diagram for Dragengine.Gui.Layouts.TabLayout:
Dragengine.Gui.Layout

Public Member Functions

void addWidget (Widget widget, Object settings)
 Add widget to layout using settings.
void doLayout (Container container)
 Layout widgets in container.
bool getCompact ()
 Compact mode.
Point getMinimumSizeForWidth (Container container, int width)
 Minimum size of layout using reference width and variable height.
int getTabIndex ()
 Index of the current tab.
TabLayout new ()
 Create layout.
TabLayout new (bool compact)
 Create layout.
void removeWidget (Widget widget)
 Remove widget from layout.
void selectFirstTab (Container container)
 Select first tab.
void selectLastTab (Container container)
 Select last tab.
void selectNextTab (Container container)
 Select next tab wrapping around on the end.
void selectPreviousTab (Container container)
 Select previous tab wrapping around on the beginning.
void selectTab (Container container, int index)
 Select tab by index.
void setCompact (bool compact)
 Set compact mode.
Public Member Functions inherited from Dragengine.Gui.Layout
Point getMinimumSize (Container container)
 Minimal size required for layout in container.
Point getMinimumSizeForHeight (Container container, int height)
 Minimum size of layout using reference widget height and variable width.

Detailed Description

Arrange widgets to fill entire container while showing only one of them.

Provides functions to switch between the child widgets easily.

Instances of this layout can not be shared by multiple widgets.

Version 1.17

By default the minimum size of the layout lines up with the largest minimum size of all widgets. This ensures the container does not change size when the selected child widget changes. Since version 1.17 this behavior can be changed to matche the minimum size of the selected widget instead. This allows to make compact SwitchPanel layouts.

Member Function Documentation

◆ addWidget()

void Dragengine.Gui.Layouts.TabLayout.addWidget ( Widget widget,
Object settings )

Add widget to layout using settings.

Implements Dragengine.Gui.Layout.

References selectPreviousTab().

Referenced by getMinimumSizeForWidth().

◆ doLayout()

void Dragengine.Gui.Layouts.TabLayout.doLayout ( Container container)

Layout widgets in container.

Implements Dragengine.Gui.Layout.

Referenced by getMinimumSizeForWidth(), and selectPreviousTab().

◆ getCompact()

bool Dragengine.Gui.Layouts.TabLayout.getCompact ( )

Compact mode.

Version
1.17

If compact mode is used the minimum size of the layout matches the minimum size of the selected child widget instead of the largest minimum size of all child widgets.

References new(), and selectNextTab().

Referenced by getMinimumSizeForWidth().

◆ getMinimumSizeForWidth()

Point Dragengine.Gui.Layouts.TabLayout.getMinimumSizeForWidth ( Container container,
int width )

◆ getTabIndex()

int Dragengine.Gui.Layouts.TabLayout.getTabIndex ( )

Index of the current tab.

References getTabIndex().

Referenced by getTabIndex().

◆ new() [1/2]

TabLayout Dragengine.Gui.Layouts.TabLayout.new ( )

Create layout.

References new().

Referenced by getCompact(), getMinimumSizeForWidth(), new(), new(), removeWidget(), and selectNextTab().

◆ new() [2/2]

TabLayout Dragengine.Gui.Layouts.TabLayout.new ( bool compact)

Create layout.

Version
1.17

References new().

◆ removeWidget()

void Dragengine.Gui.Layouts.TabLayout.removeWidget ( Widget widget)

Remove widget from layout.

Implements Dragengine.Gui.Layout.

References new(), and selectTab().

Referenced by getMinimumSizeForWidth().

◆ selectFirstTab()

void Dragengine.Gui.Layouts.TabLayout.selectFirstTab ( Container container)

Select first tab.

Exceptions
EOutOfBoundscontainer has no child widgets.

References selectFirstTab().

Referenced by selectFirstTab().

◆ selectLastTab()

void Dragengine.Gui.Layouts.TabLayout.selectLastTab ( Container container)

Select last tab.

Exceptions
EOutOfBoundscontainer has no child widgets.

References selectLastTab(), and selectTab().

Referenced by selectLastTab().

◆ selectNextTab()

void Dragengine.Gui.Layouts.TabLayout.selectNextTab ( Container container)

Select next tab wrapping around on the end.

Exceptions
EOutOfBoundscontainer has no child widgets.

References new(), and selectTab().

Referenced by getCompact().

◆ selectPreviousTab()

void Dragengine.Gui.Layouts.TabLayout.selectPreviousTab ( Container container)

Select previous tab wrapping around on the beginning.

Exceptions
EOutOfBoundscontainer has no child widgets.

References doLayout().

Referenced by addWidget().

◆ selectTab()

void Dragengine.Gui.Layouts.TabLayout.selectTab ( Container container,
int index )

Select tab by index.

Exceptions
EOutOfBoundscontainer has no child widgets.
EOutOfBoundsindex is less than 0
EOutOfBoundsindex is larger than or equal to Container.getWidgetCount().

References selectTab().

Referenced by removeWidget(), selectLastTab(), selectNextTab(), selectTab(), and setCompact().

◆ setCompact()

void Dragengine.Gui.Layouts.TabLayout.setCompact ( bool compact)

Set compact mode.

Version
1.17

If compact mode is used the minimum size of the layout matches the minimum size of the selected child widget instead of the largest minimum size of all child widgets.

Call Container.doLayout() after changing compact mode.

References selectTab().

Referenced by getMinimumSizeForWidth().


The documentation for this class was generated from the following file: