Subversion Repositories Kolibri OS

Rev

Rev 6457 | Rev 6470 | 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"
6466 siemargl 5
 
6391 ashmew2 6
enum CHECKBOX_FLAGS {
7
     CHECKBOX_IS_SET = 0x00000002
8
     /* Add more flags later */
9
};
10
 
6457 punk_joker 11
typedef struct {
6391 ashmew2 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;
6466 siemargl 23
}check_box;
24
 
25
extern void (*check_box_draw2)(check_box *) __attribute__((__stdcall__));
26
extern void (*check_box_mouse2)(check_box *)__attribute__((__stdcall__));
27
extern void (*init_checkbox2)(check_box *)__attribute__((__stdcall__));
6391 ashmew2 28
 
6457 punk_joker 29
check_box* kolibri_new_check_box(unsigned int tlx, unsigned int tly, unsigned int sizex, unsigned int sizey, char *label_text)
6391 ashmew2 30
{
6457 punk_joker 31
     check_box* new_checkbox = (check_box *)malloc(sizeof(check_box));
6391 ashmew2 32
     new_checkbox -> left_s = (tlx << 16) + sizex;
33
     new_checkbox -> top_s  = (tly << 16) + sizey;
34
     new_checkbox -> ch_text_margin = 10;
35
     new_checkbox -> color = 0xFFFFFFFF;
36
     new_checkbox -> border_color = kolibri_color_table.color_work_graph;
37
     new_checkbox -> text_color = kolibri_color_table.color_work_text;
38
     new_checkbox -> text = label_text;
6466 siemargl 39
     new_checkbox -> flags = 0x00000008;
40
 
41
     (*init_checkbox2)(new_checkbox); // count text width for mouse action and set flags
6391 ashmew2 42
 
43
     return new_checkbox;
44
}
45
 
46
 
47
#endif /* KOLIBRI_CHECKBOX_H */