summaryrefslogtreecommitdiff
path: root/components/rtgui_win/include/rtgui/widgets
diff options
context:
space:
mode:
author[email protected] <[email protected]>2011-03-24 14:00:19 +0000
committer[email protected] <[email protected]>2011-03-24 14:00:19 +0000
commit0e93e6809c7beac4597148edc1dc09bcdf9a2ab3 (patch)
tree113765e7f8351d84226a3de04f13daf86ddd82f9 /components/rtgui_win/include/rtgui/widgets
parent96c53b49571adadd957df804f4f5e6698c14e3b3 (diff)
add rtgui_win subfield,Highlight the ease of use
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1345 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/rtgui_win/include/rtgui/widgets')
-rw-r--r--components/rtgui_win/include/rtgui/widgets/button.h84
-rw-r--r--components/rtgui_win/include/rtgui/widgets/checkbox.h35
-rw-r--r--components/rtgui_win/include/rtgui/widgets/combobox.h62
-rw-r--r--components/rtgui_win/include/rtgui/widgets/container.h50
-rw-r--r--components/rtgui_win/include/rtgui/widgets/dialog.h32
-rw-r--r--components/rtgui_win/include/rtgui/widgets/filelist_view.h60
-rw-r--r--components/rtgui_win/include/rtgui/widgets/iconbox.h58
-rw-r--r--components/rtgui_win/include/rtgui/widgets/label.h48
-rw-r--r--components/rtgui_win/include/rtgui/widgets/list_view.h76
-rw-r--r--components/rtgui_win/include/rtgui/widgets/listbox.h75
-rw-r--r--components/rtgui_win/include/rtgui/widgets/menu.h106
-rw-r--r--components/rtgui_win/include/rtgui/widgets/progressbar.h40
-rw-r--r--components/rtgui_win/include/rtgui/widgets/radiobox.h42
-rw-r--r--components/rtgui_win/include/rtgui/widgets/scrollbar.h92
-rw-r--r--components/rtgui_win/include/rtgui/widgets/slider.h40
-rw-r--r--components/rtgui_win/include/rtgui/widgets/staticline.h32
-rw-r--r--components/rtgui_win/include/rtgui/widgets/textbox.h78
-rw-r--r--components/rtgui_win/include/rtgui/widgets/view.h62
-rw-r--r--components/rtgui_win/include/rtgui/widgets/widget.h168
-rw-r--r--components/rtgui_win/include/rtgui/widgets/window.h130
20 files changed, 1370 insertions, 0 deletions
diff --git a/components/rtgui_win/include/rtgui/widgets/button.h b/components/rtgui_win/include/rtgui/widgets/button.h
new file mode 100644
index 0000000000..a0fa703168
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/button.h
@@ -0,0 +1,84 @@
+/*
+ * File : button.h
+ * This file is part of RT-Thread RTOS
+ * COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rt-thread.org/license/LICENSE
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2009-10-16 Bernard first version
+ */
+#ifndef __RTGUI_BUTTON_H__
+#define __RTGUI_BUTTON_H__
+
+#include <rtgui/image.h>
+#include <rtgui/widgets/widget.h>
+#include <rtgui/widgets/label.h>
+#include <rtgui/kbddef.h>
+#include <rtgui/color.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup rtgui_button_t
+ * @{
+ */
+
+/** Gets the type of a button */
+#define RTGUI_BUTTON_TYPE (rtgui_button_type_get())
+/** Casts the object to an rtgui_button_t */
+#define RTGUI_BUTTON(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_BUTTON_TYPE, rtgui_button_t))
+/** Checks if the object is an rtgui_button_t */
+#define RTGUI_IS_BUTTON(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_BUTTON_TYPE))
+
+#define RTGUI_BUTTON_FLAG_PRESS 0x01
+#define RTGUI_BUTTON_FLAG_DEFAULT 0x02
+
+#define RTGUI_BUTTON_TYPE_NORMAL 0x00
+#define RTGUI_BUTTON_TYPE_PUSH 0x10
+
+/*
+ * the button widget
+ */
+struct rtgui_button
+{
+ /* inherit from label */
+ rtgui_label_t parent;
+
+ /* button flag */
+ rt_uint32_t flag;
+
+ /* pressed and unpressed image */
+ rtgui_image_t *image;
+
+ /* click button event handler */
+ void (*on_button)(PVOID wdt, rtgui_event_t *event);
+};
+typedef struct rtgui_button rtgui_button_t;
+typedef void (*rtgui_onbutton_func_t)(PVOID wdt, rtgui_event_t *event);
+
+rtgui_type_t *rtgui_button_type_get(void);
+
+rtgui_button_t* rtgui_button_create(PVOID parent,char* text,int left,int top,int w,int h);
+void rtgui_button_destroy(rtgui_button_t* btn);
+
+void rtgui_button_set_image(rtgui_button_t* btn, rtgui_image_t* image);
+
+void rtgui_button_set_onbutton(rtgui_button_t* btn, rtgui_onbutton_func_t func);
+
+rt_bool_t rtgui_button_event_handler(PVOID wdt, rtgui_event_t* event);
+
+void rtgui_button_set_text(rtgui_button_t* button, const char* text);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/rtgui_win/include/rtgui/widgets/checkbox.h b/components/rtgui_win/include/rtgui/widgets/checkbox.h
new file mode 100644
index 0000000000..fed9c6cbd8
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/checkbox.h
@@ -0,0 +1,35 @@
+#ifndef __RTGUI_CHECKBOX_H__
+#define __RTGUI_CHECKBOX_H__
+
+#include <rtgui/rtgui.h>
+
+
+#define RTGUI_CHECKBOX_TYPE (rtgui_checkbox_type_get())
+#define RTGUI_CHECKBOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_CHECKBOX_TYPE, rtgui_checkbox_t))
+#define RTGUI_IS_CHECKBOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_CHECKBOX_TYPE))
+
+//#define RTGUI_CHECKBOX_STATUS_CHECKED 1
+//#define RTGUI_CHECKBOX_STATUS_UNCHECKED 0
+
+struct rtgui_checkbox
+{
+ /* inherit from label */
+ rtgui_label_t parent;
+
+ /* check box status */
+ int value;
+};
+typedef struct rtgui_checkbox rtgui_checkbox_t;
+
+rtgui_type_t *rtgui_checkbox_type_get(void);
+
+rtgui_checkbox_t* rtgui_checkbox_create(PVOID wdt,const char* text, rt_bool_t checked,rtgui_color_t fc,int left,int top);
+void rtgui_checkbox_destroy(rtgui_checkbox_t* checkbox);
+
+void rtgui_checkbox_set_checked(rtgui_checkbox_t* checkbox, rt_bool_t checked);
+rt_bool_t rtgui_checkbox_get_checked(rtgui_checkbox_t* checkbox);
+
+rt_bool_t rtgui_checkbox_event_handler(PVOID wdt, rtgui_event_t* event);
+void rtgui_checkbox_set_text(rtgui_checkbox_t *box, const char* text);
+
+#endif
diff --git a/components/rtgui_win/include/rtgui/widgets/combobox.h b/components/rtgui_win/include/rtgui/widgets/combobox.h
new file mode 100644
index 0000000000..3da90e1389
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/combobox.h
@@ -0,0 +1,62 @@
+#ifndef __RTGUI_COMBO_H__
+#define __RTGUI_COMBO_H__
+
+#include <rtgui/rtgui.h>
+#include <rtgui/rtgui_system.h>
+#include <rtgui/widgets/widget.h>
+#include <rtgui/widgets/textbox.h>
+#include <rtgui/widgets/button.h>
+#include <rtgui/widgets/view.h>
+#include <rtgui/widgets/listbox.h>
+
+#define RTGUI_COMBOBOX_HEIGHT 24
+#define RTGUI_COMBOBOX_BUTTON_WIDTH 16
+
+#define RTGUI_COMBO_STYLE_DOWNARROW_UP 0x01
+#define RTGUI_COMBO_STYLE_DOWNARROW_DOWN 0x02
+
+typedef struct rtgui_combo rtgui_combo_t;
+
+/** Gets the type of a textbox */
+#define RTGUI_COMBOBOX_TYPE (rtgui_combo_type_get())
+/** Casts the object to a rtgui_textbox_t */
+#define RTGUI_COMBOBOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_COMBOBOX_TYPE, rtgui_combo_t))
+/** Checks if the object is a rtgui_textbox_t */
+#define RTGUI_IS_COMBOBOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_COMBOBOX_TYPE))
+
+typedef struct rtgui_combo_item
+{
+ char *name;
+}rtgui_combo_item_t;
+
+struct rtgui_combo
+{
+ rtgui_container_t parent;
+
+ /* widget private data */
+ rt_uint32_t style;
+
+ rtgui_textbox_t *tbox;
+ rtgui_listbox_t *lbox;
+
+ /* call back */
+ void (*on_selected) (PVOID wdt, rtgui_event_t* event);
+ rt_uint32_t (*get_count)(rtgui_combo_t* box);
+ void (*add_string)(rtgui_combo_t* box,char* string);
+};
+
+
+rtgui_type_t *rtgui_combo_type_get(void);
+rtgui_combo_t* rtgui_combo_create(PVOID parent,const char* text,int left,int top,int w,int h);
+void rtgui_combo_destroy(rtgui_combo_t* cbo);
+
+void rtgui_combo_set_onitem(rtgui_combo_t* cbo, rtgui_event_handler_ptr func);
+rt_bool_t rtgui_combo_event_handler(PVOID wdt, rtgui_event_t* event);
+rt_bool_t rtgui_combo_onitem(PVOID wdt, rtgui_event_t* event);
+void rtgui_combo_set_items(rtgui_combo_t* cbo, rtgui_listbox_item_t* items, rt_uint32_t count);
+
+rt_uint32_t rtgui_combo_get_select(rtgui_combo_t* cbo);
+char* rtgui_combo_get_string(rtgui_combo_t* cbo);
+
+#endif
+
diff --git a/components/rtgui_win/include/rtgui/widgets/container.h b/components/rtgui_win/include/rtgui/widgets/container.h
new file mode 100644
index 0000000000..abf90af16b
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/container.h
@@ -0,0 +1,50 @@
+/*
+ * File : box.h
+ * This file is part of RT-Thread RTOS
+ * COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rt-thread.org/license/LICENSE
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2009-10-16 Bernard first version
+ */
+#ifndef __RTGUI_BOX_H__
+#define __RTGUI_BOX_H__
+
+#include <rtgui/widgets/widget.h>
+#include <rtgui/event.h>
+
+/** Gets the type of a box */
+#define RTGUI_CONTAINER_TYPE (rtgui_container_type_get())
+/** Casts the object to a rtgui_container_t */
+#define RTGUI_CONTAINER(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_CONTAINER_TYPE, rtgui_container_t))
+/** Checks if the object is a rtgui_container_t */
+#define RTGUI_IS_CONTAINER(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_CONTAINER_TYPE))
+
+struct rtgui_container
+{
+ /* inherit from widget */
+ rtgui_widget_t parent;
+
+ rtgui_widget_t *focused;
+ rtgui_list_t children;
+};
+typedef struct rtgui_container rtgui_container_t;
+
+rtgui_type_t *rtgui_container_type_get(void);
+
+void rtgui_container_add_child(PVOID cbox, PVOID wdt);
+void rtgui_container_remove_child(rtgui_container_t *box, PVOID wdt);
+void rtgui_container_destroy_children(rtgui_container_t *box);
+rtgui_widget_t* rtgui_container_get_first_child(rtgui_container_t* box);
+
+rt_bool_t rtgui_container_event_handler(PVOID wdt, rtgui_event_t* event);
+
+rt_bool_t rtgui_container_dispatch_event(rtgui_container_t *box, rtgui_event_t* event);
+rt_bool_t rtgui_container_dispatch_mouse_event(rtgui_container_t *box, rtgui_event_mouse_t* event);
+
+
+#endif
diff --git a/components/rtgui_win/include/rtgui/widgets/dialog.h b/components/rtgui_win/include/rtgui/widgets/dialog.h
new file mode 100644
index 0000000000..7790aff028
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/dialog.h
@@ -0,0 +1,32 @@
+#ifndef __DIALOG_H__
+#define __DIALOG_H__
+
+/* �򿪶Ի����е�һЩ���� */
+struct OpenDlgSt
+{
+ char* path; //����·��
+ char* filename; //�ļ�(��)����
+ rt_uint32_t size;//�ļ���С/�ļ����µ��ļ�����
+ rt_uint32_t type;//�ļ�����:�ļ�/�ļ���
+ char* pattern; //�����;
+
+ rtgui_filelist_view_t* fview;
+ rtgui_textbox_t* tbox_path; //�ؼ�ָ��
+ rtgui_textbox_t* tbox_filename;
+ rtgui_combo_t* cbox_pattern;
+};
+
+
+rtgui_win_t* rtgui_win_get_win_by_widget(PVOID wdt);
+void OpenFileDialog(PVOID wdt, rtgui_event_t* event);
+void NewFileDialog(PVOID wdt, rtgui_event_t *event);
+void SaveFileDialog(PVOID wdt, rtgui_event_t *event);
+
+void GoToTopFolder(PVOID wdt, rtgui_event_t *event);
+void GoToSubFolder(PVOID wdt, rtgui_event_t *event);
+
+
+
+
+#endif
+
diff --git a/components/rtgui_win/include/rtgui/widgets/filelist_view.h b/components/rtgui_win/include/rtgui/widgets/filelist_view.h
new file mode 100644
index 0000000000..d669f064b1
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/filelist_view.h
@@ -0,0 +1,60 @@
+#ifndef __RTGUI_FILELIST_VIEW_H__
+#define __RTGUI_FILELIST_VIEW_H__
+
+#include <rtgui/widgets/view.h>
+#include <rtgui/widgets/scrollbar.h>
+#include <rtgui/kbddef.h>
+#include <rtgui/color.h>
+
+#define RTGUI_FITEM_FILE 0x0
+#define RTGUI_FITEM_DIR 0x1
+
+
+typedef struct rtgui_fileview rtgui_filelist_view_t;
+
+/** Gets the type of a filelist view */
+#define RTGUI_FILELIST_VIEW_TYPE (rtgui_filelist_view_type_get())
+/** Casts the object to a filelist */
+#define RTGUI_FILELIST_VIEW(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_FILELIST_VIEW_TYPE, rtgui_filelist_view_t))
+/** Checks if the object is a filelist view */
+#define RTGUI_IS_FILELIST_VIEW(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_FILELIST_VIEW_TYPE))
+
+
+typedef struct rtgui_file_item
+{
+ char* name;
+ rt_uint32_t type;
+ rt_uint32_t size;
+}rtgui_filelist_view_item_t;
+
+struct rtgui_fileview
+{
+ rtgui_container_t parent;
+
+ /* widget private data */
+ char* current_dir; //��ǰ�ļ���current_dir
+ char* pattern; //���������
+
+ rt_int16_t item_per_page; //ÿҳ����ʾ����
+ rt_int16_t item_count; //������
+
+ rt_int16_t frist_aloc;/* frist item */
+ rt_int16_t now_aloc; /* now item */
+ rt_int16_t old_aloc; /* old item */
+
+ rtgui_scrollbar_t *sbar; //����
+
+ rtgui_filelist_view_item_t *items; /* items array */
+};
+
+rtgui_type_t *rtgui_filelist_view_type_get(void);
+
+rtgui_filelist_view_t* rtgui_filelist_view_create(PVOID parent, const char* directory, const char* pattern, int left, int top, int w, int h);
+void rtgui_filelist_view_destroy(rtgui_filelist_view_t* view);
+
+rt_bool_t rtgui_filelist_view_event_handler(PVOID wdt, rtgui_event_t* event);
+void rtgui_filelist_view_set_directory(rtgui_filelist_view_t* view, const char* directory);
+void rtgui_filelist_view_on_enter(rtgui_filelist_view_t* fview);
+void rtgui_filelist_view_get_fullpath(rtgui_filelist_view_t* view, char* path, rt_size_t len);
+
+#endif
diff --git a/components/rtgui_win/include/rtgui/widgets/iconbox.h b/components/rtgui_win/include/rtgui/widgets/iconbox.h
new file mode 100644
index 0000000000..ef82d58a7a
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/iconbox.h
@@ -0,0 +1,58 @@
+/*
+ * File : iconbox.h
+ * This file is part of RT-Thread RTOS
+ * COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rt-thread.org/license/LICENSE
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2009-10-16 Bernard first version
+ */
+#ifndef __RTGUI_ICONBOX_H__
+#define __RTGUI_ICONBOX_H__
+
+#include <rtgui/rtgui.h>
+#include <topwin.h>
+#include <rtgui/image.h>
+#include <rtgui/font.h>
+#include <rtgui/widgets/widget.h>
+
+/** Gets the type of a iconbox */
+#define RTGUI_ICONBOX_TYPE (rtgui_iconbox_type_get())
+/** Casts the object to a rtgui_iconbox_t */
+#define RTGUI_ICONBOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_ICONBOX_TYPE, rtgui_iconbox_t))
+/** Checks if the object is a rtgui_iconbox_t */
+#define RTGUI_IS_ICONBOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_ICONBOX_TYPE))
+
+#define RTGUI_ICONBOX_NOTEXT 0x00
+#define RTGUI_ICONBOX_TEXT_RIGHT 0x01
+#define RTGUI_ICONBOX_TEXT_BELOW 0x02
+
+#define RTGUI_ICONBOX_AREA 76
+
+struct rtgui_iconbox
+{
+ rtgui_widget_t parent; /* inherit from widget */
+
+ rtgui_image_t* image; /* widget private data */
+ char *text;
+ void (*call)(void);
+ rt_uint32_t text_position;
+
+ rt_bool_t selected;
+};
+typedef struct rtgui_iconbox rtgui_iconbox_t;
+
+rtgui_type_t *rtgui_iconbox_type_get(void);
+
+rtgui_iconbox_t* rtgui_iconbox_create(PVOID parent, rtgui_image_t* image, const char* text, int position);
+void rtgui_iconbox_destroy(rtgui_iconbox_t* iconbox);
+
+rt_bool_t rtgui_iconbox_event_handler(PVOID wdt, rtgui_event_t* event);
+
+void rtgui_iconbox_set_text_position(rtgui_iconbox_t* iconbox, int position);
+
+#endif
diff --git a/components/rtgui_win/include/rtgui/widgets/label.h b/components/rtgui_win/include/rtgui/widgets/label.h
new file mode 100644
index 0000000000..ddc447edc3
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/label.h
@@ -0,0 +1,48 @@
+/*
+ * File : label.h
+ * This file is part of RT-Thread RTOS
+ * COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rt-thread.org/license/LICENSE
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2009-10-16 Bernard first version
+ */
+#ifndef __RTGUI_LABEL_H__
+#define __RTGUI_LABEL_H__
+
+#include <rtgui/rtgui.h>
+#include <rtgui/widgets/widget.h>
+
+/** Gets the type of a button */
+#define RTGUI_LABEL_TYPE (rtgui_label_type_get())
+/** Casts the object to an rtgui_label_t */
+#define RTGUI_LABEL(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_LABEL_TYPE, rtgui_label_t))
+/** Checks if the object is an rtgui_label_t */
+#define RTGUI_IS_LABEL(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_LABEL_TYPE))
+
+/*
+ * the label widget
+ */
+struct rtgui_label
+{
+ rtgui_widget_t parent;
+ /* label */
+ char* text;
+};
+typedef struct rtgui_label rtgui_label_t;
+
+rtgui_type_t *rtgui_label_type_get(void);
+
+rtgui_label_t* rtgui_label_create(PVOID wdt, const char* text, int left, int top, int w, int h);
+void rtgui_label_destroy(rtgui_label_t* label);
+
+rt_bool_t rtgui_label_event_handler(PVOID wdt, rtgui_event_t* event);
+
+void rtgui_label_set_text(rtgui_label_t* label, const char* text);
+char* rtgui_label_get_text(rtgui_label_t* label);
+
+#endif
diff --git a/components/rtgui_win/include/rtgui/widgets/list_view.h b/components/rtgui_win/include/rtgui/widgets/list_view.h
new file mode 100644
index 0000000000..2af23061b3
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/list_view.h
@@ -0,0 +1,76 @@
+/*
+ * File : list_view.h
+ * This file is part of RTGUI in RT-Thread RTOS
+ * COPYRIGHT (C) 2010, RT-Thread Development Team
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rt-thread.org/license/LICENSE
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2010-01-06 Bernard first version
+ */
+
+#ifndef __RTGUI_LIST_VIEW_H__
+#define __RTGUI_LIST_VIEW_H__
+
+#include <rtgui/rtgui.h>
+#include <rtgui/kbddef.h>
+#include <rtgui/color.h>
+#include <rtgui/event.h>
+#include <rtgui/widgets/view.h>
+
+typedef void (*item_action)(void* parameter);
+typedef struct rtgui_list_item rtgui_list_view_item_t;
+struct rtgui_list_item
+{
+ char* name;
+ rtgui_image_t *image;
+ item_action action;
+ void *parameter;
+};
+
+/** Gets the type of a list view */
+#define RTGUI_LIST_VIEW_TYPE (rtgui_list_view_type_get())
+/** Casts the object to a rtgui_list_view_t */
+#define RTGUI_LIST_VIEW(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_LIST_VIEW_TYPE, rtgui_list_view_t))
+/** Checks if the object is a rtgui_list_view_t */
+#define RTGUI_IS_LIST_VIEW(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_LIST_VIEW_TYPE))
+
+#define RTGUI_LIST_VIEW_LIST 0x00
+#define RTGUI_LIST_VIEW_ICON 0x01
+#define RTGUI_LIST_VIEW_REPORT 0x02
+
+struct rtgui_list_view
+{
+ rtgui_view_t parent;
+
+ /* widget private data */
+ /* list item */
+ const rtgui_list_view_item_t* items;
+
+ /* layout flag */
+ rt_uint16_t flag;
+
+ /* total number of items */
+ rt_uint16_t item_count;
+ /* the number of item in a page */
+ rt_uint16_t page;
+ /* current item */
+ rt_int16_t item_current;
+
+ /* icon layout */
+ rt_uint32_t row_items, col_items;
+};
+typedef struct rtgui_list_view rtgui_list_view_t;
+
+rtgui_type_t *rtgui_list_view_type_get(void);
+
+rtgui_list_view_t* rtgui_list_view_create(PVOID parent,const rtgui_list_view_item_t* items, rt_uint16_t count, int left,int top,int w,int h, rt_uint16_t flag);
+void rtgui_list_view_destroy(rtgui_list_view_t* view);
+
+rt_bool_t rtgui_list_view_event_handler(PVOID wdt, rtgui_event_t* event);
+
+#endif
+
diff --git a/components/rtgui_win/include/rtgui/widgets/listbox.h b/components/rtgui_win/include/rtgui/widgets/listbox.h
new file mode 100644
index 0000000000..3b86eef281
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/listbox.h
@@ -0,0 +1,75 @@
+/*
+ * File : listbox.h
+ * This file is part of RTGUI in RT-Thread RTOS
+ * COPYRIGHT (C) 2010, RT-Thread Development Team
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rt-thread.org/license/LICENSE
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2010-01-06 Bernard first version
+ */
+
+#ifndef __RTGUI_LISTBOX_H__
+#define __RTGUI_LISTBOX_H__
+
+#include <rtgui/rtgui.h>
+#include <rtgui/kbddef.h>
+#include <rtgui/color.h>
+#include <rtgui/image.h>
+
+struct rtgui_listbox_item
+{
+ char *name;
+ rtgui_image_t *image;
+};
+typedef struct rtgui_listbox_item rtgui_listbox_item_t;
+/** Gets the type of a list box */
+#define RTGUI_LISTBOX_TYPE (rtgui_listbox_type_get())
+/** Casts the object to a filelist */
+#define RTGUI_LISTBOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_LISTBOX_TYPE, rtgui_listbox_t))
+/** Checks if the object is a filelist box */
+#define RTGUI_IS_LISTBOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_LISTBOX_TYPE))
+
+typedef struct rtgui_listbox rtgui_listbox_t;
+
+struct rtgui_listbox
+{
+ rtgui_container_t parent;
+
+ /* widget private data */
+ rt_int16_t item_per_page; /* the number of item in a page */
+ rt_int16_t item_count; /* total number of items */
+ rt_int16_t item_size; /* item size */
+ rt_int16_t frist_aloc; /* frist item */
+ rt_int16_t now_aloc; /* now item */
+ rt_int16_t old_aloc; /* old item */
+ rt_bool_t ispopup; /* �ǵ��������б� */
+ PVOID widgetlnk; /* ���ӵĿؼ� */
+ rtgui_scrollbar_t *sbar;
+ rtgui_listbox_item_t *items; /* items array */
+
+ /* item event handler */
+ rt_bool_t (*on_item)(PVOID wdt, rtgui_event_t* event);
+
+ rt_uint32_t (*get_count)(rtgui_listbox_t* box);
+ void (*add_item)(rtgui_listbox_t* box, rtgui_listbox_item_t* item);
+};
+
+
+rtgui_type_t *rtgui_listbox_type_get(void);
+
+rtgui_listbox_t* rtgui_listbox_create(PVOID wdt, int left,int top,int w,int h,rt_uint32_t style);
+void rtgui_listbox_destroy(rtgui_listbox_t* box);
+
+void rtgui_listbox_update(rtgui_listbox_t* box);
+rt_bool_t rtgui_listbox_event_handler(PVOID wdt, rtgui_event_t* event);
+void rtgui_listbox_set_onitem(rtgui_listbox_t* box, rtgui_event_handler_ptr func);
+void rtgui_listbox_set_items(rtgui_listbox_t* box, rtgui_listbox_item_t* items, rt_uint32_t count);
+
+void rtgui_listbox_delete_item(rtgui_listbox_t* box, rt_uint32_t item_num);
+
+#endif
+
diff --git a/components/rtgui_win/include/rtgui/widgets/menu.h b/components/rtgui_win/include/rtgui/widgets/menu.h
new file mode 100644
index 0000000000..591d8a682a
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/menu.h
@@ -0,0 +1,106 @@
+/*
+ * File : view.h
+ * This file is part of RT-Thread RTOS
+ * COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rt-thread.org/license/LICENSE
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2009-10-16 Bernard first version
+ */
+#ifndef __RTGUI_MENU_H__
+#define __RTGUI_MENU_H__
+
+#include <rtgui/rtgui.h>
+#include <rtgui/image.h>
+#include <rtgui/widgets/widget.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef int HMENU;
+
+#define RTGUI_MENU_HEIGHT 43 /*�˵���߶�*/
+#define RTGUI_MENU_BORDER 2
+
+#define RTGUI_MENU_IMAGE_W 24
+#define RTGUI_MENU_IMAGE_H 24
+
+#define ITEM (System,Name,ID) \
+rtgui_menu_append(hPopupMenu_##System, MF_ENABLED, ID, Name);
+
+/*�˵����־*/
+#define RTGUI_MENU_POPUP 0x00000080L
+
+typedef struct rtgui_menu_item rtgui_menu_item_t; //��ͨ�˵�
+typedef struct rtgui_menu rtgui_menu_t;//�˵�
+
+
+/** Gets the type of a view */
+#define RTGUI_MENU_TYPE (rtgui_menu_type_get())
+/** Casts the object to an rtgui_view_t */
+#define RTGUI_MENU(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_MENU_TYPE, rtgui_menu_t))
+/** Checks if the object is an rtgui_view_t */
+#define RTGUI_IS_MENU(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_MENU_TYPE))
+
+struct rtgui_menu
+{
+ rtgui_widget_t parent;
+ char* name;
+ /* ���ڸ�����ͼ�IJ���,��������ͼ,ȥ����Щ����û��Ӱ�� */
+ rt_uint32_t orient; /* ����� */
+ rt_uint32_t item_size; /* �˵���ߴ� */
+ rt_uint16_t item_count; /* �˵����� */
+
+ rtgui_menu_item_t* current_item; /* ��ǰ�IJ˵��� */
+ rtgui_menu_item_t* forego_item; /* ��һ���˵��� */
+
+ /*�¼��˵��� */
+ rtgui_menu_item_t* head; /*ͷ*/
+ rtgui_menu_item_t* tail; /*β*/
+ /*�ϼ��˵��� */
+ rtgui_menu_item_t* farther;
+};
+
+struct rtgui_menu_item
+{
+ char* caption; //�˵���
+ rt_uint32_t item_id;
+ rt_uint32_t type; //�˵��Ĵ�������
+ rt_uint32_t shortcut;
+ rt_bool_t bexit; //���øò˵����Ƿ��˳��˵�
+
+ rtgui_menu_item_t* next;
+ rtgui_menu_item_t* prev;
+
+ rtgui_image_t* image; //�󶨵�ͼ��
+ rtgui_menu_t* sub_menu; //�Ӳ˵�
+
+ void(*func_updown)(rtgui_menu_t *menu); //��UP/DOWN����֮�����еĺ���
+ void(*func_enter)(void); //��ȷ�Ϻ�ִ�еĺ���
+};
+
+rtgui_type_t *rtgui_menu_type_get(void);
+
+rtgui_menu_t* rtgui_menu_create(PVOID parent, const char* name);
+void rtgui_menu_destroy(rtgui_menu_t* menu);
+
+
+HMENU rtgui_menu_popup_create (void);
+rt_bool_t rtgui_menu_append(rtgui_menu_t *menu,rt_uint32_t flags,rt_uint32_t ID,char * caption);
+void rtgui_menu_popup_delete(rtgui_menu_t* menu);
+rtgui_menu_t* rtgui_menu_item_delete(rtgui_menu_t* menu,rtgui_menu_item_t* pItem);
+void rtgui_menu_on_down(rtgui_menu_t* menu);
+void rtgui_menu_on_up(rtgui_menu_t* menu);
+void rtgui_menu_on_exit(rtgui_menu_t* menu);
+void rtgui_menu_set_selected(rtgui_menu_t* menu, int selected);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/rtgui_win/include/rtgui/widgets/progressbar.h b/components/rtgui_win/include/rtgui/widgets/progressbar.h
new file mode 100644
index 0000000000..c2133a93dd
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/progressbar.h
@@ -0,0 +1,40 @@
+#ifndef __RTGUI_PROGRESSBAR_H__
+#define __RTGUI_PROGRESSBAR_H__
+
+#include <rtgui/rtgui.h>
+
+typedef struct rtgui_progressbar rtgui_progressbar_t;
+
+/** Gets the type of a progressbar */
+#define RTGUI_PROGRESSBAR_TYPE (rtgui_progressbar_type_get())
+/** Casts the object to a rtgui_progressbar */
+#define RTGUI_PROGRESSBAR(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_PROGRESSBAR_TYPE, rtgui_progressbar_t))
+/** Checks if the object is a rtgui_progressbar */
+#define RTGUI_IS_PROGRESSBAR(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_PROGRESSBAR_TYPE))
+
+#define DEFAULT_WIDTH 100
+#define DEFAULT_HEIGHT 20
+
+struct rtgui_progressbar
+{
+ rtgui_widget_t parent;
+
+ int orient;
+
+ int range;
+ int position;
+};
+
+rtgui_type_t *rtgui_progressbar_type_get(void);
+
+rtgui_progressbar_t* rtgui_progressbar_create(PVOID parent, int orient, int range, int left, int top, int w, int h);
+void rtgui_progressbar_destroy(rtgui_progressbar_t* p_bar);
+
+rt_bool_t rtgui_progressbar_event_handler(PVOID wdt, rtgui_event_t* event);
+
+void rtgui_progressbar_set_value(rtgui_progressbar_t *p_bar, int value);
+int rtgui_progressbar_get_value(rtgui_progressbar_t *p_bar);
+void rtgui_progressbar_set_range(rtgui_progressbar_t *p_bar, int range);
+int rtgui_progressbar_get_range(rtgui_progressbar_t *p_bar);
+
+#endif
diff --git a/components/rtgui_win/include/rtgui/widgets/radiobox.h b/components/rtgui_win/include/rtgui/widgets/radiobox.h
new file mode 100644
index 0000000000..3856c98bff
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/radiobox.h
@@ -0,0 +1,42 @@
+#ifndef __RTGUI_RADIOBOX_H__
+#define __RTGUI_RADIOBOX_H__
+
+#include <rtgui/rtgui.h>
+#include <rtgui/kbddef.h>
+#include <rtgui/widgets/container.h>
+
+/** Gets the type of a rbox */
+#define RTGUI_RADIOBOX_TYPE (rtgui_radiobox_type_get())
+/** Casts the object to an rtgui_radiobox_t */
+#define RTGUI_RADIOBOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_RADIOBOX_TYPE, rtgui_radiobox_t))
+/** Checks if the object is an rtgui_radiobox_t */
+#define RTGUI_IS_RADIOBOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_RADIOBOX_TYPE))
+
+struct rtgui_radiobox
+{
+ rtgui_container_t parent;
+
+ char* name;
+
+ rt_uint32_t orient;
+ rt_uint32_t item_count;
+ rt_bool_t item_sel;
+
+ char **items;
+};
+
+typedef struct rtgui_radiobox rtgui_radiobox_t;
+
+rtgui_type_t *rtgui_radiobox_type_get(void);
+
+rtgui_radiobox_t* rtgui_radiobox_create(PVOID parent, const char* name, int orient, char **items, int count,
+ int left, int top, int w, int h);
+void rtgui_radiobox_destroy(rtgui_radiobox_t* rbox);
+
+void rtgui_radiobox_set_selection(rtgui_radiobox_t* rbox, int selection);
+int rtgui_radiobox_get_selection(rtgui_radiobox_t* rbox);
+
+rt_bool_t rtgui_radiobox_event_handler(PVOID wdt, rtgui_event_t* event);
+
+#endif
+
diff --git a/components/rtgui_win/include/rtgui/widgets/scrollbar.h b/components/rtgui_win/include/rtgui/widgets/scrollbar.h
new file mode 100644
index 0000000000..934114e755
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/scrollbar.h
@@ -0,0 +1,92 @@
+/*
+ * File : scrollbar.h
+ * This file is part of RT-Thread RTOS
+ * COPYRIGHT (C) 2006 - 2010, RT-Thread Development Team
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rt-thread.org/license/LICENSE
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2010-08-09 Bernard first version
+ */
+#ifndef __RTGUI_SCROLLBAR_H__
+#define __RTGUI_SCROLLBAR_H__
+
+#include <rtgui/rtgui.h>
+#include <rtgui/widgets/widget.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Gets the type of a scrollbar */
+#define RTGUI_SCROLLBAR_TYPE (rtgui_scrollbar_type_get())
+/** Casts the object to an rtgui_scrollbar */
+#define RTGUI_SCROLLBAR(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_SCROLLBAR_TYPE, rtgui_scrollbar_t))
+/** Checks if the object is an rtgui_scrollbar */
+#define RTGUI_IS_SCROLLBAR(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_SCROLLBAR_TYPE))
+
+#define RTGUI_DEFAULT_SB_WIDTH 16
+
+/* scrollbar status/positions*/
+#define SBAR_UNKNOWN 0x0000
+#define SBAR_LEFTARROW 0x0001 //������ť��
+#define SBAR_RIGHTARROW 0x0002 //�����Ұ�ť��
+#define SBAR_LEFTSPACE 0x0004 //�ڻ�����հ״�
+#define SBAR_RIGHTSPACE 0x0008 //�ڻ���Ҳ�հ״�
+#define SBAR_HORZTHUMB 0x0010 //���ˮƽ����
+#define SBAR_UPARROW 0x0020 //״̬����
+#define SBAR_DOWNARROW 0x0040 //״̬����
+#define SBAR_UPSPACE 0x0080 //�ڻ���ϲ�հ״�
+#define SBAR_DOWNSPACE 0x0100 //�ڻ���²�հ״�
+#define SBAR_VERTTHUMB 0x0200 //��鴹ֱ����
+
+#define SBAR_UPTHUMB 0x0400 //������ϻ���
+#define SBAR_DOWNTHUMB 0x0800 //������»���
+#define SBAR_LEFTTHUMB 0x1000 //������󻬶�
+#define SBAR_RIGHTTHUMB 0x2000 //������һ���
+
+struct rtgui_scrollbar
+{
+ /* inherit from widget */
+ rtgui_widget_t parent;
+
+ rt_uint32_t orient;
+ rt_uint32_t status;
+
+ /* page_step = display lines of scrollbar */
+ /* thumb_len = line_step * page_step / (page_step - (button width * 2)) */
+ rt_int16_t line_step, page_step;
+ rt_int16_t value, thumb_len,thumb_w;
+ /* position 1:1 width of scrollbar */
+ rt_int16_t count;
+
+ PVOID widgetlnk;//���ӵĿؼ�
+ rt_bool_t (*on_scroll) (PVOID wdt, rtgui_event_t* event);
+};
+typedef struct rtgui_scrollbar rtgui_scrollbar_t;
+
+rtgui_type_t *rtgui_scrollbar_type_get(void);
+
+rtgui_scrollbar_t* rtgui_scrollbar_create(PVOID wdt,int left,int top,int w,int len,int orient);
+void rtgui_scrollbar_destroy(rtgui_scrollbar_t* bar);
+
+void rtgui_scrollbar_get_thumb_rect(rtgui_scrollbar_t *bar, rtgui_rect_t *erect);
+
+void rtgui_scrollbar_set_range(rtgui_scrollbar_t* bar, int count);
+void rtgui_scrollbar_set_value(rtgui_scrollbar_t* bar, rt_int16_t value);
+
+void rtgui_scrollbar_set_onscroll(rtgui_scrollbar_t* bar, rtgui_event_handler_ptr handler);
+void rtgui_scrollbar_set_orientation(rtgui_scrollbar_t* bar, int orient);
+void rtgui_scrollbar_set_page_step(rtgui_scrollbar_t* bar, int step);
+void rtgui_scrollbar_set_line_step(rtgui_scrollbar_t* bar, int step);
+
+rt_bool_t rtgui_scrollbar_event_handler(PVOID wdt, rtgui_event_t* event);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/rtgui_win/include/rtgui/widgets/slider.h b/components/rtgui_win/include/rtgui/widgets/slider.h
new file mode 100644
index 0000000000..b94ced24e4
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/slider.h
@@ -0,0 +1,40 @@
+#ifndef __RTGUI_SLIDER_H__
+#define __RTGUI_SLIDER_H__
+
+#include <rtgui/rtgui.h>
+#include <rtgui/kbddef.h>
+
+typedef struct rtgui_slider rtgui_slider_t;
+
+/** Gets the type of a slider */
+#define RTGUI_SLIDER_TYPE (rtgui_slider_type_get())
+/** Casts the object to an rtgui_slider */
+#define RTGUI_SLIDER(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_SLIDER_TYPE, rtgui_slider_t))
+/** Checks if the object is an rtgui_slider */
+#define RTGUI_IS_SLIDER(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_SLIDER_TYPE))
+
+struct rtgui_slider
+{
+ rtgui_widget_t parent;
+
+ /* widget private data */
+ rt_size_t min, max, value, ticks;
+ rt_size_t thumb_width;
+
+ int orient;
+};
+
+rtgui_type_t *rtgui_slider_type_get(void);
+
+rtgui_slider_t* rtgui_slider_create(PVOID parent, rt_size_t min, rt_size_t max, int left, int top, int w, int h, int orient);
+void rtgui_slider_destroy(rtgui_slider_t* slider);
+
+rt_bool_t rtgui_slider_event_handler(PVOID wdt, rtgui_event_t* event);
+
+void rtgui_slider_set_range(rtgui_slider_t* slider, rt_size_t min, rt_size_t max);
+void rtgui_slider_set_value(rtgui_slider_t* slider, rt_size_t value);
+void rtgui_slider_set_orientation(rtgui_slider_t* slider, int orient);
+
+rt_size_t rtgui_slider_get_value(rtgui_slider_t* slider);
+
+#endif
diff --git a/components/rtgui_win/include/rtgui/widgets/staticline.h b/components/rtgui_win/include/rtgui/widgets/staticline.h
new file mode 100644
index 0000000000..b63e6c25af
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/staticline.h
@@ -0,0 +1,32 @@
+#ifndef __RTGUI_STATICLINE__H__
+#define __RTGUI_STATICLINE__H__
+
+#include <rtgui/rtgui.h>
+
+/*
+ * the static line widget
+ */
+
+/** Gets the type of a sline */
+#define RTGUI_STATICLINE_TYPE (rtgui_staticline_type_get())
+/** Casts the object to an rtgui_staticline_t */
+#define RTGUI_STATICLINE(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_STATICLINE_TYPE, rtgui_staticline_t))
+/** Checks if the object is an rtgui_staticline_t */
+#define RTGUI_IS_STATICLINE(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_STATICLINE_TYPE))
+
+struct rtgui_staticline
+{
+ /* inherit from widget */
+ rtgui_widget_t parent;
+
+ int orient;
+};
+typedef struct rtgui_staticline rtgui_staticline_t;
+
+rtgui_staticline_t *rtgui_staticline_create(PVOID wdt,int left,int top,int w,int len,int orient);
+void rtgui_staticline_destroy(rtgui_staticline_t* sline);
+
+rt_bool_t rtgui_staticline_event_handler(PVOID wdt, rtgui_event_t* event);
+
+#endif
+
diff --git a/components/rtgui_win/include/rtgui/widgets/textbox.h b/components/rtgui_win/include/rtgui/widgets/textbox.h
new file mode 100644
index 0000000000..4638da48a1
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/textbox.h
@@ -0,0 +1,78 @@
+/*
+ * File : textbox.h
+ * This file is part of RT-Thread RTOS
+ * COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rt-thread.org/license/LICENSE
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2009-10-16 Bernard first version
+ */
+#ifndef __RTGUI_TEXTBOX_H__
+#define __RTGUI_TEXTBOX_H__
+
+#include <rtgui/rtgui.h>
+#include <rtgui/rtgui_system.h>
+
+/** Gets the type of a textbox */
+#define RTGUI_TEXTBOX_TYPE (rtgui_textbox_type_get())
+/** Casts the object to a rtgui_textbox_t */
+#define RTGUI_TEXTBOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_TEXTBOX_TYPE, rtgui_textbox_t))
+/** Checks if the object is a rtgui_textbox_t */
+#define RTGUI_IS_TEXTBOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_TEXTBOX_TYPE))
+
+#define RTGUI_TEXTBOX_DEFAULT_WIDTH 80
+#define RTGUI_TEXTBOX_DEFAULT_HEIGHT 20
+
+#define RTGUI_TEXTBOX_NONE 0x00
+#define RTGUI_TEXTBOX_MULTI 0x01 //����
+#define RTGUI_TEXTBOX_MASK 0x02 //����
+#define RTGUI_TEXTBOX_DIGIT 0x04 //������������
+#define RTGUI_TEXTBOX_CARET_SHOW 0x10
+#define RTGUI_TEXTBOX_CARET_STAT 0x20
+
+#define RTGUI_TEXTBOX_LINE_MAX 128 //���ij���
+
+struct rtgui_textbox
+{
+ /* inherit from widget */
+ rtgui_widget_t parent;
+
+ /* text box flag */
+ rt_uint32_t flag;
+ rt_uint32_t isedit;//�Ƿ�ɱ༭
+
+ /* current line and position */
+ rt_uint16_t line, line_begin, position, line_length;
+ rt_uint16_t dis_length; /*may be display length.*/
+ char* text;
+ rt_size_t font_width;
+
+ rtgui_timer_t* caret_timer;
+
+ /* widget private data */
+ rt_bool_t (*on_change)(PVOID wdt, rtgui_event_t* event);
+ rt_bool_t (*on_enter) (PVOID wdt, rtgui_event_t* event);
+};
+typedef struct rtgui_textbox rtgui_textbox_t;
+
+void _rtgui_textbox_constructor(rtgui_textbox_t *box);
+void _rtgui_textbox_deconstructor(rtgui_textbox_t *textbox);
+rtgui_type_t *rtgui_textbox_type_get(void);
+
+rtgui_textbox_t* rtgui_textbox_create(PVOID wdt,const char* text,int left,int top,int w,int h, rt_uint32_t flag);
+void rtgui_textbox_destroy(rtgui_textbox_t* box);
+
+rt_bool_t rtgui_textbox_event_handler(PVOID wdt, rtgui_event_t* event);
+
+void rtgui_textbox_set_value(rtgui_textbox_t* box, const char* text);
+const char* rtgui_textbox_get_value(rtgui_textbox_t* box);
+
+void rtgui_textbox_set_line_length(rtgui_textbox_t* box, rt_size_t length);
+
+void rtgui_textbox_get_edit_rect(rtgui_textbox_t *box,rtgui_rect_t *rect);
+
+#endif
diff --git a/components/rtgui_win/include/rtgui/widgets/view.h b/components/rtgui_win/include/rtgui/widgets/view.h
new file mode 100644
index 0000000000..f0639c3f45
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/view.h
@@ -0,0 +1,62 @@
+/*
+ * File : view.h
+ * This file is part of RT-Thread RTOS
+ * COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rt-thread.org/license/LICENSE
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2009-10-16 Bernard first version
+ */
+#ifndef __RTGUI_VIEW_H__
+#define __RTGUI_VIEW_H__
+
+#include <rtgui/widgets/container.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Gets the type of a view */
+#define RTGUI_VIEW_TYPE (rtgui_view_type_get())
+/** Casts the object to an rtgui_view_t */
+#define RTGUI_VIEW(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_VIEW_TYPE, rtgui_view_t))
+/** Checks if the object is an rtgui_view_t */
+#define RTGUI_IS_VIEW(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_VIEW_TYPE))
+
+/*
+ * the view widget
+ */
+struct rtgui_view
+{
+ /* inherit from box */
+ rtgui_container_t parent;
+
+ /* private field */
+ char* title;
+};
+typedef struct rtgui_view rtgui_view_t;
+
+rtgui_type_t *rtgui_view_type_get(void);
+
+rtgui_view_t *rtgui_view_create(PVOID wdt,const char* title,int left,int top,int w,int h);
+void rtgui_view_destroy(rtgui_view_t* view);
+
+rt_bool_t rtgui_view_event_handler(PVOID wdt, rtgui_event_t* event);
+
+rt_bool_t rtgui_view_show(rtgui_view_t* view);
+void rtgui_view_hide(rtgui_view_t* view);
+
+char* rtgui_view_get_title(rtgui_view_t* view);
+void rtgui_view_set_title(rtgui_view_t* view, const char* title);
+void rtgui_view_show_child(PVOID wdt,const char* name);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/rtgui_win/include/rtgui/widgets/widget.h b/components/rtgui_win/include/rtgui/widgets/widget.h
new file mode 100644
index 0000000000..1cddfd267b
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/widget.h
@@ -0,0 +1,168 @@
+/*
+ * File : widget.h
+ * This file is part of RTGUI in RT-Thread RTOS
+ * COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rt-thread.org/license/LICENSE
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2009-10-04 Bernard first version
+ */
+#ifndef __RTGUI_WIDGET_H__
+#define __RTGUI_WIDGET_H__
+
+#include <rtgui/rtgui.h>
+#include <rtgui/color.h>
+#include <rtgui/font.h>
+#include <rtgui/list.h>
+#include <rtgui/region.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct rtgui_widget rtgui_widget_t;
+
+/** Gets the type of a widget */
+#define RTGUI_WIDGET_TYPE (rtgui_widget_type_get())
+/** Casts the object to a rtgui_widget */
+#define RTGUI_WIDGET(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_WIDGET_TYPE, rtgui_widget_t))
+/** Check if the object is a rtgui_widget */
+#define RTGUI_IS_WIDGET(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_WIDGET_TYPE))
+
+/*
+ * the base widget object
+ */
+struct rtgui_widget
+{
+ rtgui_object_t object; /* inherit from rtgui_object_t */
+ rtgui_widget_t *parent, *toplevel; /* the parent and root widget */
+ rtgui_list_t sibling; /* the widget child and sibling */
+ rt_uint32_t flag; /* widget flag */
+
+ rt_uint32_t dc_type; /* hardware device context */
+ const struct rtgui_dc_engine* dc_engine;
+ rtgui_gc_t gc; /* the graphic context of widget */
+ rt_uint16_t tab_index; /* table detect order */
+ rt_uint16_t tab_stop;
+ rtgui_rect_t extent; /* the widget extent */
+ rt_uint32_t align; /* widget align */
+ rt_uint16_t border,border_style;
+ rtgui_region_t clip; /* the rect clip */
+
+ rt_bool_t (*event_handler)(PVOID wdt, rtgui_event_t* event);/* the event handler */
+
+ rt_bool_t (*on_focus_in)(PVOID wdt, rtgui_event_t* event);/* call back */
+ rt_bool_t (*on_focus_out)(PVOID wdt, rtgui_event_t* event);
+ rt_bool_t (*on_draw)(PVOID wdt, rtgui_event_t* event);
+ rt_bool_t (*on_mouseclick)(PVOID wdt, rtgui_event_t* event);
+ rt_bool_t (*on_key)(PVOID wdt, rtgui_event_t* event);
+ rt_bool_t (*on_size)(PVOID wdt, rtgui_event_t* event);
+ rt_bool_t (*on_command)(PVOID wdt, rtgui_event_t* event);
+
+ rt_uint32_t user_data; /* reserved user data */
+};
+
+#define RTGUI_WIDGET_FOREGROUND(w) (RTGUI_WIDGET(w))->gc.foreground
+#define RTGUI_WIDGET_BACKGROUND(w) (RTGUI_WIDGET(w))->gc.background
+#define RTGUI_WIDGET_FONT(w) (RTGUI_WIDGET(w))->gc.font
+#define RTGUI_WIDGET_TEXTALIGN(w) (RTGUI_WIDGET(w))->gc.textalign
+
+#define RTGUI_WIDGET_FLAG(w) (RTGUI_WIDGET(w))->flag
+#define RTGUI_WIDGET_ALIGN(w) (RTGUI_WIDGET(w))->align
+#define RTGUI_WIDGET_EVENT_HANDLE(w) (RTGUI_WIDGET(w))->event_handler
+#define RTGUI_WIDGET_EVENT_CALL(w,e) (RTGUI_WIDGET(w))->event_handler(w,e)
+#define RTGUI_WIDGET_PARENT(w) (RTGUI_WIDGET(w))->parent
+#define RTGUI_WIDGET_EXTENT(w) (RTGUI_WIDGET(w))->extent
+#define RTGUI_WIDGET_BORDER(w) (RTGUI_WIDGET(w))->border
+#define RTGUI_WIDGET_BORDER_STYLE(w) (RTGUI_WIDGET(w))->border_style
+#define RTGUI_WIDGET_CLIP(w) (RTGUI_WIDGET(w))->clip
+
+#define RTGUI_WIDGET_FLAG_DEFAULT 0x0000 //Ĭ��
+#define RTGUI_WIDGET_FLAG_HIDE 0x0001 //���ص�
+#define RTGUI_WIDGET_FLAG_DISABLE 0x0002 //����
+#define RTGUI_WIDGET_FLAG_FOCUS 0x0004 //�����
+#define RTGUI_WIDGET_FLAG_TRANSPARENT 0x0008 //͸����
+#define RTGUI_WIDGET_FLAG_FOCUSABLE 0x0010 //�ɻ�ý����
+#define RTGUI_WIDGET_FLAG_DC_VISIBLE 0x0100
+
+#define RTGUI_WIDGET_UNHIDE(w) RTGUI_WIDGET_FLAG(w) &= ~RTGUI_WIDGET_FLAG_HIDE
+#define RTGUI_WIDGET_HIDE(w) RTGUI_WIDGET_FLAG(w) |= RTGUI_WIDGET_FLAG_HIDE
+#define RTGUI_WIDGET_IS_HIDE(w) (RTGUI_WIDGET_FLAG(w) & RTGUI_WIDGET_FLAG_HIDE)
+
+#define RTGUI_WIDGET_ENABLE(w) RTGUI_WIDGET_FLAG(w) &= ~RTGUI_WIDGET_FLAG_DISABLE
+#define RTGUI_WIDGET_DISABLE(w) RTGUI_WIDGET_FLAG(w) |= RTGUI_WIDGET_FLAG_DISABLE
+#define RTGUI_WIDGET_IS_ENABLE(w) !(RTGUI_WIDGET_FLAG(w) & RTGUI_WIDGET_FLAG_DISABLE)
+
+#define RTGUI_WIDGET_UNFOCUS(w) RTGUI_WIDGET_FLAG(w) &= ~RTGUI_WIDGET_FLAG_FOCUS
+#define RTGUI_WIDGET_FOCUS(w) RTGUI_WIDGET_FLAG(w) |= RTGUI_WIDGET_FLAG_FOCUS
+#define RTGUI_WIDGET_IS_FOCUSED(w) (RTGUI_WIDGET_FLAG(w) & RTGUI_WIDGET_FLAG_FOCUS)
+
+#define RTGUI_WIDGET_IS_FOCUSABLE(w) (RTGUI_WIDGET_FLAG(w) & RTGUI_WIDGET_FLAG_FOCUSABLE)
+
+#define RTGUI_WIDGET_IS_DC_VISIBLE(w) (RTGUI_WIDGET_FLAG(w) & RTGUI_WIDGET_FLAG_DC_VISIBLE)
+#define RTGUI_WIDGET_DC_SET_VISIBLE(w) RTGUI_WIDGET_FLAG(w) |= RTGUI_WIDGET_FLAG_DC_VISIBLE
+#define RTGUI_WIDGET_DC_SET_UNVISIBLE(w) RTGUI_WIDGET_FLAG(w) &= ~RTGUI_WIDGET_FLAG_DC_VISIBLE
+#define RTGUI_WIDGET_DC(w) ((rtgui_dc_t*)&(RTGUI_WIDGET(w)->dc_type))
+
+rtgui_type_t *rtgui_widget_type_get(void);
+PVOID rtgui_widget_create(rtgui_type_t *widget_type);
+void rtgui_widget_destroy(PVOID wdt);
+
+/* set the event handler of widget */
+void rtgui_widget_set_event_handler(PVOID wdt, rtgui_event_handler_ptr handler);
+/* widget default event handler */
+rt_bool_t rtgui_widget_event_handler(PVOID wdt, rtgui_event_t* event);
+
+/* focus and unfocus */
+PVOID rtgui_widget_get_focus(PVOID wdt);
+void rtgui_widget_focus(PVOID wdt);
+void rtgui_widget_unfocus(PVOID wdt);
+
+/* event handler for each command */
+void rtgui_widget_set_onfocus(PVOID wdt, rtgui_event_handler_ptr handler);
+void rtgui_widget_set_onunfocus(PVOID wdt, rtgui_event_handler_ptr handler);
+
+void rtgui_widget_set_ondraw(PVOID wdt, rtgui_event_handler_ptr handler);
+void rtgui_widget_set_onmouseclick(PVOID wdt, rtgui_event_handler_ptr handler);
+void rtgui_widget_set_onkey(PVOID wdt, rtgui_event_handler_ptr handler);
+void rtgui_widget_set_onsize(PVOID wdt, rtgui_event_handler_ptr handler);
+void rtgui_widget_set_oncommand(PVOID wdt, rtgui_event_handler_ptr handler);
+
+void rtgui_widget_get_rect(PVOID wdt, rtgui_rect_t *rect);/* get and set rect of widget */
+void rtgui_widget_set_rect(PVOID wdt, rtgui_rect_t* rect);
+void rtgui_widget_get_position(PVOID wdt, rtgui_point_t *p);
+rt_uint16_t rtgui_widget_get_width(PVOID wdt);
+rt_uint16_t rtgui_widget_get_height(PVOID wdt);
+
+void rtgui_widget_set_style(PVOID wdt, rt_uint32_t style);
+void rtgui_widget_point_to_device(PVOID wdt, rtgui_point_t *point);/* get the physical position of a logic point on widget */
+void rtgui_widget_rect_to_device(PVOID wdt, rtgui_rect_t *rect);/* get the physical position of a logic rect on widget */
+void rtgui_widget_point_to_logic(PVOID wdt, rtgui_point_t *point);/* get the logic position of a physical point on widget */
+void rtgui_widget_rect_to_logic(PVOID wdt, rtgui_rect_t *rect);/* get the logic position of a physical rect on widget */
+void rtgui_widget_move_to_logic(PVOID wdt, int dx, int dy);/* move widget and its child to a logic point */
+
+/* update the clip info of widget */
+void rtgui_widget_update_clip(PVOID wdt);
+void rtgui_widget_update_clip_pirate(PVOID wdt,PVOID topwdt);
+
+PVOID rtgui_widget_get_toplevel(PVOID wdt); /* get the toplevel widget of widget */
+void rtgui_widget_show(PVOID wdt);
+void rtgui_widget_hide(PVOID wdt);
+void rtgui_widget_update(PVOID wdt);
+/* get parent color */
+rtgui_color_t rtgui_widget_get_parent_foreground(PVOID wdt);
+rtgui_color_t rtgui_widget_get_parent_background(PVOID wdt);
+/* get the next sibling of widget */
+rtgui_widget_t* rtgui_widget_get_next_sibling(PVOID wdt);
+/* get the prev sibling of widget */
+rtgui_widget_t* rtgui_widget_get_prev_sibling(PVOID wdt);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/components/rtgui_win/include/rtgui/widgets/window.h b/components/rtgui_win/include/rtgui/widgets/window.h
new file mode 100644
index 0000000000..7a5f32a346
--- /dev/null
+++ b/components/rtgui_win/include/rtgui/widgets/window.h
@@ -0,0 +1,130 @@
+/*
+ * File : window.h
+ * This file is part of RTGUI in RT-Thread RTOS
+ * COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rt-thread.org/license/LICENSE
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2009-10-04 Bernard first version
+ * 2010-05-03 Bernard add win close function
+ */
+#ifndef __RTGUI_WINDOW_H__
+#define __RTGUI_WINDOW_H__
+
+#include <rtgui/rtgui.h>
+#include <rtgui/widgets/container.h>
+
+/** Gets the type of a win */
+#define RTGUI_WIN_TYPE (rtgui_win_type_get())
+/** Casts the object to an rtgui_win_t */
+#define RTGUI_WIN(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_WIN_TYPE, rtgui_win_t))
+/** Checks if the object is an rtgui_win_t */
+#define RTGUI_IS_WIN(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_WIN_TYPE))
+
+#define RTGUI_WIN_CLOSEBOX_WIDTH 16
+#define RTGUI_WIN_CLOSEBOX_HEIGHT 16
+
+#define RTGUI_WIN_TITLE_HEIGHT 20 //�������߶�
+#define RTGUI_WIN_STATUS_HEIGHT 20 //״̬���߶�
+#define RTGUI_WIN_MENU_HEIGHT 20 //�˵����߶�
+
+//���ڵ�״̬
+#define RTGUI_WIN_STATUS_MODAL (1ul << 0) //ģʽ����
+#define RTGUI_WIN_STATUS_MIN (1ul << 1)
+#define RTGUI_WIN_STATUS_MAX (1ul << 2) //���ڴ������״̬
+#define RTGUI_WIN_STATUS_CLOSED (1ul << 3) //�رյ�
+#define RTGUI_WIN_STATUS_ACTIVATE (1ul << 4) //���
+#define RTGUI_WIN_STATUS_FOCUS (1ul << 5) //��ý����
+
+#define RTGUI_WIN_IS_MODAL_MODE(w) (w->status & RTGUI_WIN_STATUS_MODAL)
+//���ڵ���ʽ,����
+#define RTGUI_WIN_TITLE (1ul << 1) //������
+#define RTGUI_WIN_STATUS (1ul << 2) //״̬��
+#define RTGUI_WIN_MENU (1ul << 3) //�˵���
+#define RTGUI_WIN_BORDER (1ul << 4) //�߿�
+#define RTGUI_WIN_MINBOX (1ul << 5) //��С����ť
+#define RTGUI_WIN_MAXBOX (1ul << 6) //��󻯰�ť
+#define RTGUI_WIN_CLOSEBOX (1ul << 7) //�رհ�ť
+#define RTGUI_WIN_MINBOX_PRESSED (1ul << 8)
+#define RTGUI_WIN_MAXBOX_PRESSED (1ul << 9)
+#define RTGUI_WIN_CLOSEBOX_PRESSED (1ul << 10) //�رհ�ť������
+
+#define RTGUI_WIN_NOTITLE (0)
+#define RTGUI_WIN_DEFAULT (RTGUI_WIN_BORDER|RTGUI_WIN_TITLE|RTGUI_WIN_CLOSEBOX)
+#define RTGUI_WIN_DIALOG (RTGUI_WIN_BORDER|RTGUI_WIN_TITLE|RTGUI_WIN_CLOSEBOX|RTGUI_WIN_MINBOX)
+#define RTGUI_WIN_NORMAL (RTGUI_WIN_BORDER|RTGUI_WIN_TITLE|RTGUI_WIN_CLOSEBOX|RTGUI_WIN_MINBOX|RTGUI_WIN_MAXBOX)
+
+
+struct rtgui_win_title;
+struct rtgui_win_area;
+
+struct rtgui_win
+{
+ /* inherit from top */
+ rtgui_container_t parent;
+
+ /* window title */
+ char* title;
+
+ /* parent top */
+ PVOID modal_widget;
+ rtgui_list_t list; /* window list */
+
+ /* the thread id */
+ struct rt_thread* tid; //�����߳�
+
+ rt_uint32_t style; //���ڵ���ʽ
+ rt_uint32_t status; //���ڵ�״̬
+ rt_uint16_t title_height; //�������߶�
+ rt_uint16_t status_height; //״̬���߶�
+ rt_uint16_t menu_height; //�˵����߶�
+ rt_uint16_t border_size; //����߿����
+
+ /* call back */
+ rt_bool_t (*on_activate)(PVOID wdt, rtgui_event_t* event);
+ rt_bool_t (*on_deactivate)(PVOID wdt, rtgui_event_t* event);
+ rt_bool_t (*on_close)(PVOID wdt, rtgui_event_t* event);
+
+ /* reserved user data */
+ void* user_data;
+};
+
+rtgui_type_t *rtgui_win_type_get(void);
+rtgui_win_t* rtgui_win_create(PVOID parent, const char* title, rtgui_rect_t *rect, rt_uint32_t flag);
+void rtgui_win_destroy(rtgui_win_t* win);
+rtgui_win_t* rtgui_win_get_win_by_widget(PVOID wdt);
+void rtgui_win_close(PVOID wdt, rtgui_event_t *event);
+rt_bool_t rtgui_win_ondraw(rtgui_win_t* win);
+
+void rtgui_win_show(rtgui_win_t* win, rt_bool_t modal);
+void rtgui_win_hiden(rtgui_win_t* win);
+void rtgui_win_end_modal(rtgui_win_t* win);
+
+rt_bool_t rtgui_win_is_activated(rtgui_win_t* win);
+
+void rtgui_win_move(rtgui_win_t* win, int x, int y);
+
+/* reset extent of window */
+void rtgui_win_set_rect(rtgui_win_t* win, rtgui_rect_t* rect);
+void rtgui_win_set_onactivate(rtgui_win_t* win, rtgui_event_handler_ptr handler);
+void rtgui_win_set_ondeactivate(rtgui_win_t* win, rtgui_event_handler_ptr handler);
+void rtgui_win_set_onclose(rtgui_win_t* win, rtgui_event_handler_ptr handler);
+
+rt_bool_t rtgui_win_event_handler(PVOID wdt, rtgui_event_t* event);
+void rtgui_win_event_loop(rtgui_win_t* win);
+
+void rtgui_win_set_title(rtgui_win_t* win, const char *title);
+char* rtgui_win_get_title(rtgui_win_t* win);
+
+rtgui_point_t rtgui_win_get_client_zero(rtgui_win_t *win);
+void rtgui_win_get_client_rect(rtgui_win_t *win, rtgui_rect_t *rect);
+void rtgui_win_get_title_rect(rtgui_win_t *win, rtgui_rect_t *rect);
+void rtgui_win_get_closebox_rect(rtgui_win_t *win, rtgui_rect_t *rect);
+void rtgui_win_get_maxbox_rect(rtgui_win_t *win, rtgui_rect_t *rect);
+void rtgui_win_get_minbox_rect(rtgui_win_t *win, rtgui_rect_t *rect);
+
+#endif