Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
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).
ViewportLayout new (int width, int height, bool stretch)
 Create layout.
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.
Point getMinimumSizeForHeight (Container container, int height)
 Minimum size of layout using reference widget height and variable width.
Point getMinimumSizeForWidth (Container container, int width)
 Minimum size of layout using reference width and variable height.
Public Member Functions inherited from Dragengine.Gui.Layouts.FixedLayout
void addWidget (Widget widget, Object settings)
 Add widget to layout using settings.
void removeWidget (Widget widget)
 Remove widget from layout.

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.

Referenced by setWidth().

◆ new() [1/2]

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

Create layout with fixed size (5,5).

Reimplemented from Dragengine.Gui.Layouts.FixedMinimalLayout.

References new().

Referenced by new(), and new().

◆ new() [2/2]

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

Create layout.

References new(), setHeight(), and setWidth().

◆ setHeight()

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

Set fixed height or 0 to not restrict.

References setWidth().

Referenced by new().

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

References getWidth().

Referenced by new(), and setHeight().


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