diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-12-07 20:20:27 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-12-07 20:20:27 +0100 |
commit | 864ee5f167d1e2dda9bfce24ef617d71ce49bfd8 (patch) | |
tree | 14c3bfe2d9b28dce43be9efae8e18156de7787fc /src/mgui/widget.c | |
parent | d3a5b3d579e30ce02afd5e270dfdd511af195c31 (diff) |
scrollview
Diffstat (limited to 'src/mgui/widget.c')
-rw-r--r-- | src/mgui/widget.c | 12 |
1 files changed, 12 insertions, 0 deletions
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: |