The placement class for a horizontal list. More...
#include <horizontal_list.hpp>
Public Member Functions | |
placer_horizontal_list (const unsigned maximum_rows) | |
virtual void | initialize () |
Initialises the placer. More... | |
virtual void | add_item (const point &size) |
Adds a item to be placed. More... | |
virtual point | get_size () const |
Gets the required size of all items. More... | |
virtual point | get_origin (const unsigned index) const |
Gets the origin for an item. More... | |
Public Member Functions inherited from gui2::placer_base | |
virtual | ~placer_base () |
Private Attributes | |
unsigned | maximum_rows_ |
The maximum number of rows to use. More... | |
std::vector< int > | rows_ |
Holds the heights of the rows. More... | |
std::vector< std::pair< int, int > > | columns_ |
Holds the column sizes. More... | |
unsigned | row_ |
The row to add an item to. More... | |
unsigned | column_ |
The column to add an item to. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from gui2::placer_base | |
static placer_base * | build (const grow_direction::type grow_dir, const unsigned parallel_items) |
Builder function. More... | |
The placement class for a horizontal list.
See placer_base for more information.
Definition at line 38 of file horizontal_list.hpp.
|
explicit |
Definition at line 31 of file horizontal_list.cpp.
References maximum_rows_.
|
virtual |
Adds a item to be placed.
size | The required size for the item. |
Implements gui2::placer_base.
Definition at line 50 of file horizontal_list.cpp.
References column_, columns_, maximum_rows_, row_, rows_, and utf8::size().
|
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(). |
Implements gui2::placer_base.
Definition at line 77 of file horizontal_list.cpp.
References columns_, utf8::index(), maximum_rows_, draw::point(), and rows_.
|
virtual |
Gets the required size of all items.
Implements gui2::placer_base.
Definition at line 70 of file horizontal_list.cpp.
References columns_, draw::point(), and rows_.
|
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.
Implements gui2::placer_base.
Definition at line 41 of file horizontal_list.cpp.
References column_, columns_, draw::fill(), row_, and rows_.
|
private |
The column to add an item to.
Definition at line 85 of file horizontal_list.hpp.
Referenced by add_item(), and initialize().
|
private |
Holds the column sizes.
The pair contains the following values:
Definition at line 79 of file horizontal_list.hpp.
Referenced by add_item(), get_origin(), get_size(), and initialize().
|
private |
The maximum number of rows to use.
This value is determined by the parallel_items
parameter of placer_base::build).
Definition at line 67 of file horizontal_list.hpp.
Referenced by add_item(), get_origin(), and placer_horizontal_list().
|
private |
The row to add an item to.
Definition at line 82 of file horizontal_list.hpp.
Referenced by add_item(), and initialize().
|
private |
Holds the heights of the rows.
Definition at line 70 of file horizontal_list.hpp.
Referenced by add_item(), get_origin(), get_size(), and initialize().