Drag[en]gine Script Module DragonScript
1.23
|
Similar to FixedMinimalLayout but allows to restrict width or height. More...
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... | |
Similar to FixedMinimalLayout but allows to restrict width or height.
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.
void Dragengine.Gui.Layouts.ViewportLayout.doLayout | ( | Container | container | ) |
Layout content.
Reimplemented from Dragengine.Gui.Layouts.FixedMinimalLayout.
int Dragengine.Gui.Layouts.ViewportLayout.getHeight | ( | ) |
Fixed height or 0 to not restrict.
bool Dragengine.Gui.Layouts.ViewportLayout.getStretch | ( | ) |
Stretch content instead of using minimum size.
int Dragengine.Gui.Layouts.ViewportLayout.getWidth | ( | ) |
Fixed width or 0 to not restrict.
ViewportLayout Dragengine.Gui.Layouts.ViewportLayout.new | ( | ) |
Create layout with fixed size (5,5).
Reimplemented from Dragengine.Gui.Layouts.FixedMinimalLayout.
ViewportLayout Dragengine.Gui.Layouts.ViewportLayout.new | ( | int | width, |
int | height, | ||
bool | stretch | ||
) |
Create layout.
void Dragengine.Gui.Layouts.ViewportLayout.setHeight | ( | int | height | ) |
Set fixed height or 0 to not restrict.
void Dragengine.Gui.Layouts.ViewportLayout.setStretch | ( | bool | stretch | ) |
Set stretch content instead of using minimum size.
void Dragengine.Gui.Layouts.ViewportLayout.setWidth | ( | int | width | ) |
Set fixed width or 0 to not restrict.