summaryrefslogtreecommitdiff
path: root/components/rtgui/widgets/notebook.c
diff options
context:
space:
mode:
author[email protected] <[email protected]>2010-12-21 23:50:25 +0000
committer[email protected] <[email protected]>2010-12-21 23:50:25 +0000
commit297405c3c662c8b8f09c1abb9579f151c7128dfe (patch)
tree2f6ef1218f38bed35c6557e00c2d32943a3b84b8 /components/rtgui/widgets/notebook.c
parent32d13198df15cfed5164ed510073b4f9a1a6181e (diff)
update menu control and add notebook control.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1220 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/rtgui/widgets/notebook.c')
-rw-r--r--components/rtgui/widgets/notebook.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/components/rtgui/widgets/notebook.c b/components/rtgui/widgets/notebook.c
new file mode 100644
index 0000000000..eed59c99d4
--- /dev/null
+++ b/components/rtgui/widgets/notebook.c
@@ -0,0 +1,76 @@
+#include <rtgui/rtgui.h>
+#include <rtgui/widgets/notebook.h>
+
+rtgui_type_t *rtgui_notebook_type_get(void)
+{
+}
+
+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)
+{
+ return notebook->count;
+}
+
+rtgui_widget_t* rtgui_notebook_get_current(rtgui_notebook_t* notebook)
+{
+ RT_ASSERT(notebook != RT_NULL);
+ if (notebook->current != RTGUI_NOT_FOUND)
+ return &notebook->childs[notebook->current];
+
+ return RT_NULL;
+}
+void rtgui_notebook_set_current(rtgui_notebook_t* notebook, rtgui_widget_t* widget)
+{
+ rt_int16_t index;
+
+ RT_ASSERT(notebook != RT_NULL);
+
+ for (index = 0; index < notebook->count; index ++)
+ {
+ if (widget == &notebook->childs[index])
+ {
+ rtgui_notebook_set_current_by_index(notebook, index);
+ return;
+ }
+ }
+}
+
+void rtgui_notebook_set_current_by_index(rtgui_notebook_t* notebook, rt_uint16_t index)
+{
+ RT_ASSERT(notebook != RT_NULL);
+
+ if ((index < notebook->count) && (notebook->current != index))
+ {
+ if (notebook->current != RTGUI_NOT_FOUND)
+ rtgui_widget_hide(&notebook->childs[notebook->current]);
+
+ notebook->current = index;
+ rtgui_widget_show(&notebook->childs[notebook->current]);
+ rtgui_widget_update(&notebook->childs[notebook->current]);
+ }
+}
+
+rtgui_widget_t* rtgui_notebook_get_index(rtgui_notebook_t* notebook, rt_uint16_t index)
+{
+ RT_ASSERT(notebook != RT_NULL);
+ if (index < notebook->count)
+ return &notebook->childs[index];
+
+ return RT_NULL;
+}
+
+rt_bool_t rtgui_notebook_event_handler(struct rtgui_widget* widget, struct rtgui_event* event)
+{
+ return RT_FALSE;
+}