fix compiler error.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1238 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
wuyangyong 2011-01-12 06:21:10 +00:00
parent afbce6d5f9
commit 50bd74d3cb
2 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ static void _rtgui_menu_onitem(struct rtgui_widget* widget, struct rtgui_event*
rt_uint16_t count; rt_uint16_t count;
rtgui_rect_t item_rect; rtgui_rect_t item_rect;
items = menu->items[menu->items_list->current_item].submenu; items = (rtgui_menu_item_t*)menu->items[menu->items_list->current_item].submenu;
count = menu->items[menu->items_list->current_item].submenu_count; count = menu->items[menu->items_list->current_item].submenu_count;
if (menu->sub_menu != RT_NULL) if (menu->sub_menu != RT_NULL)
{ {
@ -164,7 +164,7 @@ static rt_bool_t rtgui_menu_on_deactivate(rtgui_widget_t* widget, rtgui_event_t*
{ {
/* whether click on parent menu */ /* whether click on parent menu */
if (rtgui_win_is_activated(RTGUI_WIN(menu->parent_menu)) == RT_TRUE && if (rtgui_win_is_activated(RTGUI_WIN(menu->parent_menu)) == RT_TRUE &&
menu->parent_menu->items[menu->parent_menu->items_list->current_item].submenu == menu->items) menu->parent_menu->items[menu->parent_menu->items_list->current_item].submenu == (struct rtgui_menu_item_t *)menu->items)
return RT_TRUE; return RT_TRUE;
} }

View File

@ -25,7 +25,7 @@ static const rtgui_menu_item_t items[] =
{RTGUI_ITEM_NORMAL, "item #1", RT_NULL, RT_NULL, 0, RT_NULL}, {RTGUI_ITEM_NORMAL, "item #1", RT_NULL, RT_NULL, 0, RT_NULL},
{RTGUI_ITEM_NORMAL, "item #2", RT_NULL, RT_NULL, 0, RT_NULL}, {RTGUI_ITEM_NORMAL, "item #2", RT_NULL, RT_NULL, 0, RT_NULL},
{RTGUI_ITEM_SEPARATOR, RT_NULL, RT_NULL, RT_NULL, 0, RT_NULL}, {RTGUI_ITEM_SEPARATOR, RT_NULL, RT_NULL, RT_NULL, 0, RT_NULL},
{RTGUI_ITEM_SUBMENU, "item #3", RT_NULL, sub_items, sizeof(sub_items)/sizeof(sub_items[0]), RT_NULL}, {RTGUI_ITEM_SUBMENU, "item #3", RT_NULL, (struct rtgui_menu_item_t *)sub_items, sizeof(sub_items)/sizeof(sub_items[0]), RT_NULL},
}; };
static rtgui_menu_t* menu; static rtgui_menu_t* menu;