From: moinuddin.s Date: Fri, 28 Jun 2013 10:56:56 +0000 (+0530) Subject: fixed JIRA N_SE-43582 in OptionMenu. X-Git-Tag: accepted/tizen/20130924.144426~1^2~258^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b786ecc71960014af18cd5e0c045f75e1ea4a37;p=platform%2Fframework%2Fnative%2Fuifw.git fixed JIRA N_SE-43582 in OptionMenu. Signed-off-by: moinuddin.s Change-Id: Icf3a5bac023625f1868997192a4a9e31c30bc8af Signed-off-by: moinuddin.s --- diff --git a/src/ui/controls/FUiCtrl_OptionMenu.cpp b/src/ui/controls/FUiCtrl_OptionMenu.cpp index e955536..2083529 100644 --- a/src/ui/controls/FUiCtrl_OptionMenu.cpp +++ b/src/ui/controls/FUiCtrl_OptionMenu.cpp @@ -500,6 +500,7 @@ _OptionMenu::OnActivated(void) void _OptionMenu::OnDeactivated(void) { + __pOptionMenuPresenter->ResetSelectedItem(); return _Window::OnDeactivated(); } diff --git a/src/ui/controls/FUiCtrl_OptionMenuModel.cpp b/src/ui/controls/FUiCtrl_OptionMenuModel.cpp index 1c4e0f3..10e02dc 100755 --- a/src/ui/controls/FUiCtrl_OptionMenuModel.cpp +++ b/src/ui/controls/FUiCtrl_OptionMenuModel.cpp @@ -229,6 +229,21 @@ _OptionMenuModel::ResetAllItem(void) } } +void +_OptionMenuModel::ResetSelectedItem(int selectedIndex) +{ + if (selectedIndex == -1) + { + return; + } + + _OptionMenuItem* pItem = null; + pItem = static_cast <_OptionMenuItem*>(__items.GetAt(selectedIndex)); + SysTryReturnVoidResult(NID_UI_CTRL, (pItem != null), E_SYSTEM, "[E_SYSTEM] A system error occurred. Item is null."); + pItem->SetAndInvalidate(false); + +} + int _OptionMenuModel::GetItemIndexFromActionId(int actionId) const { diff --git a/src/ui/controls/FUiCtrl_OptionMenuPresenter.cpp b/src/ui/controls/FUiCtrl_OptionMenuPresenter.cpp index cc07697..0e1190c 100755 --- a/src/ui/controls/FUiCtrl_OptionMenuPresenter.cpp +++ b/src/ui/controls/FUiCtrl_OptionMenuPresenter.cpp @@ -914,11 +914,16 @@ bool _OptionMenuPresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo) { __pModel->ResetAllItem(); - return true; } void +_OptionMenuPresenter::ResetSelectedItem(void) +{ + __pModel->ResetSelectedItem(__selectedIndex); +} + +void _OptionMenuPresenter::OnActionPerformed(const _Control& source, int actionId) { // for SubMenu Events diff --git a/src/ui/inc/FUiCtrl_OptionMenuModel.h b/src/ui/inc/FUiCtrl_OptionMenuModel.h index e9b068b..ee6a784 100755 --- a/src/ui/inc/FUiCtrl_OptionMenuModel.h +++ b/src/ui/inc/FUiCtrl_OptionMenuModel.h @@ -57,6 +57,7 @@ public: result RemoveItem(int mainIndex, int subIndex = -1); result RemoveAllItem(void); void ResetAllItem(void); + void ResetSelectedItem(int selectedIndex); int GetSubItemCount(int mainIndex) const; int GetItemIndexFromActionId(int actionId) const; int GetSubItemIndexFromActionId(int actionId, int& mainIndex) const; diff --git a/src/ui/inc/FUiCtrl_OptionMenuPresenter.h b/src/ui/inc/FUiCtrl_OptionMenuPresenter.h index 1b4b98b..76640c6 100644 --- a/src/ui/inc/FUiCtrl_OptionMenuPresenter.h +++ b/src/ui/inc/FUiCtrl_OptionMenuPresenter.h @@ -112,6 +112,8 @@ public: virtual result SetTopDrawnItemIndex(int index); virtual result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Graphics::Bitmap& bitmap); + void ResetSelectedItem(void); + private: void LoadShape(void); result CalculateRect(void);