提交 0c31a7c3 编写于 作者: B bernard.xiong@gmail.com

add widget parameter in item action function callback.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@863 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 9a3f6774
......@@ -21,7 +21,7 @@
#include <rtgui/widgets/view.h>
typedef void (*item_action)(void* parameter);
typedef void (*item_action)(struct rtgui_widget* widget, void* parameter);
struct rtgui_list_item
{
char* name;
......
......@@ -373,7 +373,8 @@ static rt_bool_t rtgui_list_view_onmouse(struct rtgui_list_view* view, struct rt
/* up event */
if (view->items[view->current_item].action != RT_NULL)
{
view->items[view->current_item].action(view->items[view->current_item].parameter);
view->items[view->current_item].action(RTGUI_WIDGET(view),
view->items[view->current_item].parameter);
}
}
}
......@@ -407,7 +408,8 @@ static rt_bool_t rtgui_list_view_onmouse(struct rtgui_list_view* view, struct rt
/* up event */
if (view->items[view->current_item].action != RT_NULL)
{
view->items[view->current_item].action(view->items[view->current_item].parameter);
view->items[view->current_item].action(RTGUI_WIDGET(view),
view->items[view->current_item].parameter);
}
}
}
......@@ -537,7 +539,8 @@ rt_bool_t rtgui_list_view_event_handler(struct rtgui_widget* widget, struct rtgu
case RTGUIK_RETURN:
if (view->items[view->current_item].action != RT_NULL)
{
view->items[view->current_item].action(view->items[view->current_item].parameter);
view->items[view->current_item].action(RTGUI_WIDGET(view),
view->items[view->current_item].parameter);
}
return RT_FALSE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册