Drag[en]gine Script Module DragonScript  1.23
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. More...
 
void doLayout (Container container)
 Layout widgets in container. More...
 
bool getCompact ()
 Compact mode. More...
 
Point getMinimumSizeForWidth (Container container, int width)
 Minimum size of layout using reference width and variable height. More...
 
int getTabIndex ()
 Index of the current tab. More...
 
TabLayout new ()
 Create layout. More...
 
TabLayout new (bool compact)
 Create layout. More...
 
void removeWidget (Widget widget)
 Remove widget from layout. More...
 
void selectFirstTab (Container container)
 Select first tab. More...
 
void selectLastTab (Container container)
 Select last tab. More...
 
void selectNextTab (Container container)
 Select next tab wrapping around on the end. More...
 
void selectPreviousTab (Container container)
 Select previous tab wrapping around on the beginning. More...
 
void selectTab (Container container, int index)
 Select tab by index. More...
 
void setCompact (bool compact)
 Set compact mode. More...
 
- Public Member Functions inherited from Dragengine.Gui.Layout
Point getMinimumSize (Container container)
 Minimal size required for layout in container. More...
 
Point getMinimumSizeForHeight (Container container, int height)
 Minimum size of layout using reference widget height and variable width. More...
 

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.

◆ doLayout()

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

Layout widgets in container.

Implements Dragengine.Gui.Layout.

◆ 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.

◆ getMinimumSizeForWidth()

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

Minimum size of layout using reference width and variable height.

Implements Dragengine.Gui.Layout.

◆ getTabIndex()

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

Index of the current tab.

◆ new() [1/2]

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

Create layout.

◆ new() [2/2]

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

Create layout.

Version
1.17

◆ removeWidget()

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

Remove widget from layout.

Implements Dragengine.Gui.Layout.

◆ selectFirstTab()

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

Select first tab.

Exceptions
EOutOfBoundscontainer has no child widgets.

◆ selectLastTab()

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

Select last tab.

Exceptions
EOutOfBoundscontainer has no child widgets.

◆ selectNextTab()

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

Select next tab wrapping around on the end.

Exceptions
EOutOfBoundscontainer has no child widgets.

◆ selectPreviousTab()

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

Select previous tab wrapping around on the beginning.

Exceptions
EOutOfBoundscontainer has no child widgets.

◆ 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().

◆ 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.


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