update menu control and add notebook control.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1220 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong@gmail.com
2010-12-21 23:50:25 +00:00
parent 32d13198df
commit 297405c3c6
9 changed files with 215 additions and 13 deletions
@@ -60,5 +60,6 @@ void rtgui_listctrl_destroy(rtgui_listctrl_t* ctrl);
rt_bool_t rtgui_listctrl_event_handler(struct rtgui_widget* widget, struct rtgui_event* event);
void rtgui_listctrl_set_onitem(rtgui_listctrl_t* ctrl, rtgui_onitem_func_t func);
void rtgui_listctrl_set_items(rtgui_listctrl_t* ctrl, rt_uint32_t items, rt_uint16_t count);
rt_bool_t rtgui_listctrl_get_item_rect(rtgui_listctrl_t* ctrl, rt_uint16_t item, rtgui_rect_t* item_rect);
#endif
@@ -73,6 +73,7 @@ void rtgui_menu_set_onmenupop(struct rtgui_menu* menu, rtgui_event_handler_ptr h
void rtgui_menu_set_onmenuhide(struct rtgui_menu* menu, rtgui_event_handler_ptr handler);
void rtgui_menu_pop(struct rtgui_menu* menu, int x, int y);
void rtgui_menu_hiden(struct rtgui_menu* menu);
#endif
@@ -0,0 +1,39 @@
#ifndef __RTGUI_NOTEBOOK_H__
#define __RTGUI_NOTEBOOK_H__
#include <rtgui/rtgui.h>
#include <rtgui/widgets/container.h>
/** Gets the type of a notebook */
#define RTGUI_NOTEBOOK_TYPE (rtgui_notebook_type_get())
/** Casts the object to a notebook control */
#define RTGUI_NOTEBOOK(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_NOTEBOOK_TYPE, rtgui_notebook_t))
/** Checks if the object is a notebook control */
#define RTGUI_IS_NOTEBOOK(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_NOTEBOOK_TYPE))
struct rtgui_notebook
{
struct rtgui_container parent;
/* widget private data */
struct rtgui_widget* childs;
rt_uint16_t count;
rt_int16_t current;
};
typedef struct rtgui_notebook rtgui_notebook_t;
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);
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);
rtgui_widget_t* rtgui_notebook_get_index(rtgui_notebook_t* notebook, rt_uint16_t index);
rt_bool_t rtgui_notebook_event_handler(struct rtgui_widget* widget, struct rtgui_event* event);
#endif
@@ -150,6 +150,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_get_extent(rtgui_widget_t* widget, rtgui_rect_t *rect);
#ifndef RTGUI_USING_SMALL_SIZE
void rtgui_widget_set_miniwidth(rtgui_widget_t* widget, int width);