summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-05-02 12:26:19 +0000
committerbernard.xiong <[email protected]>2010-05-02 12:26:19 +0000
commit16f7ea2f957efcd4afe7ccf62e128362ad3867ec (patch)
tree7ae56a8223705348a3004ee1cecbfa9281d8e824 /components
parent030b39fad45adf285e9d4fb39bb6002210635afd (diff)
update according to 0.3.1
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@686 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components')
-rw-r--r--components/rtgui/server/server.c16
-rw-r--r--components/rtgui/widgets/window.c7
2 files changed, 17 insertions, 6 deletions
diff --git a/components/rtgui/server/server.c b/components/rtgui/server/server.c
index 2d4b5c317b..beea4a9718 100644
--- a/components/rtgui/server/server.c
+++ b/components/rtgui/server/server.c
@@ -456,12 +456,18 @@ void rtgui_server_handle_kbd(struct rtgui_event_kbd* event)
panel = rtgui_server_focus_panel;
if (panel != RT_NULL)
{
- /* send to focus panel */
- event->wid = RT_NULL;
+ rt_thread_t tid;
- /* send keyboard event to thread */
- rtgui_thread_send(rtgui_panel_get_active_thread(panel),
- (struct rtgui_event*)event, sizeof(struct rtgui_event_kbd));
+ /* get active thread in this panel */
+ tid = rtgui_panel_get_active_thread(panel);
+ if (tid != RT_NULL)
+ {
+ /* send to focus panel */
+ event->wid = RT_NULL;
+
+ /* send keyboard event to thread */
+ rtgui_thread_send(tid, (struct rtgui_event*)event, sizeof(struct rtgui_event_kbd));
+ }
}
}
diff --git a/components/rtgui/widgets/window.c b/components/rtgui/widgets/window.c
index 268c9c50c4..b11690fbae 100644
--- a/components/rtgui/widgets/window.c
+++ b/components/rtgui/widgets/window.c
@@ -156,6 +156,11 @@ void rtgui_win_destroy(struct rtgui_win* win)
}
}
+void rtgui_win_close(struct rtgui_win* win)
+{
+ win->style |= RTGUI_WIN_STYLE_CLOSED;
+}
+
rtgui_modal_code_t rtgui_win_show(struct rtgui_win* win, rt_bool_t is_modal)
{
rtgui_modal_code_t result;
@@ -416,7 +421,7 @@ rt_bool_t rtgui_win_event_handler(struct rtgui_widget* widget, struct rtgui_even
if (widget->on_draw != RT_NULL) widget->on_draw(widget, event);
else
#endif
- rtgui_win_ondraw(win);
+ rtgui_widget_update(RTGUI_WIDGET(win));
if (win->on_activate != RT_NULL)
{