diff options
| author | bernard.xiong <[email protected]> | 2010-01-04 00:05:01 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2010-01-04 00:05:01 +0000 |
| commit | 5950b02b04255dda8e5f9c6bd67f94e803a18fd6 (patch) | |
| tree | 3e0195c85346b8a6f6d30d6b8e90535c06c05643 /rtgui/widgets/button.c | |
| parent | 238b6b89ea489668b7c7c872e99354575318e400 (diff) | |
add more optimization options, remove caret implementation.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@278 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'rtgui/widgets/button.c')
| -rw-r--r-- | rtgui/widgets/button.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/rtgui/widgets/button.c b/rtgui/widgets/button.c index 1a563f0dbb..e7c84581cd 100644 --- a/rtgui/widgets/button.c +++ b/rtgui/widgets/button.c @@ -75,8 +75,11 @@ rt_bool_t rtgui_button_event_handler(struct rtgui_widget* widget, struct rtgui_e switch (event->type) { case RTGUI_EVENT_PAINT: +#ifndef RTGUI_USING_SMALL_SIZE if (widget->on_draw != RT_NULL ) widget->on_draw(widget, event); - else rtgui_theme_draw_button(btn); + else +#endif + rtgui_theme_draw_button(btn); break; case RTGUI_EVENT_MOUSE_BUTTON: @@ -94,13 +97,18 @@ rt_bool_t rtgui_button_event_handler(struct rtgui_widget* widget, struct rtgui_e btn->flag |= RTGUI_BUTTON_FLAG_PRESS; /* draw button */ +#ifndef RTGUI_USING_SMALL_SIZE if (widget->on_draw != RT_NULL ) widget->on_draw(widget, event); - else rtgui_theme_draw_button(btn); + else +#endif + rtgui_theme_draw_button(btn); +#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); +#endif } } else @@ -118,13 +126,18 @@ rt_bool_t rtgui_button_event_handler(struct rtgui_widget* widget, struct rtgui_e } /* draw button */ +#ifndef RTGUI_USING_SMALL_SIZE if (widget->on_draw != RT_NULL ) widget->on_draw(widget, event); - else rtgui_theme_draw_button(btn); + else +#endif + rtgui_theme_draw_button(btn); +#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); +#endif } } |
