Chesto 0.9
A declarative and element-based library for creating GUIs on homebrew'd consoles
Grid.hpp
1#pragma once
2
3#include "Element.hpp"
4#include <vector>
5
6namespace Chesto {
7
8class Grid : public Element
9{
10public:
11 Grid(int columns, int width, int cellPadding = 0, int rowPadding = 0);
12
14 void refresh();
15 bool process(InputEvents* event) override;
16
17 int columns;
18 int width;
19 int cellPadding;
20 int rowPadding;
21
23 int highlighted = -1; // Ccrrently highlighted element index (-1 = none)
24 bool touchMode = true; // whether we're in touch or cursor mode
25};
26
27} // namespace Chesto
Grid(int columns, int width, int cellPadding=0, int rowPadding=0)
Definition: Grid.cpp:14
int highlighted
Cursor state.
Definition: Grid.hpp:23
bool process(InputEvents *event) override
process any input that is received for this element
Definition: Grid.cpp:72
void refresh()
Recalculate positions for all child elements.
Definition: Grid.cpp:24