ubitxv6/button.h

21 lines
475 B
C
Raw Normal View History

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