24#include <boost/pool/pool_alloc.hpp>
35 struct cell_unoccupied : std::logic_error { cell_unoccupied() : std::logic_error(
"neogfx::grid_layout::cell_unoccupied") {} };
44 typedef std::vector<std::pair<cell_coordinates, cell_coordinates>> span_list;
92 void remove(item_list::iterator aItem);
94 uint32_t visible_rows()
const;
95 bool is_row_visible(uint32_t aRow)
const;
96 uint32_t visible_columns()
const;
97 bool is_column_visible(uint32_t aColumn)
const;
102 void increment_cursor();
110 template <
typename ItemType>
113 return static_cast<ItemType&
>(
add_item_at_position(aRow, aColumn, to_abstract(static_pointer_cast<i_layout_item>(aItem))));
115 template <
typename ItemType>
118 return static_cast<ItemType&
>(
add_item_at_position(aRow, aColumn, to_abstract(static_pointer_cast<i_layout_item>(aItem))));
121 template <
typename W
idgetT>
132 std::vector<ref_ptr<horizontal_layout>> iRows;
coordinate dimension_type
i_spacer & add_spacer() override
cell_coordinates dimensions() const
grid_layout(cell_coordinate aRows, cell_coordinate aColumns, neogfx::alignment aAlignment=neogfx::alignment::Center|neogfx::alignment::VCenter)
grid_layout & set_dimensions(cell_coordinate aRows, cell_coordinate aColumns)
i_layout_item & item_at_position(cell_coordinate aRow, cell_coordinate aColumn)
grid_layout(i_widget &aParent, cell_coordinate aRows, cell_coordinate aColumns, neogfx::alignment aAlignment=neogfx::alignment::Center|neogfx::alignment::VCenter)
cell_coordinates item_position(const i_layout_item &aItem) const
ItemType & add_item_at_position(cell_coordinate aRow, cell_coordinate aColumn, ref_ptr< ItemType > const &aItem)
grid_layout(i_widget &aParent, neogfx::alignment aAlignment=neogfx::alignment::Center|neogfx::alignment::VCenter)
virtual i_layout_item & add_item_at_position(cell_coordinate aRow, cell_coordinate aColumn, i_ref_ptr< i_layout_item > const &aItem)
basic_size< cell_coordinate > cell_dimensions
i_layout const & layout_at_position(cell_coordinate aRow, cell_coordinate aColumn) const
ItemType & add_item_at_position(cell_coordinate aRow, cell_coordinate aColumn, i_ref_ptr< ItemType > const &aItem)
i_layout & layout_at_position(cell_coordinate aRow, cell_coordinate aColumn)
basic_point< cell_coordinate > cell_coordinates
void remove(item_list::iterator aItem)
i_spacer & add_spacer_at(layout_item_index aPosition) override
i_layout_item const & item_at_position(cell_coordinate aRow, cell_coordinate aColumn) const
void layout_items(const point &aPosition, const size &aSize) override
WidgetT & widget_at_position(cell_coordinate aRow, cell_coordinate aColumn)
void set_alignment(optional_alignment const &aAlignment, bool aUpdateLayout=true) override
void invalidate(bool aDeferLayout=true) override
size minimum_size(optional_size const &aAvailableSpace=optional_size{}) const override
grid_layout & add_span(const cell_coordinates &aFrom, const cell_coordinates &aTo)
virtual void remove_item_at_position(cell_coordinate aRow, cell_coordinate aColumn)
bool is_item_at_position(cell_coordinate aRow, cell_coordinate aColumn) const
i_widget const & widget_at_position(cell_coordinate aRow, cell_coordinate aColumn) const
void set_spacing(optional_size const &aSpacing, bool aUpdateLayout=true) override
void remove_all() override
grid_layout(neogfx::alignment aAlignment=neogfx::alignment::Center|neogfx::alignment::VCenter)
i_widget & widget_at_position(cell_coordinate aRow, cell_coordinate aColumn)
i_layout_item & add(i_layout_item &aItem) override
virtual i_layout_item & add_item_at_position(cell_coordinate aRow, cell_coordinate aColumn, i_layout_item &aItem)
virtual i_spacer & add_spacer_at_position(cell_coordinate aRow, cell_coordinate aColumn)
cell_coordinate rows() const
grid_layout(i_layout &aParent, cell_coordinate aRows, cell_coordinate aColumns, neogfx::alignment aAlignment=neogfx::alignment::Center|neogfx::alignment::VCenter)
i_layout_item & add(i_ref_ptr< i_layout_item > const &aItem) override
size maximum_size(optional_size const &aAvailableSpace=optional_size{}) const override
grid_layout(i_layout &aParent, neogfx::alignment aAlignment=neogfx::alignment::Center|neogfx::alignment::VCenter)
const cell_coordinates & cursor() const
cell_coordinate columns() const
grid_layout & add_span(cell_coordinate aRowFrom, cell_coordinate aColumnFrom, uint32_t aRows, uint32_t aColumns)
void invalidate_combined_transformation() override
i_layout_item & add_at(layout_item_index aPosition, i_layout_item &aItem) override
uint32_t layout_item_index
optional< size > optional_size
boost::fast_pool_allocator< T, boost::default_user_allocator_new_delete, boost::details::pool::null_mutex, NextSize > fast_pool_allocator