diff options
| author | [email protected] <[email protected]> | 2012-04-20 06:47:38 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2012-04-20 06:47:38 +0000 |
| commit | df8bebdc553975b4afc0be738755b62d8573a00f (patch) | |
| tree | 07aeaaa78a2ed20939d1d24711b43651d3798816 /components/rtgui/widgets | |
| parent | b05e37893abe3d41be343d04ad5c9f9681c938e4 (diff) | |
fix compiling warnings and errors ifndef RTGUI_USING_SMALL_SIZE
Thank lgnq for pointing out it.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2096 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/rtgui/widgets')
| -rw-r--r-- | components/rtgui/widgets/button.c | 10 | ||||
| -rw-r--r-- | components/rtgui/widgets/checkbox.c | 6 | ||||
| -rw-r--r-- | components/rtgui/widgets/combobox.c | 7 | ||||
| -rw-r--r-- | components/rtgui/widgets/iconbox.c | 7 | ||||
| -rw-r--r-- | components/rtgui/widgets/radiobox.c | 9 | ||||
| -rw-r--r-- | components/rtgui/widgets/scrollbar.c | 5 | ||||
| -rw-r--r-- | components/rtgui/widgets/slider.c | 9 | ||||
| -rw-r--r-- | components/rtgui/widgets/staticline.c | 3 | ||||
| -rw-r--r-- | components/rtgui/widgets/textbox.c | 13 |
9 files changed, 39 insertions, 30 deletions
diff --git a/components/rtgui/widgets/button.c b/components/rtgui/widgets/button.c index a10d04ebbf..aab1333b56 100644 --- a/components/rtgui/widgets/button.c +++ b/components/rtgui/widgets/button.c @@ -95,7 +95,7 @@ rt_bool_t rtgui_button_event_handler(struct rtgui_object* object, struct rtgui_e if ((btn->flag & RTGUI_BUTTON_FLAG_PRESS) && (btn->on_button != RT_NULL)) { /* call on button handler */ - btn->on_button(widget, event); + btn->on_button(RTGUI_OBJECT(widget), event); } } } @@ -137,14 +137,14 @@ rt_bool_t rtgui_button_event_handler(struct rtgui_object* object, struct rtgui_e if (btn->on_button != RT_NULL) { /* call on button handler */ - btn->on_button(widget, event); + btn->on_button(RTGUI_OBJECT(widget), event); } #ifndef RTGUI_USING_SMALL_SIZE /* invokes call back */ if (widget->on_mouseclick != RT_NULL && emouse->button & RTGUI_MOUSE_BUTTON_UP) - return widget->on_mouseclick(widget, event); + return widget->on_mouseclick(RTGUI_OBJECT(widget), event); #endif } } @@ -175,13 +175,13 @@ rt_bool_t rtgui_button_event_handler(struct rtgui_object* object, struct rtgui_e /* invokes call back */ if (widget->on_mouseclick != RT_NULL && emouse->button & RTGUI_MOUSE_BUTTON_UP) - return widget->on_mouseclick(widget, event); + return widget->on_mouseclick(RTGUI_OBJECT(widget), event); #endif if (!(btn->flag & RTGUI_BUTTON_FLAG_PRESS) && (btn->on_button != RT_NULL)) { /* call on button handler */ - btn->on_button(widget, event); + btn->on_button(RTGUI_OBJECT(widget), event); } } diff --git a/components/rtgui/widgets/checkbox.c b/components/rtgui/widgets/checkbox.c index 78c3cd97c8..6a682903d0 100644 --- a/components/rtgui/widgets/checkbox.c +++ b/components/rtgui/widgets/checkbox.c @@ -46,7 +46,7 @@ rt_bool_t rtgui_checkbox_event_handler(struct rtgui_object* object, struct rtgui #ifndef RTGUI_USING_SMALL_SIZE if (widget->on_draw != RT_NULL) { - return widget->on_draw(widget, event); + return widget->on_draw(RTGUI_OBJECT(widget), event); } else #endif @@ -83,12 +83,12 @@ rt_bool_t rtgui_checkbox_event_handler(struct rtgui_object* object, struct rtgui /* call user callback */ if (widget->on_mouseclick != RT_NULL) { - return widget->on_mouseclick(widget, event); + return widget->on_mouseclick(RTGUI_OBJECT(widget), event); } #endif if (box->on_button != RT_NULL) { - box->on_button(widget, event); + box->on_button(RTGUI_OBJECT(widget), event); return RT_TRUE; } } diff --git a/components/rtgui/widgets/combobox.c b/components/rtgui/widgets/combobox.c index 282a975f08..5b3010677c 100644 --- a/components/rtgui/widgets/combobox.c +++ b/components/rtgui/widgets/combobox.c @@ -194,9 +194,7 @@ static rt_bool_t rtgui_combobox_onmouse_button(struct rtgui_combobox* box, struc rt_bool_t rtgui_combobox_event_handler(struct rtgui_object* object, struct rtgui_event* event) { struct rtgui_combobox *box; - - RT_ASSERT(object != RT_NULL); - RT_ASSERT(event != RT_NULL); + RTGUI_WIDGET_EVENT_HANDLER_PREPARE box = RTGUI_COMBOBOX(object); @@ -204,7 +202,8 @@ rt_bool_t rtgui_combobox_event_handler(struct rtgui_object* object, struct rtgui { case RTGUI_EVENT_PAINT: #ifndef RTGUI_USING_SMALL_SIZE - if (widget->on_draw != RT_NULL) widget->on_draw(widget, event); + if (widget->on_draw != RT_NULL) + widget->on_draw(RTGUI_OBJECT(widget), event); else #endif rtgui_combobox_ondraw(box); diff --git a/components/rtgui/widgets/iconbox.c b/components/rtgui/widgets/iconbox.c index 1ba74e3ce2..03db07bd83 100644 --- a/components/rtgui/widgets/iconbox.c +++ b/components/rtgui/widgets/iconbox.c @@ -49,9 +49,7 @@ DEFINE_CLASS_TYPE(iconbox, "iconbox", rt_bool_t rtgui_iconbox_event_handler(struct rtgui_object* object, struct rtgui_event* event) { struct rtgui_iconbox* iconbox; - - RT_ASSERT(object != RT_NULL); - RT_ASSERT(event != RT_NULL); + RTGUI_WIDGET_EVENT_HANDLER_PREPARE iconbox = RTGUI_ICONBOX(object); @@ -59,7 +57,8 @@ rt_bool_t rtgui_iconbox_event_handler(struct rtgui_object* object, struct rtgui_ { case RTGUI_EVENT_PAINT: #ifndef RTGUI_USING_SMALL_SIZE - if (widget->on_draw != RT_NULL) widget->on_draw(widget, event); + if (widget->on_draw != RT_NULL) + widget->on_draw(RTGUI_OBJECT(widget), event); else #endif { diff --git a/components/rtgui/widgets/radiobox.c b/components/rtgui/widgets/radiobox.c index b886c584c4..b1def7af01 100644 --- a/components/rtgui/widgets/radiobox.c +++ b/components/rtgui/widgets/radiobox.c @@ -86,7 +86,8 @@ rt_bool_t rtgui_radiobox_event_handler(struct rtgui_object* object, struct rtgui { case RTGUI_EVENT_PAINT: #ifndef RTGUI_USING_SMALL_SIZE - if (widget->on_draw != RT_NULL) widget->on_draw(widget, event); + if (widget->on_draw != RT_NULL) + widget->on_draw(RTGUI_OBJECT(widget), event); else #endif { @@ -99,7 +100,8 @@ rt_bool_t rtgui_radiobox_event_handler(struct rtgui_object* object, struct rtgui if (RTGUI_WIDGET_IS_HIDE(RTGUI_WIDGET(radiobox))) return RT_FALSE; #ifndef RTGUI_USING_SMALL_SIZE - if (widget->on_key != RT_NULL) widget->on_key(widget, event); + if (widget->on_key != RT_NULL) + widget->on_key(RTGUI_OBJECT(widget), event); else #endif { @@ -140,7 +142,8 @@ rt_bool_t rtgui_radiobox_event_handler(struct rtgui_object* object, struct rtgui case RTGUI_EVENT_MOUSE_BUTTON: #ifndef RTGUI_USING_SMALL_SIZE - if (widget->on_mouseclick != RT_NULL) widget->on_mouseclick(widget, event); + if (widget->on_mouseclick != RT_NULL) + widget->on_mouseclick(RTGUI_OBJECT(widget), event); else #endif { diff --git a/components/rtgui/widgets/scrollbar.c b/components/rtgui/widgets/scrollbar.c index 58a3017b3c..257591a028 100644 --- a/components/rtgui/widgets/scrollbar.c +++ b/components/rtgui/widgets/scrollbar.c @@ -274,7 +274,8 @@ rt_bool_t rtgui_scrollbar_event_handler(struct rtgui_object *object, { case RTGUI_EVENT_PAINT: #ifndef RTGUI_USING_SMALL_SIZE - if (widget->on_draw != RT_NULL) widget->on_draw(widget, event); + if (widget->on_draw != RT_NULL) + widget->on_draw(RTGUI_OBJECT(widget), event); else #endif { @@ -289,7 +290,7 @@ rt_bool_t rtgui_scrollbar_event_handler(struct rtgui_object *object, #ifndef RTGUI_USING_SMALL_SIZE if (widget->on_mouseclick != RT_NULL) { - widget->on_mouseclick(widget, event); + widget->on_mouseclick(RTGUI_OBJECT(widget), event); } else #endif diff --git a/components/rtgui/widgets/slider.c b/components/rtgui/widgets/slider.c index 30d29d84f9..ca71fdfaad 100644 --- a/components/rtgui/widgets/slider.c +++ b/components/rtgui/widgets/slider.c @@ -153,7 +153,8 @@ rt_bool_t rtgui_slider_event_handler(struct rtgui_object *object, struct rtgui_e { case RTGUI_EVENT_PAINT: #ifndef RTGUI_USING_SMALL_SIZE - if (widget->on_draw != RT_NULL) widget->on_draw(widget, event); + if (widget->on_draw != RT_NULL) + widget->on_draw(RTGUI_OBJECT(widget), event); else #endif { @@ -166,7 +167,8 @@ rt_bool_t rtgui_slider_event_handler(struct rtgui_object *object, struct rtgui_e if (!RTGUI_WIDGET_IS_ENABLE(widget) || RTGUI_WIDGET_IS_HIDE(widget)) return RT_FALSE; #ifndef RTGUI_USING_SMALL_SIZE - if (widget->on_key != RT_NULL) widget->on_key(widget, event); + if (widget->on_key != RT_NULL) + widget->on_key(RTGUI_OBJECT(widget), event); else #endif { @@ -178,7 +180,8 @@ rt_bool_t rtgui_slider_event_handler(struct rtgui_object *object, struct rtgui_e if (!RTGUI_WIDGET_IS_ENABLE(widget) || RTGUI_WIDGET_IS_HIDE(widget)) return RT_FALSE; #ifndef RTGUI_USING_SMALL_SIZE - if (widget->on_mouseclick != RT_NULL) widget->on_mouseclick(widget, event); + if (widget->on_mouseclick != RT_NULL) + widget->on_mouseclick(RTGUI_OBJECT(widget), event); else #endif { diff --git a/components/rtgui/widgets/staticline.c b/components/rtgui/widgets/staticline.c index 19a1caed49..10bdd8bad8 100644 --- a/components/rtgui/widgets/staticline.c +++ b/components/rtgui/widgets/staticline.c @@ -30,7 +30,8 @@ rt_bool_t rtgui_staticline_event_handler(struct rtgui_object* object, struct rtg { case RTGUI_EVENT_PAINT: #ifndef RTGUI_USING_SMALL_SIZE - if (widget->on_draw != RT_NULL) widget->on_draw(widget, event); + if (widget->on_draw != RT_NULL) + widget->on_draw(RTGUI_OBJECT(widget), event); else #endif rtgui_theme_draw_staticline(staticline); diff --git a/components/rtgui/widgets/textbox.c b/components/rtgui/widgets/textbox.c index 15f2bd44ef..a28b3ec5f9 100644 --- a/components/rtgui/widgets/textbox.c +++ b/components/rtgui/widgets/textbox.c @@ -264,8 +264,9 @@ rt_bool_t rtgui_textbox_event_handler(struct rtgui_object* object, struct rtgui_ { case RTGUI_EVENT_PAINT: #ifndef RTGUI_USING_SMALL_SIZE - if (widget->on_draw != RT_NULL) widget->on_draw(widget, event); - else + if (widget->on_draw != RT_NULL) + widget->on_draw(RTGUI_OBJECT(widget), event); + else #endif rtgui_theme_draw_textbox(box); break; @@ -274,8 +275,9 @@ rt_bool_t rtgui_textbox_event_handler(struct rtgui_object* object, struct rtgui_ if (!RTGUI_WIDGET_IS_ENABLE(widget) || RTGUI_WIDGET_IS_HIDE(widget)) return RT_FALSE; #ifndef RTGUI_USING_SMALL_SIZE - if (widget->on_mouseclick != RT_NULL) widget->on_mouseclick(widget, event); - else + if (widget->on_mouseclick != RT_NULL) + widget->on_mouseclick(RTGUI_OBJECT(widget), event); + else #endif rtgui_textbox_onmouse(box, (struct rtgui_event_mouse*)event); return RT_TRUE; @@ -284,7 +286,8 @@ rt_bool_t rtgui_textbox_event_handler(struct rtgui_object* object, struct rtgui_ if (!RTGUI_WIDGET_IS_ENABLE(widget) || RTGUI_WIDGET_IS_HIDE(widget)) return RT_FALSE; #ifndef RTGUI_USING_SMALL_SIZE - if (widget->on_key != RT_NULL) widget->on_key(widget, event); + if (widget->on_key != RT_NULL) + widget->on_key(RTGUI_OBJECT(widget), event); else #endif rtgui_textbox_onkey(box, (struct rtgui_event_kbd*)event); |
