The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
gui2::grid::child Class Reference

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 widgetget_widget () const
 
widgetget_widget ()
 
void set_widget (widget *widget)
 
std::unique_ptr< widgetfree_widget ()
 Releases widget from ownership by this child and returns it in the form of a new unique_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< widgetwidget_
 Pointer to the widget. More...
 

Friends

struct grid_implementation
 

Detailed Description

Child item of the grid.

Definition at line 328 of file grid.hpp.

Constructor & Destructor Documentation

gui2::grid::child::child ( )
inline

Definition at line 335 of file grid.hpp.

gui2::grid::child::child ( child &&  )
default

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.

Member Function Documentation

point gui2::grid::child::border_space ( ) const
private
bool gui2::grid::child::can_wrap ( ) const
inline

Returns the can_wrap for the cell.

Definition at line 372 of file grid.hpp.

References widget_.

Referenced by gui2::grid::can_wrap().

std::unique_ptr<widget> gui2::grid::child::free_widget ( )
inline

Releases widget from ownership by this child and returns it in the form of a new unique_ptr.

widget_ will be null after this is called.

Definition at line 419 of file grid.hpp.

References widget_.

Referenced by gui2::grid::swap_child().

point gui2::grid::child::get_best_size ( ) const
unsigned gui2::grid::child::get_border_size ( ) const
inline

Definition at line 390 of file grid.hpp.

References border_size_.

unsigned gui2::grid::child::get_flags ( ) const
inline

Definition at line 380 of file grid.hpp.

References flags_.

Referenced by gui2::grid::set_child_alignment().

const widget* gui2::grid::child::get_widget ( ) const
inline
widget* gui2::grid::child::get_widget ( )
inline

Definition at line 405 of file grid.hpp.

References widget_.

const std::string & gui2::grid::child::id ( ) const

Returns the id of the widget/.

Definition at line 902 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 893 of file grid.cpp.

References gui2::widget::invisible.

Referenced by gui2::grid::layout_initialize().

void gui2::grid::child::place ( point  origin,
point  size 
)
void gui2::grid::child::set_border_size ( const unsigned  border_size)
inline

Definition at line 395 of file grid.hpp.

References border_size_.

Referenced by gui2::grid::set_child().

void gui2::grid::child::set_flags ( const unsigned  flags)
inline

Definition at line 385 of file grid.hpp.

References flags_.

Referenced by gui2::grid::set_child(), and gui2::grid::set_child_alignment().

void gui2::grid::child::set_widget ( widget widget)
inline

Definition at line 410 of file grid.hpp.

References widget_.

Referenced by gui2::grid::remove_child(), gui2::grid::set_child(), and gui2::grid::swap_child().

Friends And Related Function Documentation

friend struct grid_implementation
friend

Definition at line 330 of file grid.hpp.

Member Data Documentation

unsigned gui2::grid::child::border_size_
private

The size of the border, the actual configuration of the border is determined by the flags.

Definition at line 435 of file grid.hpp.

Referenced by get_border_size(), and set_border_size().

unsigned gui2::grid::child::flags_
private

The flags for the border and cell setup.

Definition at line 429 of file grid.hpp.

Referenced by get_flags(), and set_flags().

std::unique_ptr<widget> gui2::grid::child::widget_
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 443 of file grid.hpp.

Referenced by can_wrap(), gui2::grid_implementation::cell_request_reduce_height(), gui2::grid_implementation::cell_request_reduce_width(), free_widget(), get_best_size(), get_widget(), and set_widget().


The documentation for this class was generated from the following files: