Subversion Repositories Kolibri OS

Rev

Rev 6391 | Rev 6457 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6391 ashmew2 1
#ifndef KOLIBRI_CHECKBOX_H
2
#define KOLIBRI_CHECKBOX_H
3
 
4
#include "kolibri_colors.h"
5
 
6
enum CHECKBOX_FLAGS {
7
     CHECKBOX_IS_SET = 0x00000002
8
     /* Add more flags later */
9
};
10
 
11
struct check_box {
12
    unsigned int left_s;
13
    unsigned int top_s;
14
    unsigned int ch_text_margin;
15
    unsigned int color;
16
    unsigned int border_color;
17
    unsigned int text_color;
18
    char *text;
19
    unsigned int flags;
20
 
21
    /* Users can use members above this */
22
    unsigned int size_of_str;
23
};
24
 
25
struct check_box* kolibri_new_check_box(unsigned int tlx, unsigned int tly, unsigned int sizex, unsigned int sizey, char *label_text)
26
{
27
     struct check_box* new_checkbox = (struct check_box *)malloc(sizeof(struct check_box));
28
     new_checkbox -> left_s = (tlx << 16) + sizex;
29
     new_checkbox -> top_s  = (tly << 16) + sizey;
30
     new_checkbox -> ch_text_margin = 10;
31
     new_checkbox -> color = 0xFFFFFFFF;
32
     new_checkbox -> border_color = kolibri_color_table.color_work_graph;
33
     new_checkbox -> text_color = kolibri_color_table.color_work_text;
34
     new_checkbox -> text = label_text;
35
     new_checkbox -> flags = 0x00000008;
36
 
37
     return new_checkbox;
38
}
39
 
40
extern void (*check_box_draw2)(struct check_box *) __attribute__((__stdcall__));
41
extern void (*check_box_mouse2)(struct check_box *)__attribute__((__stdcall__));
42
 
43
#endif /* KOLIBRI_CHECKBOX_H */