diff options
| author | [email protected] <[email protected]> | 2012-09-20 08:13:23 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2012-09-20 08:13:23 +0000 |
| commit | bcc6ffac9ece24f8db625c4e2a1e48fbc8258087 (patch) | |
| tree | eb9b67f2dbd0bf83bb4730d4740b6aedcdd6eab3 /components/rtgui/widgets | |
| parent | 2d6bb86360570605264ca50c9801cf09a8ef9a32 (diff) | |
sync RTGUI with github(https://github.com/RT-Thread/RTGUI) 9573987ab967d6823151f967e4715a995579c8e5
As always, full log is in GitHub.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2301 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/rtgui/widgets')
| -rw-r--r-- | components/rtgui/widgets/label.c | 13 | ||||
| -rw-r--r-- | components/rtgui/widgets/window.c | 14 |
2 files changed, 8 insertions, 19 deletions
diff --git a/components/rtgui/widgets/label.c b/components/rtgui/widgets/label.c index 44e838bab9..cc2c2aeecb 100644 --- a/components/rtgui/widgets/label.c +++ b/components/rtgui/widgets/label.c @@ -103,14 +103,17 @@ void rtgui_label_set_text(rtgui_label_t* label, const char* text) if (label->text != RT_NULL) { /* it's a same text string */ - if (rt_strncmp(text, label->text, rt_strlen(text)) == 0) return; - + if (rt_strcmp(text, label->text) == 0) + return; + /* release old text memory */ - rtgui_free(label->text); + rt_free(label->text); } - if (text != RT_NULL) label->text = (char*)rt_strdup((const char*)text); - else label->text = RT_NULL; + if (text != RT_NULL) + label->text = (char*)rt_strdup((const char*)text); + else + label->text = RT_NULL; /* update widget */ rtgui_theme_draw_label(label); diff --git a/components/rtgui/widgets/window.c b/components/rtgui/widgets/window.c index cedf475640..c562ec2fba 100644 --- a/components/rtgui/widgets/window.c +++ b/components/rtgui/widgets/window.c @@ -493,13 +493,6 @@ rt_bool_t rtgui_win_event_handler(struct rtgui_object* object, struct rtgui_even } win->flag |= RTGUI_WIN_FLAG_ACTIVATE; -#ifndef RTGUI_USING_SMALL_SIZE - if (RTGUI_WIDGET(object)->on_draw != RT_NULL) - RTGUI_WIDGET(object)->on_draw(object, event); - else -#endif - rtgui_widget_update(RTGUI_WIDGET(win)); - if (win->on_activate != RT_NULL) { win->on_activate(RTGUI_OBJECT(object), event); @@ -522,13 +515,6 @@ rt_bool_t rtgui_win_event_handler(struct rtgui_object* object, struct rtgui_even else { win->flag &= ~RTGUI_WIN_FLAG_ACTIVATE; -#ifndef RTGUI_USING_SMALL_SIZE - if (RTGUI_WIDGET(object)->on_draw != RT_NULL) - RTGUI_WIDGET(object)->on_draw(object, event); - else -#endif - rtgui_widget_update(RTGUI_WIDGET(win)); - if (win->on_deactivate != RT_NULL) { win->on_deactivate(RTGUI_OBJECT(object), event); |
