Subversion Repositories Kolibri OS

Rev

Rev 6457 | Rev 6470 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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