Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
#ifndef CUSTOM_H_
#define CUSTOM_H_
#include "widget.h"
class Custom: public Widget {
public:
Custom(coords_t size, void (*draw)(Widget&, coords_t),
void (*input)(Widget&, GUIEvent_t *)) {
this->size = size;
drawCB = draw;
inputCB = input;
}
private:
void draw(coords_t offset) override {
if (drawCB) {
drawCB(*this, offset);
}
}
void input(GUIEvent_t *ev) override {
if (inputCB) {
inputCB(*this, ev);
}
}
void (*drawCB)(Widget&, coords_t);
void (*inputCB)(Widget&, GUIEvent_t*);
};
#endif
8524e79feThis file is pinned to the selected release. Download the original to open it in your design tool.