Drag[en]gine Script Module DragonScript  1.23
Dragengine.Gui.Layouts.ViewportLayout Class Reference

Similar to FixedMinimalLayout but allows to restrict width or height. More...

Inheritance diagram for Dragengine.Gui.Layouts.ViewportLayout:
Dragengine.Gui.Layouts.FixedMinimalLayout Dragengine.Gui.Layouts.FixedLayout Dragengine.Gui.Layout

Public Member Functions

void doLayout (Container container)
 
int getHeight ()
 
bool getStretch ()
 
int getWidth ()
 
ViewportLayout new ()
 Create layout with fixed size (5,5). More...
 
ViewportLayout new (int width, int height, bool stretch)
 Create layout. More...
 
void setHeight (int height)
 
void setStretch (bool stretch)
 
void setWidth (int width)
 
- Public Member Functions inherited from Dragengine.Gui.Layouts.FixedMinimalLayout
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...
 
Point getMinimumSizeForWidth (Container container, int width)
 Minimum size of layout using reference width and variable height. More...
 
- Public Member Functions inherited from Dragengine.Gui.Layouts.FixedLayout
void addWidget (Widget widget, Object settings)
 Add widget to layout using settings. More...
 
void removeWidget (Widget widget)
 Remove widget from layout. More...
 

Detailed Description

Similar to FixedMinimalLayout but allows to restrict width or height.

Version
1.7

Viewport with FixedMinimalLayout would result in the containing ScrollPanel to use the total viewport content size as minimum size defeating the purpose of using Viewport in the first place. Viewport solved this problem by forcing a minimum size of (5,5). This is though unconvenient if for example only the height should be scrollable but the width should be full size. This layout provides a simple way to achieve this behavior without needing to resort to forcing minimum size.

To restrict width or height set a value larger 0. A value of 0 indicates no restriction.

Member Function Documentation

◆ doLayout()

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

Layout content.

Reimplemented from Dragengine.Gui.Layouts.FixedMinimalLayout.

◆ getHeight()

int Dragengine.Gui.Layouts.ViewportLayout.getHeight ( )

Fixed height or 0 to not restrict.

◆ getStretch()

bool Dragengine.Gui.Layouts.ViewportLayout.getStretch ( )

Stretch content instead of using minimum size.

◆ getWidth()

int Dragengine.Gui.Layouts.ViewportLayout.getWidth ( )

Fixed width or 0 to not restrict.

◆ new() [1/2]

ViewportLayout Dragengine.Gui.Layouts.ViewportLayout.new ( )

Create layout with fixed size (5,5).

Reimplemented from Dragengine.Gui.Layouts.FixedMinimalLayout.

◆ new() [2/2]

ViewportLayout Dragengine.Gui.Layouts.ViewportLayout.new ( int  width,
int  height,
bool  stretch 
)

Create layout.

◆ setHeight()

void Dragengine.Gui.Layouts.ViewportLayout.setHeight ( int  height)

Set fixed height or 0 to not restrict.

◆ setStretch()

void Dragengine.Gui.Layouts.ViewportLayout.setStretch ( bool  stretch)

Set stretch content instead of using minimum size.

◆ setWidth()

void Dragengine.Gui.Layouts.ViewportLayout.setWidth ( int  width)

Set fixed width or 0 to not restrict.


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