micromenu/inc/example.h

40 lines
745 B
C
Raw Permalink Normal View History

2018-10-28 13:01:25 +00:00
#ifndef _EXAMPLE_H_
#define _EXAMPLE_H_
2021-02-24 19:37:27 +00:00
#include "gfx/Canvas.h"
2018-11-05 20:09:01 +00:00
#include "node.h"
2018-10-28 13:01:25 +00:00
2021-02-24 19:37:27 +00:00
using canvas = micromenu::Canvas;
using node = micromenu::node;
using value = micromenu::value;
2018-11-05 20:09:01 +00:00
class menu : public node {
2021-02-24 19:37:27 +00:00
public:
template<typename ... Args>
explicit menu(Args ... ns) : node(ns...) {
}
2018-11-05 09:53:59 +00:00
2021-02-24 19:37:27 +00:00
void render(canvas &c) override;
2018-11-05 20:09:01 +00:00
};
class fooValue : public value {
2021-02-24 19:37:27 +00:00
public:
fooValue(const char *str, int val) : value(str, val, 32, 48) {
}
2018-11-05 20:09:01 +00:00
2021-02-24 19:37:27 +00:00
void render(canvas &c) override;
2018-11-05 20:09:01 +00:00
};
2021-02-24 19:37:27 +00:00
class blubValue : public value {
public:
template<typename ... Args>
explicit blubValue(Args ... ns) : value(ns..., 64, 96) {
}
void render(canvas &c) override;
2018-11-05 20:09:01 +00:00
};
2018-10-28 13:01:25 +00:00
#endif