Rev 6589 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8581 | rgimad | 1 | #ifndef KOLIBRI_OPTIONBOX_H |
2 | #define KOLIBRI_OPTIONBOX_H |
||
3 | |||
6589 | siemargl | 4 | typedef struct __attribute__ ((__packed__)) option_box_t { |
8581 | rgimad | 5 | struct option_box_t **selected; |
6 | uint16_t posx; |
||
7 | uint16_t posy; |
||
8 | uint32_t text_margin; // = 4 ���������� �� �������������� ��� ����� �� ������� |
||
9 | uint32_t size; // 12 ������ �������� ��� ����� |
||
6479 | siemargl | 10 | color_t color; |
11 | color_t border_color; // individual border |
||
12 | color_t text_color; |
||
13 | char *text; |
||
8581 | rgimad | 14 | uint32_t text_len; |
15 | uint32_t flags; |
||
6479 | siemargl | 16 | }option_box; |
17 | |||
8581 | rgimad | 18 | extern void (*option_box_draw)(option_box **) __attribute__((__stdcall__)); |
6479 | siemargl | 19 | extern void (*option_box_mouse)(option_box **)__attribute__((__stdcall__)); |
20 | |||
8581 | rgimad | 21 | static inline option_box* gui_optionbox(option_box* ob, uint32_t x_y, char* text, option_box**select) |
6479 | siemargl | 22 | { |
23 | ob->selected = select; |
||
24 | ob->posx = x_y >> 16; |
||
25 | ob->posy = x_y & 0xFFFF; |
||
26 | ob->text_margin = 4; |
||
27 | ob->size = 12; |
||
8581 | rgimad | 28 | ob->color = kolibri_color_table.color_work_button_text; |
29 | ob->border_color = kolibri_color_table.color_work_button; |
||
6479 | siemargl | 30 | ob->text_color = kolibri_color_table.color_work_text | 0x80000000; |
31 | ob->text = text; |
||
32 | ob->text_len = strlen(text); |
||
33 | ob->flags = 0; // not used |
||
34 | |||
8581 | rgimad | 35 | return ob; |
36 | } |
||
6479 | siemargl | 37 | |
8581 | rgimad | 38 | static inline option_box* gui_new_optionbox(uint32_t x_y, char* text, option_box**select) |
6479 | siemargl | 39 | { |
40 | option_box* ob = malloc(sizeof(option_box)); |
||
41 | |||
42 | return gui_optionbox(ob, x_y, text, select); |
||
43 | } |
||
44 | |||
45 | #define gui_optionbox_def(a,b,c,d) gui_optionbox(a,b,c,d) |
||
8581 | rgimad | 46 | |
6479 | siemargl | 47 | #define gui_new_optionbox_def(a,b,c) gui_new_optionbox(a,b,c) |
48 | |||
8581 | rgimad | 49 | static inline void gui_add_optiongroup(kolibri_window *wnd, option_box** option_group) |
6479 | siemargl | 50 | { |
8581 | rgimad | 51 | kolibri_window_add_element(wnd, KOLIBRI_OPTIONGROUP, option_group); |
6479 | siemargl | 52 | } |
53 | |||
8581 | rgimad | 54 | |
55 | #endif /* KOLIBRI_OPTIONBOX_H */ |