Child item of the grid. More...
Public Member Functions | |
child () | |
child (child &&) noexcept=default | |
Move constructor. More... | |
point | get_best_size () const |
Returns the best size for the cell. More... | |
void | place (point origin, point size) |
Places the widget in the cell. More... | |
void | layout_initialize (const bool full_initialization) |
Forwards grid::layout_initialize to the cell. More... | |
bool | can_wrap () const |
Returns the can_wrap for the cell. More... | |
const std::string & | id () const |
Returns the id of the widget/. More... | |
unsigned | get_flags () const |
void | set_flags (const unsigned flags) |
unsigned | get_border_size () const |
void | set_border_size (const unsigned border_size) |
const widget * | get_widget () const |
widget * | get_widget () |
void | set_widget (std::unique_ptr< widget > widget) |
Acquires an owning reference to the given widget. More... | |
std::unique_ptr< widget > | free_widget () |
Releases widget from ownership by this child and returns it in the form of a new shared_ptr. More... | |
Private Member Functions | |
point | border_space () const |
Returns the space needed for the border. More... | |
Private Attributes | |
unsigned | flags_ |
The flags for the border and cell setup. More... | |
unsigned | border_size_ |
The size of the border, the actual configuration of the border is determined by the flags. More... | |
std::unique_ptr< widget > | widget_ |
Pointer to the widget. More... | |
Friends | |
struct | grid_implementation |
|
defaultnoexcept |
Move constructor.
This is necessary in order that the child objects be moved instead of copied when the grid's child vector is resized. std::vector will utilize a move constructor as long as a non-throwing one is provided.
|
private |
Returns the space needed for the border.
Definition at line 896 of file grid.cpp.
References gui2::grid::BORDER_BOTTOM, gui2::grid::BORDER_LEFT, gui2::grid::BORDER_RIGHT, and gui2::grid::BORDER_TOP.
Referenced by get_best_size().
|
inline |
Returns the can_wrap for the cell.
Definition at line 358 of file grid.hpp.
References widget_.
Referenced by gui2::grid::can_wrap().
|
inline |
Releases widget from ownership by this child and returns it in the form of a new shared_ptr.
widget_ will be null after this is called.
Definition at line 406 of file grid.hpp.
References widget_.
Referenced by gui2::grid::swap_child().
point gui2::grid::child::get_best_size | ( | ) | const |
Returns the best size for the cell.
Definition at line 729 of file grid.cpp.
References border_space(), DBG_GUI_L, gui2::widget::invisible, LOG_CHILD_HEADER, LOG_CHILD_SCOPE_HEADER, gui2::log_gui_layout, log_scope2, draw::point(), and widget_.
Referenced by gui2::grid::calculate_best_size(), gui2::grid_implementation::column_request_reduce_width(), and gui2::grid_implementation::row_request_reduce_height().
|
inline |
Definition at line 376 of file grid.hpp.
References border_size_.
|
inline |
Definition at line 366 of file grid.hpp.
References flags_.
Referenced by gui2::grid::set_child_alignment().
|
inline |
|
inline |
Definition at line 386 of file grid.hpp.
References widget_.
Referenced by gui2::grid::disable_click_dismiss(), gui2::grid::get_child(), gui2::grid::get_widget(), gui2::grid::has_widget(), gui2::grid::impl_draw_children(), gui2::grid::layout_children(), gui2::grid::set_active(), gui2::grid::set_child(), gui2::grid::set_origin(), gui2::grid::set_visible_rectangle(), and gui2::grid::swap_child().
const std::string & gui2::grid::child::id | ( | ) | const |
Returns the id of the widget/.
Definition at line 890 of file grid.cpp.
Referenced by gui2::grid::remove_child(), gui2::grid::set_child(), and gui2::grid::swap_child().
void gui2::grid::child::layout_initialize | ( | const bool | full_initialization | ) |
Forwards grid::layout_initialize to the cell.
Definition at line 881 of file grid.cpp.
References gui2::widget::invisible.
Referenced by gui2::grid::layout_initialize().
Places the widget in the cell.
origin | The origin (x, y) for the widget. |
size | The size for the widget. |
Definition at line 753 of file grid.cpp.
References gui2::grid::BORDER_BOTTOM, gui2::grid::BORDER_LEFT, gui2::grid::BORDER_RIGHT, gui2::grid::BORDER_TOP, DBG_GUI_L, ERR_GUI_L, gui2::widget::get_best_size(), gui2::styled_widget::get_config_maximum_size(), gui2::widget::get_visible(), gui2::grid::get_widget(), gui2::grid::HORIZONTAL_ALIGN_CENTER, gui2::grid::HORIZONTAL_ALIGN_LEFT, gui2::grid::HORIZONTAL_ALIGN_RIGHT, gui2::grid::HORIZONTAL_GROW_SEND_TO_CLIENT, gui2::grid::HORIZONTAL_MASK, gui2::widget::invisible, LOG_CHILD_HEADER, gui2::widget::place(), draw::point(), utf8::size(), gui2::grid::VERTICAL_ALIGN_BOTTOM, gui2::grid::VERTICAL_ALIGN_CENTER, gui2::grid::VERTICAL_ALIGN_TOP, gui2::grid::VERTICAL_GROW_SEND_TO_CLIENT, and gui2::grid::VERTICAL_MASK.
Referenced by gui2::grid::layout().
|
inline |
Definition at line 381 of file grid.hpp.
References border_size_.
Referenced by gui2::grid::set_child().
|
inline |
Definition at line 371 of file grid.hpp.
References flags_.
Referenced by gui2::grid::set_child(), and gui2::grid::set_child_alignment().
|
inline |
Acquires an owning reference to the given widget.
Definition at line 397 of file grid.hpp.
References widget_.
Referenced by gui2::grid::remove_child(), gui2::grid::set_child(), and gui2::grid::swap_child().
|
friend |
|
private |
The size of the border, the actual configuration of the border is determined by the flags.
Definition at line 419 of file grid.hpp.
Referenced by get_border_size(), and set_border_size().
|
private |
The flags for the border and cell setup.
Definition at line 413 of file grid.hpp.
Referenced by get_flags(), and set_flags().
|
private |
Pointer to the widget.
Once the widget is assigned to the grid we own the widget and it will be destroyed with the grid or free_widget is called.
Definition at line 427 of file grid.hpp.
Referenced by can_wrap(), free_widget(), get_best_size(), get_widget(), and set_widget().