summaryrefslogtreecommitdiff
path: root/src/widget/widget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/widget/widget.c')
-rw-r--r--src/widget/widget.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/widget/widget.c b/src/widget/widget.c
index 4e4143e..57c247b 100644
--- a/src/widget/widget.c
+++ b/src/widget/widget.c
@@ -5,6 +5,15 @@
#include "widget.h"
#include "widget_label.h"
+#include "widget_button.h"
+#include "widget_buttonimage.h"
+#include "widget_textfield.h"
+#include "widget_catchkey.h"
+#include "widget_check.h"
+#include "widget_choicegroup.h"
+#include "widget_image.h"
+#include "widget_select.h"
+#include "widget_statusbar.h"
widget_t *widget_new(int type, int x, int y, int w, int h, void *private_data)
{
@@ -55,6 +64,40 @@ void widget_set_size(widget_t *p, int *w, int *h)
}
}
+void widget_draw(widget_t *p)
+{
+ switch (p->type)
+ {
+ case WIDGET_TYPE_LABEL: label_draw(p); break;
+ case WIDGET_TYPE_BUTTON: button_draw(p); break;
+ case WIDGET_TYPE_BUTTONIMAGE: button_image_draw(p); break;
+ case WIDGET_TYPE_TEXTFILED: text_field_draw(p); break;
+ case WIDGET_TYPE_CATCHKEY: catch_key_draw(p); break;
+ case WIDGET_TYPE_CHECK: check_draw(p); break;
+ case WIDGET_TYPE_CHOICE: choice_group_draw(p); break;
+ case WIDGET_TYPE_IMAGE: wid_image_draw(p); break;
+ case WIDGET_TYPE_SELECT: select_draw(p); break;
+ case WIDGET_TYPE_STATUSBAR: statusbar_draw(p); break;
+ }
+}
+
+void widget_event(widget_t *p)
+{
+ switch (p->type)
+ {
+ case WIDGET_TYPE_LABEL: label_event(p); break;
+ case WIDGET_TYPE_BUTTON: button_event(p); break;
+ case WIDGET_TYPE_BUTTONIMAGE: button_image_event(p); break;
+ case WIDGET_TYPE_TEXTFILED: text_field_event(p); break;
+ case WIDGET_TYPE_CATCHKEY: catch_key_event(p); break;
+ case WIDGET_TYPE_CHECK: check_event(p); break;
+ case WIDGET_TYPE_CHOICE: choice_group_event(p); break;
+ case WIDGET_TYPE_IMAGE: wid_image_event(p); break;
+ case WIDGET_TYPE_SELECT: select_event(p); break;
+ case WIDGET_TYPE_STATUSBAR: statusbar_event(p); break;
+ }
+}
+
void widget_destroy(widget_t *p)
{
free(p);