summaryrefslogtreecommitdiff
path: root/components/rtgui/include
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-05-15 14:36:02 +0000
committerbernard.xiong <[email protected]>2010-05-15 14:36:02 +0000
commit3f319a875c675b9ffef093312de8204247f09d59 (patch)
treed4fba5d0d49f7921617e4542c99aa721e63fd82f /components/rtgui/include
parent3f33f036ece9d33a35aa41a7b9e09c10a47e9d5a (diff)
add icon display mode in listview.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@710 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/rtgui/include')
-rw-r--r--components/rtgui/include/rtgui/rtgui_config.h37
-rw-r--r--components/rtgui/include/rtgui/widgets/filelist_view.h2
-rw-r--r--components/rtgui/include/rtgui/widgets/list_view.h14
-rw-r--r--components/rtgui/include/rtgui/widgets/listbox.h2
4 files changed, 34 insertions, 21 deletions
diff --git a/components/rtgui/include/rtgui/rtgui_config.h b/components/rtgui/include/rtgui/rtgui_config.h
index a941ad6422..cb6fa8c373 100644
--- a/components/rtgui/include/rtgui/rtgui_config.h
+++ b/components/rtgui/include/rtgui/rtgui_config.h
@@ -19,25 +19,26 @@
/* RTGUI options */
#ifdef _WIN32
-/* name length of RTGUI object */
-#define RTGUI_NAME_MAX 12
-/* support 16 weight font */
-#define RTGUI_USING_FONT16
-/* support Chinese font */
-#define RTGUI_USING_FONTHZ
-/* use small size in RTGUI */
-#define RTGUI_USING_SMALL_SIZE
-/* use mouse cursor */
-/* #define RTGUI_USING_MOUSE_CURSOR */
-/* default font size in RTGUI */
-#define RTGUI_DEFAULT_FONT_SIZE 12
+ /* name length of RTGUI object */
+ #define RTGUI_NAME_MAX 12
+ /* support 16 weight font */
+ #define RTGUI_USING_FONT16
+ /* support Chinese font */
+ #define RTGUI_USING_FONTHZ
+ /* use small size in RTGUI */
+ #define RTGUI_USING_SMALL_SIZE
+ /* use mouse cursor */
+ /* #define RTGUI_USING_MOUSE_CURSOR */
+ /* default font size in RTGUI */
+ #define RTGUI_DEFAULT_FONT_SIZE 12
-#define RTGUI_USING_STDIO_FILERW
-#define RTGUI_IMAGE_PNG
-#define RTGUI_IMAGE_JPEG
-#define RTGUI_USING_FONT12
-#define RTGUI_USING_HZ_BMP
-#define RTGUI_MEM_TRACE
+ #define RTGUI_USING_STDIO_FILERW
+ #define RTGUI_IMAGE_PNG
+ #define RTGUI_IMAGE_JPEG
+ #define RTGUI_USING_FONT12
+ #define RTGUI_USING_HZ_BMP
+ #define RTGUI_MEM_TRACE
+ #define RTGUI_USING_WINMOVE
#endif
#if RTGUI_DEFAULT_FONT_SIZE == 0
diff --git a/components/rtgui/include/rtgui/widgets/filelist_view.h b/components/rtgui/include/rtgui/widgets/filelist_view.h
index 8f608e6de1..105b9f3554 100644
--- a/components/rtgui/include/rtgui/widgets/filelist_view.h
+++ b/components/rtgui/include/rtgui/widgets/filelist_view.h
@@ -51,6 +51,6 @@ void rtgui_filelist_view_destroy(rtgui_filelist_view_t* view);
rt_bool_t rtgui_filelist_view_event_handler(struct rtgui_widget* widget, struct rtgui_event* event);
void rtgui_filelist_view_set_directory(rtgui_filelist_view_t* view, const char* directory);
-void rtgui_filelist_get_fullpath(rtgui_filelist_view_t* view, char* path, rt_size_t len);
+void rtgui_filelist_view_get_fullpath(rtgui_filelist_view_t* view, char* path, rt_size_t len);
#endif
diff --git a/components/rtgui/include/rtgui/widgets/list_view.h b/components/rtgui/include/rtgui/widgets/list_view.h
index 6d7732f491..2d3b2bf6d2 100644
--- a/components/rtgui/include/rtgui/widgets/list_view.h
+++ b/components/rtgui/include/rtgui/widgets/list_view.h
@@ -38,6 +38,10 @@ struct rtgui_list_item
/** Checks if the object is a filelist view */
#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
{
struct rtgui_view parent;
@@ -46,19 +50,25 @@ struct rtgui_list_view
/* list item */
const struct rtgui_list_item* items;
+ /* layout flag */
+ rt_uint16_t flag;
+
/* total number of items */
rt_uint16_t items_count;
/* the number of item in a page */
rt_uint16_t page_items;
- /* current item */
+ /* current item */
rt_uint16_t current_item;
+
+ /* icon layout */
+ rt_uint8_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(const struct rtgui_list_item* items, rt_uint16_t count,
- rtgui_rect_t *rect);
+ rtgui_rect_t *rect, rt_uint16_t flag);
void rtgui_list_view_destroy(rtgui_list_view_t* view);
rt_bool_t rtgui_list_view_event_handler(struct rtgui_widget* widget, struct rtgui_event* event);
diff --git a/components/rtgui/include/rtgui/widgets/listbox.h b/components/rtgui/include/rtgui/widgets/listbox.h
index 3d05e70e28..1777920b00 100644
--- a/components/rtgui/include/rtgui/widgets/listbox.h
+++ b/components/rtgui/include/rtgui/widgets/listbox.h
@@ -61,6 +61,8 @@ rtgui_listbox_t* rtgui_listbox_create(const struct rtgui_listbox_item* items, rt
void rtgui_listbox_destroy(rtgui_listbox_t* box);
rt_bool_t rtgui_listbox_event_handler(struct rtgui_widget* widget, struct rtgui_event* event);
+void rtgui_listbox_set_onitem(rtgui_listbox_t* box, rtgui_onitem_func_t func);
+void rtgui_listbox_set_items(rtgui_listbox_t* box, struct rtgui_listbox_item* items, rt_uint16_t count);
#endif