From 864ee5f167d1e2dda9bfce24ef617d71ce49bfd8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 7 Dec 2021 20:20:27 +0100 Subject: scrollview --- src/mgui/widget.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/mgui/widget.c') diff --git a/src/mgui/widget.c b/src/mgui/widget.c index 63bc97b..e9c8425 100644 --- a/src/mgui/widget.c +++ b/src/mgui/widget.c @@ -1,5 +1,6 @@ #include "../../include/mgui/widget.h" #include "../../include/mgui/list.h" +#include "../../include/mgui/scrollview.h" #include "../../include/mgui/button.h" #include "../../include/mgui/label.h" #include "../../include/mgui/image.h" @@ -23,6 +24,9 @@ void mgui_widget_set_position(mgui_widget *self, mgl_vec2i position) { case MGUI_WIDGET_LIST: mgui_list_set_position(mgui_widget_to_list(self), position); break; + case MGUI_WIDGET_SCROLLVIEW: + mgui_scrollview_set_position(mgui_widget_to_scrollview(self), position); + break; case MGUI_WIDGET_BUTTON: mgui_button_set_position(mgui_widget_to_button(self), position); break; @@ -40,6 +44,9 @@ void mgui_widget_set_width(mgui_widget *self, int width) { case MGUI_WIDGET_LIST: mgui_list_set_width(mgui_widget_to_list(self), width); break; + case MGUI_WIDGET_SCROLLVIEW: + mgui_scrollview_set_width(mgui_widget_to_scrollview(self), width); + break; case MGUI_WIDGET_BUTTON: mgui_button_set_width(mgui_widget_to_button(self), width); break; @@ -57,6 +64,9 @@ void mgui_widget_on_event(mgui_widget *self, mgl_window *window, mgl_event *even case MGUI_WIDGET_LIST: mgui_list_on_event(mgui_widget_to_list(self), window, event); break; + case MGUI_WIDGET_SCROLLVIEW: + mgui_scrollview_on_event(mgui_widget_to_scrollview(self), window, event); + break; case MGUI_WIDGET_BUTTON: mgui_button_on_event(mgui_widget_to_button(self), window, event); break; @@ -73,6 +83,8 @@ mgl_vec2i mgui_widget_draw(mgui_widget *self, mgl_window *window) { switch(self->type) { case MGUI_WIDGET_LIST: return mgui_list_draw(mgui_widget_to_list(self), window); + case MGUI_WIDGET_SCROLLVIEW: + return mgui_scrollview_draw(mgui_widget_to_scrollview(self), window); case MGUI_WIDGET_BUTTON: return mgui_button_draw(mgui_widget_to_button(self), window); case MGUI_WIDGET_LABEL: -- cgit v1.2.3