init checkbox, add frame

git-svn-id: svn://kolibrios.org@6466 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
siemargl 2016-07-31 14:43:54 +00:00
parent 523ccd603b
commit 3e57c7257b
5 changed files with 41 additions and 35 deletions

View File

@ -134,6 +134,7 @@ public edit_box_mouse as '_edit_box_mouse'
public check_box_draw2 as '_check_box_draw2' public check_box_draw2 as '_check_box_draw2'
public check_box_mouse2 as '_check_box_mouse2' public check_box_mouse2 as '_check_box_mouse2'
public init_checkbox2 as '_init_checkbox2'
public progressbar_draw as '_progressbar_draw' public progressbar_draw as '_progressbar_draw'
public progressbar_progress as '_progressbar_progress' public progressbar_progress as '_progressbar_progress'

View File

@ -13,13 +13,15 @@ int main()
oskey_t key; oskey_t key;
kolibri_window *main_window = kolibri_new_window(50, 50, 400, 100, "BoardMsg: OpenDialog 0.12"); kolibri_window *main_window = kolibri_new_window(50, 50, 400, 100, "BoardMsg: OpenDialog 0.12");
check_box *checkbox = kolibri_new_check_box(20, 40, 12, 12, "Append BOARDMSG to entered message."); check_box *checkbox = kolibri_new_check_box(20, 45, 12, 12, "Append BOARDMSG to entered message.");
edit_box *textbox = kolibri_new_edit_box(20, 55, 40); edit_box *textbox = kolibri_new_edit_box(20, 60, 40);
kolibri_button *button = kolibri_new_button(310, 55, 24, 14, 0x21, kolibri_color_table.color_work_button); kolibri_button *button = kolibri_new_button(310, 60, 24, 14, 0x21, kolibri_color_table.color_work_button);
frame *fr = kolibri_new_frame(12, 35, 350, 50, 0x00FCFCFC, 0x00DCDCDC, 1, "Frame Title", 0, kolibri_color_table.color_work_text, kolibri_color_table.color_work_area);
kolibri_window_add_element(main_window, KOLIBRI_EDIT_BOX, textbox); kolibri_window_add_element(main_window, KOLIBRI_EDIT_BOX, textbox);
kolibri_window_add_element(main_window, KOLIBRI_CHECK_BOX, checkbox); kolibri_window_add_element(main_window, KOLIBRI_CHECK_BOX, checkbox);
kolibri_window_add_element(main_window, KOLIBRI_BUTTON, button); kolibri_window_add_element(main_window, KOLIBRI_BUTTON, button);
kolibri_window_add_element(main_window, KOLIBRI_FRAME, fr);
extern volatile unsigned press_key; extern volatile unsigned press_key;
@ -66,7 +68,7 @@ int main()
kolibri_handle_event_mouse(main_window); kolibri_handle_event_mouse(main_window);
} }
} while(gui_event = get_os_event()); /* End of main activity loop */ } while((gui_event = get_os_event())); /* End of main activity loop */
/* kolibri_quit(); */ /* kolibri_quit(); */

View File

@ -22,6 +22,10 @@ typedef struct {
unsigned int size_of_str; unsigned int size_of_str;
}check_box; }check_box;
extern void (*check_box_draw2)(check_box *) __attribute__((__stdcall__));
extern void (*check_box_mouse2)(check_box *)__attribute__((__stdcall__));
extern void (*init_checkbox2)(check_box *)__attribute__((__stdcall__));
check_box* kolibri_new_check_box(unsigned int tlx, unsigned int tly, unsigned int sizex, unsigned int sizey, char *label_text) check_box* kolibri_new_check_box(unsigned int tlx, unsigned int tly, unsigned int sizex, unsigned int sizey, char *label_text)
{ {
check_box* new_checkbox = (check_box *)malloc(sizeof(check_box)); check_box* new_checkbox = (check_box *)malloc(sizeof(check_box));
@ -34,10 +38,10 @@ check_box* kolibri_new_check_box(unsigned int tlx, unsigned int tly, unsigned in
new_checkbox -> text = label_text; new_checkbox -> text = label_text;
new_checkbox -> flags = 0x00000008; new_checkbox -> flags = 0x00000008;
(*init_checkbox2)(new_checkbox); // count text width for mouse action and set flags
return new_checkbox; return new_checkbox;
} }
extern void (*check_box_draw2)(check_box *) __attribute__((__stdcall__));
extern void (*check_box_mouse2)(check_box *)__attribute__((__stdcall__));
#endif /* KOLIBRI_CHECKBOX_H */ #endif /* KOLIBRI_CHECKBOX_H */

View File

@ -36,8 +36,8 @@ frame* kolibri_new_frame(uint16_t tlx, uint16_t tly, uint16_t sizex, uint16_t si
new_frame -> draw_text_flag = draw_text_flag; new_frame -> draw_text_flag = draw_text_flag;
new_frame -> text_pointer = text_pointer; new_frame -> text_pointer = text_pointer;
new_frame -> text_position = text_position; new_frame -> text_position = text_position;
new_frame -> font_number = 1; new_frame -> font_number = 0; // 0 == font 6x9, 1==8x16
new_frame -> font_size_y = 12; new_frame -> font_size_y = 9;
new_frame -> font_color = font_color; new_frame -> font_color = font_color;
new_frame -> font_backgr_color = font_bgcolor; new_frame -> font_backgr_color = font_bgcolor;
return new_frame; return new_frame;

View File

@ -39,7 +39,6 @@ typedef struct{
void *next, *prev; void *next, *prev;
}kolibri_window_element; }kolibri_window_element;
typedef void (*cb_elem_boxlib)(void *) __attribute__((__stdcall__)); typedef void (*cb_elem_boxlib)(void *) __attribute__((__stdcall__));
/* Generic structure for supporting functions on various elements of Kolibri's GUI */ /* Generic structure for supporting functions on various elements of Kolibri's GUI */