The placement class for a vertical list. More...
#include <vertical_list.hpp>
Public Member Functions | |
tplacer_vertical_list (const unsigned maximum_columns) | |
virtual void | initialise () |
Initialises the placer. More... | |
virtual void | add_item (const tpoint &size) |
Adds a item to be placed. More... | |
virtual tpoint | get_size () const |
Gets the required size of all items. More... | |
virtual tpoint | get_origin (const unsigned index) const |
Gets the origin for an item. More... | |
Public Member Functions inherited from gui2::tplacer_ | |
virtual MAKE_ENUM(tgrow_direction,(horizontal,"horizontal")(vertical,"vertical")) public | ~tplacer_ () |
The direction the placer should grow towards. More... | |
Private Attributes | |
unsigned | maximum_columns_ |
The maximum number of columns to use. More... | |
std::vector< std::pair< int, int > > | rows_ |
Holds the row sizes. More... | |
std::vector< int > | columns_ |
Holds the widths of the columns. More... | |
unsigned | row_ |
The row to add an item to. More... | |
unsigned | column_ |
The column to add an item to. More... | |
The placement class for a vertical list.
See tplacer_ for more information.
Definition at line 38 of file vertical_list.hpp.
|
explicit |
Definition at line 30 of file vertical_list.cpp.
References maximum_columns_.
Adds a item to be placed.
size | The required size for the item. |
Implements gui2::tplacer_.
Definition at line 49 of file vertical_list.cpp.
References column_, columns_, maximum_columns_, row_, rows_, gui2::tpoint::x, and gui2::tpoint::y.
|
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::tplacer_.
Definition at line 76 of file vertical_list.cpp.
References columns_, maximum_columns_, and rows_.
|
virtual |
Gets the required size of all items.
Implements gui2::tplacer_.
Definition at line 69 of file vertical_list.cpp.
|
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::tplacer_.
Definition at line 40 of file vertical_list.cpp.
|
private |
The column to add an item to.
Definition at line 84 of file vertical_list.hpp.
Referenced by add_item(), and initialise().
|
private |
Holds the widths of the columns.
Definition at line 78 of file vertical_list.hpp.
Referenced by add_item(), get_origin(), get_size(), and initialise().
|
private |
The maximum number of columns to use.
This value is determined by the parallel_items
parameter of tplacer_::build).
Definition at line 66 of file vertical_list.hpp.
Referenced by add_item(), get_origin(), and tplacer_vertical_list().
|
private |
The row to add an item to.
Definition at line 81 of file vertical_list.hpp.
Referenced by add_item(), and initialise().
Holds the row sizes.
The pair contains the following values:
Definition at line 75 of file vertical_list.hpp.
Referenced by add_item(), get_origin(), get_size(), and initialise().