add widget parameter in item action function callback.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@863 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
9a3f67746f
commit
0c31a7c3ae
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include <rtgui/widgets/view.h>
|
#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
|
struct rtgui_list_item
|
||||||
{
|
{
|
||||||
char* name;
|
char* name;
|
||||||
|
|
|
@ -373,7 +373,8 @@ static rt_bool_t rtgui_list_view_onmouse(struct rtgui_list_view* view, struct rt
|
||||||
/* up event */
|
/* up event */
|
||||||
if (view->items[view->current_item].action != RT_NULL)
|
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 */
|
/* up event */
|
||||||
if (view->items[view->current_item].action != RT_NULL)
|
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:
|
case RTGUIK_RETURN:
|
||||||
if (view->items[view->current_item].action != RT_NULL)
|
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;
|
return RT_FALSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue