-
Notifications
You must be signed in to change notification settings - Fork 1
/
checkbox.h
57 lines (44 loc) · 826 Bytes
/
checkbox.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* TUI checkbox
*
* Visualizes a two-option box
*
* Author: Matthias Bock
* License: GNU GPL v3
*/
#ifndef CHECKBOX_H
#define CHECKBOX_H
#include <stdint.h>
#include <stdbool.h>
#include "ucurses_config.h"
#include "io.h"
typedef struct
{
uint8_t x, y;
char* color;
char* color_selected;
bool selected;
bool checked;
} checkbox_t;
void checkbox_draw(checkbox_t*);
/**
* Mark checkbox as checked and redraw
*/
void checkbox_check(checkbox_t*);
/**
* Mark checkbox as unchecked and redraw
*/
void checkbox_uncheck(checkbox_t*);
/**
* Change the checked-status
*/
void checkbox_toggle(checkbox_t*);
/**
* Mark checkbox selected and redraw
*/
void checkbox_select(checkbox_t*);
/**
* Mark checkbox unselected and redraw
*/
void checkbox_deselect(checkbox_t*);
#endif