diff options
Diffstat (limited to 'fw/fe310/eos/eve/widget/label.c')
-rw-r--r-- | fw/fe310/eos/eve/widget/label.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/fw/fe310/eos/eve/widget/label.c b/fw/fe310/eos/eve/widget/label.c new file mode 100644 index 0000000..ebea823 --- /dev/null +++ b/fw/fe310/eos/eve/widget/label.c @@ -0,0 +1,26 @@ +#include <stdlib.h> +#include <string.h> + +#include "eve.h" +#include "eve_kbd.h" +#include "unicode.h" + +#include "screen/screen.h" +#include "screen/window.h" +#include "screen/page.h" +#include "screen/font.h" + +#include "label.h" + +void eve_label_init(EVELabel *label, EVERect *g, EVEFont *font, char *title) { + memset(label, 0, sizeof(EVELabel)); + if (g) label->g = *g; + label->title = title; + label->font = font; + if (label->g.w == 0) label->g.w = eve_font_str_w(font, label->title); + if (label->g.h == 0) label->g.h = eve_font_h(font); +} + +void eve_label_draw(EVELabel *label) { + eve_cmd(CMD_TEXT, "hhhhs", label->g.x, label->g.y, label->font->id, 0, label->title); +}
\ No newline at end of file |