Base class for the placement helper. More...
#include <placer.hpp>
Public Member Functions | |
virtual MAKE_ENUM(tgrow_direction,(horizontal,"horizontal")(vertical,"vertical")) public | ~tplacer_ () |
The direction the placer should grow towards. More... | |
virtual void | initialise ()=0 |
Initialises the placer. More... | |
virtual void | add_item (const tpoint &size)=0 |
Adds a item to be placed. More... | |
virtual tpoint | get_size () const =0 |
Gets the required size of all items. More... | |
virtual tpoint | get_origin (const unsigned index) const =0 |
Gets the origin for an item. More... | |
Base class for the placement helper.
The normal operation for the usage of the class is:
index
parameter is an increasing counter.Definition at line 52 of file placer.hpp.
|
virtual |
The direction the placer should grow towards.
Builder function.
parallel_items
> 0grow_direction | The direction in which the items will be added. |
parallel_items | The direction perpendicular towards the grow direction has a fixed number of items. This value sets that limit. For a list containing only horizontally or vertically placed items the value should be 1. |
Definition at line 40 of file placer.cpp.
Adds a item to be placed.
size | The required size for the item. |
Implemented in gui2::implementation::tplacer_horizontal_list, and gui2::implementation::tplacer_vertical_list.
|
pure virtual |
Gets the origin for an item.
index | The index of the item whose origin to return. The index is the index of the call to add_item(). |
Implemented in gui2::implementation::tplacer_horizontal_list, and gui2::implementation::tplacer_vertical_list.
|
pure virtual |
Gets the required size of all items.
Implemented in gui2::implementation::tplacer_horizontal_list, and gui2::implementation::tplacer_vertical_list.
|
pure virtual |
Initialises the placer.
When the placement needs to be calculated the state often needs to be reset, items are placed, removed or changed visibility causing the old placement to be invalid.
Implemented in gui2::implementation::tplacer_horizontal_list, and gui2::implementation::tplacer_vertical_list.