aboutsummaryrefslogtreecommitdiffstats
path: root/widget.h
blob: c9a9a8a4f2ca270650fd911ec0ec0576cc1f5e49 (plain) (blame)
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
enum { LABEL_SIZE = 128 };


/* Field is a floating point number input field. */
typedef struct {
	char buf[64];
	double value;
	int invalid;
} w_Field;

void w_init_field(w_Field *f);
int w_field(mu_Context *ctx, w_Field *f);
void w_set_field(w_Field *f, double v);


typedef struct {
	int nopts;
	const char *const *opts;
	int idx; /* index of selected option. */
	int oldidx; /* index of previously selected option. */
	int active;
} w_Select;

void w_init_select(w_Select *select, int nopts, const char *const opts[]);
int w_select(mu_Context *ctx, w_Select *select);


typedef char w_Label[LABEL_SIZE];

void w_init_label(w_Label label);
void w_label(mu_Context *ctx, const w_Label label);