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:
bernard.xiong
2011-08-17 08:23:59 +00:00
parent c834d7cdbd
commit e1e75c4572
4 changed files with 33 additions and 6 deletions
+16
View File
@@ -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)
{
+12 -1
View File
@@ -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)