2#include "InputEvents.hpp"
14Grid::Grid(
int columns,
int width,
int cellPadding,
int rowPadding)
17 , cellPadding(cellPadding)
18 , rowPadding(rowPadding)
32 int cellWidth = (this->width - (cellPadding * (columns - 1))) / columns;
36 int currentRowHeight = 0;
45 if (elem->height > currentRowHeight) {
46 currentRowHeight = elem->height;
51 xPos += cellWidth + cellPadding;
57 yPos += currentRowHeight + rowPadding;
64 yPos += currentRowHeight;
65 }
else if (yPos > 0) {
std::vector< std::unique_ptr< Element, std::function< void(Element *)> > > elements
visible GUI child elements of this element
virtual bool process(InputEvents *event)
process any input that is received for this element
Grid(int columns, int width, int cellPadding=0, int rowPadding=0)
int highlighted
Cursor state.
bool process(InputEvents *event) override
process any input that is received for this element
void refresh()
Recalculate positions for all child elements.