diff options
| author | [email protected] <[email protected]> | 2010-12-22 23:57:44 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2010-12-22 23:57:44 +0000 |
| commit | c260b4d77fce75937738bf12e9ffa1c78e9dff4e (patch) | |
| tree | 4313fb76313e9cd6513feb68405ccc861166641e /components/rtgui/include | |
| parent | ecb7e7d987e323837578516e0e0a14ba94000982 (diff) | |
update notebook control.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1223 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/rtgui/include')
| -rw-r--r-- | components/rtgui/include/rtgui/rtgui.h | 1 | ||||
| -rw-r--r-- | components/rtgui/include/rtgui/rtgui_system.h | 3 | ||||
| -rw-r--r-- | components/rtgui/include/rtgui/widgets/notebook.h | 15 | ||||
| -rw-r--r-- | components/rtgui/include/rtgui/widgets/widget.h | 2 |
4 files changed, 15 insertions, 6 deletions
diff --git a/components/rtgui/include/rtgui/rtgui.h b/components/rtgui/include/rtgui/rtgui.h index fe69610b15..780e55456e 100644 --- a/components/rtgui/include/rtgui/rtgui.h +++ b/components/rtgui/include/rtgui/rtgui.h @@ -19,6 +19,7 @@ #define RT_INT16_MAX 32767 #define RT_INT16_MIN (-RT_INT16_MAX-1) +#define RTGUI_NOT_FOUND (-1) struct rtgui_panel; struct rtgui_event; diff --git a/components/rtgui/include/rtgui/rtgui_system.h b/components/rtgui/include/rtgui/rtgui_system.h index 4b963a3529..0450aa6563 100644 --- a/components/rtgui/include/rtgui/rtgui_system.h +++ b/components/rtgui/include/rtgui/rtgui_system.h @@ -82,7 +82,7 @@ rt_err_t rtgui_thread_send(rt_thread_t tid, struct rtgui_event* event, rt_size_t rt_err_t rtgui_thread_send_urgent(rt_thread_t tid, struct rtgui_event* event, rt_size_t event_size);
rt_err_t rtgui_thread_send_sync(rt_thread_t tid, struct rtgui_event* event, rt_size_t event_size);
rt_err_t rtgui_thread_recv(struct rtgui_event* event, rt_size_t event_size);
-rt_err_t rtgui_thread_recv_nosuspend(struct rtgui_event* event, rt_size_t event_size); +rt_err_t rtgui_thread_recv_nosuspend(struct rtgui_event* event, rt_size_t event_size);
rt_err_t rtgui_thread_recv_filter(rt_uint32_t type, struct rtgui_event* event, rt_size_t event_size);
rt_err_t rtgui_thread_ack(struct rtgui_event* event, rt_int32_t status);
@@ -91,6 +91,7 @@ void rtgui_system_server_init(void); void* rtgui_malloc(rt_size_t size);
void rtgui_free(void* ptr);
+void* rtgui_realloc(void* ptr, rt_size_t size);
#endif
diff --git a/components/rtgui/include/rtgui/widgets/notebook.h b/components/rtgui/include/rtgui/widgets/notebook.h index 76e4298ec2..477150c014 100644 --- a/components/rtgui/include/rtgui/widgets/notebook.h +++ b/components/rtgui/include/rtgui/widgets/notebook.h @@ -2,7 +2,7 @@ #define __RTGUI_NOTEBOOK_H__
#include <rtgui/rtgui.h>
-#include <rtgui/widgets/container.h>
+#include <rtgui/widgets/widget.h>
/** Gets the type of a notebook */
#define RTGUI_NOTEBOOK_TYPE (rtgui_notebook_type_get())
@@ -11,12 +11,19 @@ /** Checks if the object is a notebook control */
#define RTGUI_IS_NOTEBOOK(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_NOTEBOOK_TYPE))
+struct rtgui_notebook_tab
+{
+ char* title;
+ struct rtgui_widget* widget;
+};
+typedef struct rtgui_notebook_tab rtgui_notebook_tab_t;
+
struct rtgui_notebook
{
- struct rtgui_container parent;
+ struct rtgui_widget parent;
/* widget private data */
- struct rtgui_widget* childs;
+ rtgui_notebook_tab_t* childs;
rt_uint16_t count;
rt_int16_t current;
};
@@ -28,7 +35,7 @@ rtgui_notebook_t* rtgui_notebook_create(const rtgui_rect_t* rect); void rtgui_notebook_destroy(rtgui_notebook_t* notebook);
void rtgui_notebook_add(rtgui_notebook_t* notebook, const char* label, rtgui_widget_t* child);
-int rtgui_notebook_get_count(rtgui_notebootk_t* notebook);
+int rtgui_notebook_get_count(rtgui_notebook_t* notebook);
rtgui_widget_t* rtgui_notebook_get_current(rtgui_notebook_t* notebook);
void rtgui_notebook_set_current(rtgui_notebook_t* notebook, rtgui_widget_t* widget);
void rtgui_notebook_set_current_by_index(rtgui_notebook_t* notebook, rt_uint16_t index);
diff --git a/components/rtgui/include/rtgui/widgets/widget.h b/components/rtgui/include/rtgui/widgets/widget.h index 1a58d6bead..dc58cac76d 100644 --- a/components/rtgui/include/rtgui/widgets/widget.h +++ b/components/rtgui/include/rtgui/widgets/widget.h @@ -149,7 +149,7 @@ void rtgui_widget_set_oncommand(rtgui_widget_t* widget, rtgui_event_handler_ptr /* get and set rect of widget */ void rtgui_widget_get_rect(rtgui_widget_t* widget, rtgui_rect_t *rect); -void rtgui_widget_set_rect(rtgui_widget_t* widget, rtgui_rect_t* rect); +void rtgui_widget_set_rect(rtgui_widget_t* widget, const rtgui_rect_t* rect); void rtgui_widget_get_extent(rtgui_widget_t* widget, rtgui_rect_t *rect); #ifndef RTGUI_USING_SMALL_SIZE |
