From 2bf31463b7fb1649d89a9d948dc9adf56ebc8d81 Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Tue, 12 Dec 2017 13:25:12 +0100 Subject: Successful test of initializing and beta printing of the group_buttons that held window --- test/gui/group.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/gui/group.c (limited to 'test/gui/group.c') diff --git a/test/gui/group.c b/test/gui/group.c new file mode 100644 index 0000000..e3d25f3 --- /dev/null +++ b/test/gui/group.c @@ -0,0 +1,18 @@ +#include +#include +#include "MLV/MLV_all.h" + + +static void test_group() { + Window window; + window_init(&window, 1000, 512, "Coucou"); + window_create(&window); + window.group_buttons->component.print_method(window.group_pictureframe); + MLV_wait_seconds(5); + window_free(&window); +} + +int main() { + test_group(); + return 0; +} \ No newline at end of file -- cgit v1.2.3 From 92c999f56a86f221e6d3dc2182b5b7f7e0e08231 Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Fri, 22 Dec 2017 19:15:56 +0100 Subject: Successful test for the group management and button handling. Buttons are placed in the right spots thanks to group position handling --- test/gui/group.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'test/gui/group.c') diff --git a/test/gui/group.c b/test/gui/group.c index e3d25f3..555c246 100644 --- a/test/gui/group.c +++ b/test/gui/group.c @@ -7,9 +7,30 @@ static void test_group() { Window window; window_init(&window, 1000, 512, "Coucou"); window_create(&window); - window.group_buttons->component.print_method(window.group_pictureframe); - MLV_wait_seconds(5); - window_free(&window); + + Button button1; + Button button2; + Button button3; + + button_init(&button1, "OK", 10, 500, 256, button_click_test); + button_init(&button2,"Bouton magique",10, 500,290, NULL); + button_init(&button3,"Très lonnggggg boooouttttooooon",10,0,0,button_click_test); + + window_add_button(&window,&button1); + window_add_button(&window,&button2); + window_add_button(&window,&button3); + + window_print_buttons(&window); + int mouse_x; + int mouse_y; + while(1){ + if (MLV_get_mouse_button_state(MLV_BUTTON_LEFT) == MLV_PRESSED) { + MLV_get_mouse_position(&mouse_x, &mouse_y); + group_click_handler(mouse_x,mouse_y,&(window.group_buttons->component)); + } + } + /*MLV_wait_seconds(15); + window_free(&window);*/ } int main() { -- cgit v1.2.3 From ee98053ef83869033713c8c7d6d487457d6443d8 Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Wed, 27 Dec 2017 17:16:20 +0100 Subject: Implementing the locking system to disable components --- test/gui/group.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/gui/group.c') diff --git a/test/gui/group.c b/test/gui/group.c index 555c246..99a567e 100644 --- a/test/gui/group.c +++ b/test/gui/group.c @@ -13,7 +13,7 @@ static void test_group() { Button button3; button_init(&button1, "OK", 10, 500, 256, button_click_test); - button_init(&button2,"Bouton magique",10, 500,290, NULL); + button_init(&button2,"Bouton magique",10, 500,290, button_click_test); button_init(&button3,"Très lonnggggg boooouttttooooon",10,0,0,button_click_test); window_add_button(&window,&button1); -- cgit v1.2.3 From aaf57e5ee1e0cf74afdbdf56293f1afd7e79e6b0 Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Thu, 28 Dec 2017 16:22:43 +0100 Subject: Reworking signatures of pictureframe function, beginning of implementation, debug tests --- test/gui/group.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/gui/group.c') diff --git a/test/gui/group.c b/test/gui/group.c index 99a567e..5ec9194 100644 --- a/test/gui/group.c +++ b/test/gui/group.c @@ -4,7 +4,7 @@ static void test_group() { - Window window; + /*Window window; window_init(&window, 1000, 512, "Coucou"); window_create(&window); -- cgit v1.2.3 From 9ed3c28a0335137d34e51d5fd49be6e523f65a89 Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Thu, 28 Dec 2017 22:52:28 +0100 Subject: Implementing the add constraint feature, need to be fixed --- test/gui/group.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/gui/group.c') diff --git a/test/gui/group.c b/test/gui/group.c index 5ec9194..7dbf80c 100644 --- a/test/gui/group.c +++ b/test/gui/group.c @@ -29,7 +29,7 @@ static void test_group() { group_click_handler(mouse_x,mouse_y,&(window.group_buttons->component)); } } - /*MLV_wait_seconds(15); + MLV_wait_seconds(15); window_free(&window);*/ } -- cgit v1.2.3