From be1041fb85a0e2d9e425a918ce435fbdba44747e Mon Sep 17 00:00:00 2001 From: MinSung Jin Date: Tue, 18 Jun 2013 16:59:10 +0900 Subject: [PATCH] changed return value when focus is moved up/down at the first/last item Change-Id: Icd018d7e377df286c607fb10443d02d9e03ff63c Signed-off-by: MinSung Jin --- src/ui/controls/FUiCtrl_TableViewPresenter.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/ui/controls/FUiCtrl_TableViewPresenter.cpp b/src/ui/controls/FUiCtrl_TableViewPresenter.cpp index 4a32a4d..6fbb3d6 100644 --- a/src/ui/controls/FUiCtrl_TableViewPresenter.cpp +++ b/src/ui/controls/FUiCtrl_TableViewPresenter.cpp @@ -5273,6 +5273,13 @@ _TableViewPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInf if (pItem != null) { pItem->GetItemIndex(itemPos.groupIndex, itemPos.itemIndex); + TableViewItemTag firstItemPos = {-1, -1}; + GetFirstItem(firstItemPos); + if (itemPos.groupIndex == firstItemPos.groupIndex && itemPos.itemIndex == firstItemPos.itemIndex) + { + return false; + } + while (GetPreviousItemPosition(itemPos, itemPos)) { if (__pTableView->GetTableViewStyle() == TABLE_VIEW_STYLE_SIMPLE) @@ -5281,12 +5288,7 @@ _TableViewPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInf GetFirstItem(firstItemPos); if (itemPos.groupIndex == firstItemPos.groupIndex && itemPos.itemIndex == firstItemPos.itemIndex) { - if (__pTableView != null) - { - __pTableView->SetFocused(true); - __pTableView->DrawFocus(); - } - break; + return false; } } @@ -5326,6 +5328,13 @@ _TableViewPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInf if (pItem != null) { pItem->GetItemIndex(itemPos.groupIndex, itemPos.itemIndex); + TableViewItemTag lastItemPos = {-1, -1}; + GetLastItem(lastItemPos); + if (itemPos.groupIndex == lastItemPos.groupIndex && itemPos.itemIndex == lastItemPos.itemIndex) + { + return false; + } + while (GetNextItemPosition(itemPos, itemPos)) { if (__pTableView->GetTableViewStyle() == TABLE_VIEW_STYLE_SIMPLE && itemPos.itemIndex == -1) -- 2.7.4