2020-02-10 00:28:46 +01:00
|
|
|
#pragma once
|
|
|
|
|
2020-02-10 02:03:37 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2020-02-10 07:17:50 +01:00
|
|
|
enum ButtonStatus_e : uint8_t {
|
|
|
|
Stateless,
|
|
|
|
Inactive,
|
|
|
|
Active
|
|
|
|
};
|
|
|
|
|
2020-02-10 00:28:46 +01:00
|
|
|
struct Button {
|
2020-02-10 07:17:50 +01:00
|
|
|
int16_t x, y, w, h;
|
2020-02-10 07:19:54 +01:00
|
|
|
const char* text;//nullptr if text_override should be used
|
2020-02-10 07:27:49 +01:00
|
|
|
void (*text_override)(char* text_out, const uint16_t max_text_size);//nullptr if text should be used
|
2020-02-10 07:19:54 +01:00
|
|
|
ButtonStatus_e (*status)();//Used for coloring and morse menu
|
2020-02-10 07:17:50 +01:00
|
|
|
void (*on_select)();//Action to take when selected
|
2020-02-10 07:19:54 +01:00
|
|
|
char morse;
|
2020-02-10 08:06:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
void drawButton(Button* button);
|