HoverRace  2.0
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
HoverRace::Display::FlexGrid::CellProxy Class Reference

This is used to reference a cell of the grid without directly accessing it; useful for adding new widgets to the grid. More...

#include <FlexGrid.h>

+ Inheritance diagram for HoverRace::Display::FlexGrid::CellProxy:

Public Member Functions

 CellProxy (size_t row, size_t col, FlexGrid &grid, Cell *cell)
 
 CellProxy (const CellProxy &)=default
 
 CellProxy (CellProxy &&)=default
 
virtual ~CellProxy ()
 
template<class T , class... Args>
std::enable_if< std::is_base_of< UiViewModel, T >::value, std::shared_ptr< BasicCell< T > > >::type NewChild (Args &&...args)
 Creates a new child widget in this cell. More...
 
CellProxyoperator= (const CellProxy &)=delete
 
CellProxyoperator= (CellProxy &&)=delete
 
void SetAlignment (Alignment alignment) override
 Set the how the widget is aligned inside the cell when the cell is larger than the widget. More...
 
void SetFill (bool fill) override
 Set whether the widget is resized to fill the space of the cell. More...
 
- Public Member Functions inherited from HoverRace::Display::FlexGrid::Cell
 Cell ()
 
virtual ~Cell ()
 

Protected Member Functions

bool Contains (const UiViewModel *child) const override
 Check if this contains the specified widget. More...
 
void DropFocus () override
 Trigger DropFocus() on the contents. More...
 
Vec3 Measure () override
 Measure the size of the cell contents. More...
 
bool OnAction () override
 Trigger OnAction() on the contents. More...
 
bool OnNavigate (const Control::Nav &nav) override
 Trigger OnNavigate() on the contents. More...
 
void SetExtents (double x, double y, double w, double h, double paddingX, double paddingY) override
 Set the position and size of the cell. More...
 
bool TryFocus (const Control::Nav &nav) override
 Trigger TryFocus() on the contents. More...
 

Private Types

using SUPER = Cell
 

Private Member Functions

CellCheckCell () const
 

Private Attributes

Cellcell
 
size_t col
 
FlexGridgrid
 
size_t row
 

Detailed Description

This is used to reference a cell of the grid without directly accessing it; useful for adding new widgets to the grid.

Member Typedef Documentation

Constructor & Destructor Documentation

HoverRace::Display::FlexGrid::CellProxy::CellProxy ( size_t  row,
size_t  col,
FlexGrid grid,
Cell cell 
)
inline
HoverRace::Display::FlexGrid::CellProxy::CellProxy ( const CellProxy )
default
HoverRace::Display::FlexGrid::CellProxy::CellProxy ( CellProxy &&  )
default
virtual HoverRace::Display::FlexGrid::CellProxy::~CellProxy ( )
inlinevirtual

Member Function Documentation

Cell* HoverRace::Display::FlexGrid::CellProxy::CheckCell ( ) const
inlineprivate
bool HoverRace::Display::FlexGrid::CellProxy::Contains ( const UiViewModel child) const
inlineoverrideprotectedvirtual

Check if this contains the specified widget.

Parameters
childThe child to check (may be nullptr).
Returns
true if the cell contains the widget, false otherwise.

Implements HoverRace::Display::FlexGrid::Cell.

void HoverRace::Display::FlexGrid::CellProxy::DropFocus ( )
inlineoverrideprotectedvirtual

Trigger DropFocus() on the contents.

Implements HoverRace::Display::FlexGrid::Cell.

Vec3 HoverRace::Display::FlexGrid::CellProxy::Measure ( )
inlineoverrideprotectedvirtual

Measure the size of the cell contents.

Returns
The size (may be zero).

Implements HoverRace::Display::FlexGrid::Cell.

template<class T , class... Args>
std::enable_if< std::is_base_of<UiViewModel, T>::value, std::shared_ptr<BasicCell<T> > >::type HoverRace::Display::FlexGrid::CellProxy::NewChild ( Args &&...  args)
inline

Creates a new child widget in this cell.

If the cell coordinates are outside of the current grid size, then the grid is automatically resized to fit the cell.

Template Parameters
TThe type of the child widget.
ArgsThe types of the arguments.
Parameters
argsThe arguments to pass to the child widget's constructor.
Returns
The actual grid cell
bool HoverRace::Display::FlexGrid::CellProxy::OnAction ( )
inlineoverrideprotectedvirtual

Trigger OnAction() on the contents.

Implements HoverRace::Display::FlexGrid::Cell.

bool HoverRace::Display::FlexGrid::CellProxy::OnNavigate ( const Control::Nav )
inlineoverrideprotectedvirtual

Trigger OnNavigate() on the contents.

Implements HoverRace::Display::FlexGrid::Cell.

CellProxy& HoverRace::Display::FlexGrid::CellProxy::operator= ( const CellProxy )
delete
CellProxy& HoverRace::Display::FlexGrid::CellProxy::operator= ( CellProxy &&  )
delete
void HoverRace::Display::FlexGrid::CellProxy::SetAlignment ( Alignment  alignment)
inlineoverridevirtual

Set the how the widget is aligned inside the cell when the cell is larger than the widget.

Parameters
alignmentThe alignment (default is NW).

Implements HoverRace::Display::FlexGrid::Cell.

void HoverRace::Display::FlexGrid::CellProxy::SetExtents ( double  x,
double  y,
double  w,
double  h,
double  paddingX,
double  paddingY 
)
inlineoverrideprotectedvirtual

Set the position and size of the cell.

Parameters
xThe X position of the cell.
yThe Y position of the cell.
wThe width of the cell.
hThe height of the cell.
paddingXThe horizontal padding on the cell.
paddingYThe vertical padding on the cell.

Implements HoverRace::Display::FlexGrid::Cell.

void HoverRace::Display::FlexGrid::CellProxy::SetFill ( bool  fill)
inlineoverridevirtual

Set whether the widget is resized to fill the space of the cell.

If the widget cannot be resized, then nothing will be done.

Parameters
filltrue To resize the widget, false to leave it alone.

Implements HoverRace::Display::FlexGrid::Cell.

bool HoverRace::Display::FlexGrid::CellProxy::TryFocus ( const Control::Nav nav)
inlineoverrideprotectedvirtual

Trigger TryFocus() on the contents.

Implements HoverRace::Display::FlexGrid::Cell.

Member Data Documentation

Cell* HoverRace::Display::FlexGrid::CellProxy::cell
private
size_t HoverRace::Display::FlexGrid::CellProxy::col
private
FlexGrid& HoverRace::Display::FlexGrid::CellProxy::grid
private
size_t HoverRace::Display::FlexGrid::CellProxy::row
private

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