From 97f2e491075831f8fc034ec18feab69aa7280080 Mon Sep 17 00:00:00 2001 From: siemargl Date: Thu, 8 Sep 2016 18:54:17 +0000 Subject: [PATCH] fix coords git-svn-id: svn://kolibrios.org@6516 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../C_Layer/EXAMPLE/libguic_kolibri/Makefile | 19 +++++++++++---- .../EXAMPLE/libguic_kolibri/boardmsg.c | 12 +++++----- .../EXAMPLE/libguic_kolibri/option_menu.c | 24 +++++++++---------- .../EXAMPLE/libguic_kolibri/scroll_progress.c | 14 +++++------ 4 files changed, 39 insertions(+), 30 deletions(-) diff --git a/contrib/C_Layer/EXAMPLE/libguic_kolibri/Makefile b/contrib/C_Layer/EXAMPLE/libguic_kolibri/Makefile index 65a3ff9338..c9930373a4 100644 --- a/contrib/C_Layer/EXAMPLE/libguic_kolibri/Makefile +++ b/contrib/C_Layer/EXAMPLE/libguic_kolibri/Makefile @@ -15,15 +15,24 @@ LIBPATH:= -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib OBJPATH = $(CLAYER)/OBJ -SOURCES = boardmsg.c +SOURCES = boardmsg.c option_menu.c OBJECTS = $(patsubst %.c, %.o, $(SOURCES)) -all:$(NAME) +all: boardmsg option_menu scroll_progress -$(NAME): $(OBJECTS) Makefile - $(LD) $(LIBPATH) --subsystem native -o $@ $(OBJECTS) $(OBJPATH)/loadboxlib.obj $(LDFLAGS) - #-ldll -lc.dll -lapp -Map $(NAME).map +scroll_progress: scroll_progress.o +# $(LD) $(LIBPATH) --subsystem native -o $@ $^ $(OBJPATH)/loadboxlib.obj $(LDFLAGS) + $(LD) $(LIBPATH) --subsystem windows -o $@ $^ $(OBJPATH)/loadboxlib.obj $(LDFLAGS) + kos32-objcopy $@ -O binary + + +option_menu: option_menu.o + $(LD) $(LIBPATH) --subsystem native -o $@ $^ $(OBJPATH)/loadboxlib.obj $(LDFLAGS) + kos32-objcopy $@ -O binary + +boardmsg: boardmsg.o + $(LD) $(LIBPATH) --subsystem native -o $@ $^ $(OBJPATH)/loadboxlib.obj $(LDFLAGS) kos32-objcopy $@ -O binary %.o : %.c Makefile diff --git a/contrib/C_Layer/EXAMPLE/libguic_kolibri/boardmsg.c b/contrib/C_Layer/EXAMPLE/libguic_kolibri/boardmsg.c index b951fecdeb..fe5729bf4c 100644 --- a/contrib/C_Layer/EXAMPLE/libguic_kolibri/boardmsg.c +++ b/contrib/C_Layer/EXAMPLE/libguic_kolibri/boardmsg.c @@ -31,14 +31,14 @@ int main() unsigned int gui_event = KOLIBRI_EVENT_REDRAW; oskey_t key; - kolibri_window *main_window = kolibri_new_window(50, 50, 400, 120, "BoardMsg"); - check_box *checkbox = kolibri_new_check_box(20, 25, 12, 12, "Append BOARDMSG to entered message."); + kolibri_window *main_window = kolibri_new_window(50, 40, 400, 120, "BoardMsg"); + check_box *checkbox = kolibri_new_check_box(20, 15, 12, 12, "Append BOARDMSG to entered message."); edit_box *editbox_interlock = NULL; - edit_box *textbox = kolibri_new_edit_box(20, 40, 40, &editbox_interlock); - edit_box *textbox2 = kolibri_new_edit_box(20, 60, 30, &editbox_interlock); - kolibri_button *button = kolibri_new_button(310, 40, 24, 14, 0x21, kolibri_color_table.color_work_button); - frame *fr = kolibri_new_frame(X_Y(12, 350), X_Y(15, 70), 0x00FCFCFC, 0x00DCDCDC, "Frame Title", 0, kolibri_color_table.color_work_text, kolibri_color_table.color_work_area); + edit_box *textbox = kolibri_new_edit_box(20, 30, 40, &editbox_interlock); + edit_box *textbox2 = kolibri_new_edit_box(20, 50, 30, &editbox_interlock); + kolibri_button *button = kolibri_new_button(310, 30, 24, 14, 0x21, kolibri_color_table.color_work_button); + frame *fr = kolibri_new_frame(X_Y(12, 350), X_Y(5, 70), 0x00FCFCFC, 0x00DCDCDC, "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, textbox2); diff --git a/contrib/C_Layer/EXAMPLE/libguic_kolibri/option_menu.c b/contrib/C_Layer/EXAMPLE/libguic_kolibri/option_menu.c index 5b531afc80..773ebccc66 100644 --- a/contrib/C_Layer/EXAMPLE/libguic_kolibri/option_menu.c +++ b/contrib/C_Layer/EXAMPLE/libguic_kolibri/option_menu.c @@ -68,26 +68,26 @@ int main() // creating GUI using library functions - kolibri_window *main_window = kolibri_new_window(50, 50, 400, 160, "OptionBox and Menu demo"); + kolibri_window *main_window = kolibri_new_window(50, 40, 400, 160, "OptionBox and Menu demo"); //check_box *checkbox = kolibri_new_check_box(20, 45, 12, 12, "Append BOARDMSG to entered message."); option_box opts1[3]; option_box *option1sel = opts1; // intially selected RED - option_box *op1_1 = gui_optionbox(opts1, X_Y(20, 60), "G1 Item RED", &option1sel); - option_box *op1_2 = gui_optionbox(opts1+1, X_Y(20, 80), "G1 Item GREEN", &option1sel); - option_box *op1_3 = gui_optionbox(opts1+2, X_Y(20, 100), "G1 Item BLUE", &option1sel); + option_box *op1_1 = gui_optionbox(opts1, X_Y(20, 50), "G1 Item RED", &option1sel); + option_box *op1_2 = gui_optionbox(opts1+1, X_Y(20, 70), "G1 Item GREEN", &option1sel); + option_box *op1_3 = gui_optionbox(opts1+2, X_Y(20, 90), "G1 Item BLUE", &option1sel); option_box* option_group1[] = {op1_1, op1_2, op1_3, NULL}; option_box opts2[3]; option_box *option2sel = opts2 + 1; // intially selected #2 - option_box *op2_1 = gui_optionbox(&opts2[0], X_Y(140, 60), "G2 Item 1st", &option2sel); - option_box *op2_2 = gui_optionbox(&opts2[1], X_Y(140, 80), "G2 Item 2nd", &option2sel); - option_box *op2_3 = gui_optionbox(&opts2[2], X_Y(140, 100), "G2 Item 3rd", &option2sel); + option_box *op2_1 = gui_optionbox(&opts2[0], X_Y(140, 50), "G2 Item 1st", &option2sel); + option_box *op2_2 = gui_optionbox(&opts2[1], X_Y(140, 70), "G2 Item 2nd", &option2sel); + option_box *op2_3 = gui_optionbox(&opts2[2], X_Y(140, 90), "G2 Item 3rd", &option2sel); option_box* option_group2[] = {op2_1, op2_2, op2_3, NULL}; - frame *fr1 = kolibri_new_frame_def(X_Y(12, 110), X_Y(50, 70), "Option 1"); - frame *fr2 = kolibri_new_frame_def(X_Y(132, 100), X_Y(50, 70), "Option 2"); + frame *fr1 = kolibri_new_frame_def(X_Y(12, 110), X_Y(40, 70), "Option 1"); + frame *fr2 = kolibri_new_frame_def(X_Y(132, 100), X_Y(40, 70), "Option 2"); gui_add_optiongroup(main_window, option_group1); // new syntax gui_add_optiongroup(main_window, option_group2); @@ -98,15 +98,15 @@ int main() int option_index2 = 0; char *menu1stru[] = {"Menu1", "Set RED", "Set GREEN", "Set BLUE", NULL}; - menubar* menu1 = kolibri_new_menubar_def(X_Y(10, 40), X_Y(25, 15), 80, 100, menu1stru); + menubar* menu1 = kolibri_new_menubar_def(X_Y(10, 40), X_Y(5, 15), 80, 100, menu1stru); gui_add_menubar(main_window, menu1); char *menu2stru[] = {"mEnu2", "Set Option 1", "Set Option 2", "Set Option 3", NULL}; - menubar* menu2 = kolibri_new_menubar_def(X_Y(50, 40), X_Y(25, 15), 80, 100, menu2stru); + menubar* menu2 = kolibri_new_menubar_def(X_Y(50, 40), X_Y(5, 15), 80, 100, menu2stru); gui_add_menubar(main_window, menu2); char *menu3stru[] = {"Quit", NULL}; - menubar* menu3 = kolibri_new_menubar_def(X_Y(90, 40), X_Y(25, 15), 0, 0, menu3stru); + menubar* menu3 = kolibri_new_menubar_def(X_Y(90, 40), X_Y(5, 15), 0, 0, menu3stru); menu3->type = 1; // no subitems gui_add_menubar(main_window, menu3); diff --git a/contrib/C_Layer/EXAMPLE/libguic_kolibri/scroll_progress.c b/contrib/C_Layer/EXAMPLE/libguic_kolibri/scroll_progress.c index 45a4c90e6f..7fbb277736 100644 --- a/contrib/C_Layer/EXAMPLE/libguic_kolibri/scroll_progress.c +++ b/contrib/C_Layer/EXAMPLE/libguic_kolibri/scroll_progress.c @@ -87,13 +87,13 @@ int main() int valuechange = 0; // creating GUI using library functions - kolibri_window *main_window = kolibri_new_window(50, 50, 400, 400, "Scrollbar and progressbar showcase"); - statictext *txt = kolibri_new_statictext_def(X_Y(10,30), "StaticText default 6x9. Use Arrows or PgUp/PgDn"); - statictext *txt2 = kolibri_new_statictext(X_Y(10,40), "StaticText 8x16 x2:", CP866, 1, kolibri_color_table.color_work_text, 0); - staticnum *num = kolibri_new_staticnum_def(X_Y(10 + (strlen("StaticText 8x16 x2:") + 2) * 8 * 2, 40), 3, value); - scrollbar *sbh = kolibri_new_scrollbar(X_Y(30, 300), X_Y(370, 15), 15, 100, 10, value, kolibri_color_table.color_work_area, kolibri_color_table.color_work_button, 0); - scrollbar *sbv = kolibri_new_scrollbar(X_Y(370, 15), X_Y(50, 300), 15, 100, 10, value, kolibri_color_table.color_work_area, kolibri_color_table.color_work_button, 0); - progressbar *pg = kolibri_new_progressbar(0, 100, value, 10, 80, 200, 20); + kolibri_window *main_window = kolibri_new_window(50, 40, 400, 400, "Scrollbar and progressbar showcase"); + statictext *txt = kolibri_new_statictext_def(X_Y(10, 20), "StaticText default 6x9. Use Arrows or PgUp/PgDn"); + statictext *txt2 = kolibri_new_statictext(X_Y(10, 30), "StaticText 8x16 x2:", CP866, 1, kolibri_color_table.color_work_text, 0); + staticnum *num = kolibri_new_staticnum_def(X_Y(10 + (strlen("StaticText 8x16 x2:") + 2) * 8 * 2, 30), 3, value); + scrollbar *sbh = kolibri_new_scrollbar(X_Y(30, 300), X_Y(370, 5), 15, 100, 10, value, kolibri_color_table.color_work_area, kolibri_color_table.color_work_button, 0); + scrollbar *sbv = kolibri_new_scrollbar(X_Y(370, 15), X_Y(40, 300), 15, 100, 10, value, kolibri_color_table.color_work_area, kolibri_color_table.color_work_button, 0); + progressbar *pg = kolibri_new_progressbar(0, 100, value, 10, 70, 200, 20); kolibri_window_add_element(main_window, KOLIBRI_STATICTEXT, txt); kolibri_window_add_element(main_window, KOLIBRI_STATICTEXT, txt2);