mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-23 12:15:32 +08:00
fixed Chinese font issue; fixed keyboard event handler issue in list widgets.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1673 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
@@ -456,6 +456,22 @@ rt_bool_t rtgui_list_view_event_handler(struct rtgui_widget* widget, struct rtgu
|
||||
{
|
||||
rt_uint16_t old_item;
|
||||
|
||||
if (view->current_item == -1)
|
||||
{
|
||||
/* set a initial item */
|
||||
if ((view->items_count > 0) &&
|
||||
(ekbd->key == RTGUIK_UP || ekbd->key == RTGUIK_DOWN))
|
||||
{
|
||||
view->current_item = 0;
|
||||
if (view->flag == RTGUI_LIST_VIEW_LIST)
|
||||
rtgui_list_view_update_list(view, -1);
|
||||
else
|
||||
rtgui_list_view_update_icon(view, -1);
|
||||
break;
|
||||
}
|
||||
else return RT_FALSE;
|
||||
}
|
||||
|
||||
old_item = view->current_item;
|
||||
switch (ekbd->key)
|
||||
{
|
||||
|
||||
@@ -266,7 +266,18 @@ rt_bool_t rtgui_listbox_event_handler(struct rtgui_widget* widget, struct rtgui_
|
||||
{
|
||||
rt_int16_t old_item;
|
||||
|
||||
if (box->current_item == -1) return RT_FALSE;
|
||||
if (box->current_item == -1)
|
||||
{
|
||||
/* set a initial item */
|
||||
if ((box->items_count > 0) &&
|
||||
(ekbd->key == RTGUIK_UP || ekbd->key == RTGUIK_DOWN))
|
||||
{
|
||||
box->current_item = 0;
|
||||
rtgui_listbox_update_current(box, -1);
|
||||
break;
|
||||
}
|
||||
else return RT_FALSE;
|
||||
}
|
||||
old_item = box->current_item;
|
||||
|
||||
switch (ekbd->key)
|
||||
|
||||
Reference in New Issue
Block a user