diff options
| author | Dusan Durech <dusan.d@Centrum.sk> | 2009-07-15 20:36:23 +0200 |
|---|---|---|
| committer | Dusan Durech <dusan.d@Centrum.sk> | 2009-07-15 20:36:23 +0200 |
| commit | d0c088655af27e2e66b164c061e48a5f5bd28f05 (patch) | |
| tree | 59bb7dd44ff5bed456e84c4195fd4c1bd1aff130 /src/widget/widget_choicegroup.c | |
| parent | dd094a1c6598648c013ae1483c303eea34fc3bbe (diff) | |
add new API for mouse and fix bug with crash upon load session
Diffstat (limited to 'src/widget/widget_choicegroup.c')
| -rw-r--r-- | src/widget/widget_choicegroup.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/widget/widget_choicegroup.c b/src/widget/widget_choicegroup.c index ee3894e..d325d1b 100644 --- a/src/widget/widget_choicegroup.c +++ b/src/widget/widget_choicegroup.c @@ -4,6 +4,7 @@ #include "main.h" #include "interface.h" #include "image.h" +#include "mouse_buffer.h" #include "widget.h" #include "widget_choicegroup.h" @@ -30,7 +31,6 @@ void choice_group_draw(widget_t *widget) { widget_choicegroup_t *p; static image_t *g_choicegroup = NULL; - int x, y; int offset; assert(widget != NULL); @@ -38,8 +38,6 @@ void choice_group_draw(widget_t *widget) p = (widget_choicegroup_t *) widget->private_data; - interface_get_mouse_position(&x, &y); - if (g_choicegroup == NULL) { g_choicegroup = image_add("choice.png", IMAGE_ALPHA, "choicegroup", IMAGE_GROUP_BASE); } @@ -107,7 +105,6 @@ void choiceGroup_set_status(widget_t *widget, bool_t status) void choice_group_event(widget_t *widget) { widget_choicegroup_t *p; - int x, y; assert(widget != NULL); assert(widget->type == WIDGET_TYPE_CHOICE); @@ -119,11 +116,7 @@ void choice_group_event(widget_t *widget) return; } - interface_get_mouse_position(&x, &y); - - if (x >= widget->x && x <= widget->x + WIDGET_CHOICEGROUP_WIDTH && - y >= widget->y && y <= widget->y + WIDGET_CHOICEGROUP_HEIGHT && - interface_is_mouse_clicket()) { + if (mouse_buffer_is_on_area(widget->x, widget->y, WIDGET_CHOICEGROUP_WIDTH, WIDGET_CHOICEGROUP_HEIGHT, MOUSE_BUF_CLICK)) { choice_group_set_active(widget); } } |