From: Syed Khaja Moinuddin Date: Wed, 27 Mar 2013 06:19:36 +0000 (+0900) Subject: Fixes in EditDate / Time w.r.t OnActivated / X-Git-Tag: accepted/tizen_2.1/20130425.033138~669^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e450e9b104a61d8771970b662d88d493848ff891;p=platform%2Fframework%2Fnative%2Fuifw.git Fixes in EditDate / Time w.r.t OnActivated / OnDeactivated Signe-off-by: Syed Khaja Moinuddin Change-Id: I04f4e2dfc85158cb37f83c36d9e801ffcf28c159 Signed-off-by: Syed Khaja Moinuddin --- diff --git a/src/ui/controls/FUiCtrl_DateTimeBar.cpp b/src/ui/controls/FUiCtrl_DateTimeBar.cpp index 213ca4e..741306d 100644 --- a/src/ui/controls/FUiCtrl_DateTimeBar.cpp +++ b/src/ui/controls/FUiCtrl_DateTimeBar.cpp @@ -419,12 +419,18 @@ _DateTimeBar::OnAttachedToMainTree(void) return _Window::OnAttachedToMainTree(); } +result +_DateTimeBar::OnDetachingFromMainTree(void) +{ + return _Window::OnDetachingFromMainTree(); +} + void _DateTimeBar::OnActivated(void) { RefreshItems(); - SetTouchCapture(true, true); + SetTouchCapture(true, true); return _Window::OnActivated(); } @@ -433,15 +439,12 @@ _DateTimeBar::OnDeactivated(void) { ReleaseTouchCapture(); - GetOwner()->Invalidate(); - - return _Window::OnDeactivated(); -} + if (__pOwner != null) + { + __pOwner->Invalidate(); + } -result -_DateTimeBar::OnDetachingFromMainTree(void) -{ - return _Window::OnDetachingFromMainTree(); + return _Window::OnDeactivated(); } void diff --git a/src/ui/controls/FUiCtrl_DateTimeBarPresenter.cpp b/src/ui/controls/FUiCtrl_DateTimeBarPresenter.cpp index 1dcf504..7db1288 100755 --- a/src/ui/controls/FUiCtrl_DateTimeBarPresenter.cpp +++ b/src/ui/controls/FUiCtrl_DateTimeBarPresenter.cpp @@ -1339,7 +1339,7 @@ _DateTimeBarPresenter::StartAnimationEffect(void) __isInitialAnimation = true; __distance = -10.0f; - if (__initialAnimationValue >= 0.0f ) + if (__initialAnimationValue >= 0.0f) { __initialAnimationValue = __initialAnimationValue + __distance; StartFlickAnimationTimer(); diff --git a/src/ui/controls/FUiCtrl_EditDatePresenter.cpp b/src/ui/controls/FUiCtrl_EditDatePresenter.cpp index fcfbced..590f05c 100644 --- a/src/ui/controls/FUiCtrl_EditDatePresenter.cpp +++ b/src/ui/controls/FUiCtrl_EditDatePresenter.cpp @@ -681,7 +681,7 @@ _EditDatePresenter::OnTouchPressed(const _Control& source, const _TouchInfo& tou if (boxId < DATETIME_ID_YEAR || boxId > DATETIME_ID_DAY) { __selectedId = DATETIME_ID_NONE; - return false; + return true; } int minValue = -1; @@ -727,6 +727,7 @@ _EditDatePresenter::OnTouchPressed(const _Control& source, const _TouchInfo& tou } __selectedId = boxId; + return true; } @@ -745,6 +746,7 @@ _EditDatePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to _DateTimeId boxId = DATETIME_ID_NONE; boxId = GetBoxIdFromPosition(point); + if (boxId != __selectedId || boxId == DATETIME_ID_NONE) { if (__pEditDate->GetDateTimeBar() != null && __pEditDate->GetDateTimeBar()->IsActivated()) @@ -753,10 +755,11 @@ _EditDatePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to __pEditDate->GetDateTimeBar()->Close(); } - Draw(); __selectedId = DATETIME_ID_NONE; SetLastSelectedId(__selectedId); + Draw(); + return true; } @@ -828,11 +831,9 @@ _EditDatePresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touch return false; } - FloatPoint touchPoint = touchinfo.GetCurrentPosition(); - - if (GetBoxIdFromPosition(touchPoint) != __selectedId) + if (__pEditDate->GetDateTimeBar() != null && __pEditDate->GetDateTimeBar()->IsActivated()) { - __selectedId = DATETIME_ID_NONE; + return true; } return false; diff --git a/src/ui/controls/FUiCtrl_EditTimePresenter.cpp b/src/ui/controls/FUiCtrl_EditTimePresenter.cpp index c76ee2c..f114d9c 100755 --- a/src/ui/controls/FUiCtrl_EditTimePresenter.cpp +++ b/src/ui/controls/FUiCtrl_EditTimePresenter.cpp @@ -721,6 +721,12 @@ _EditTimePresenter::DrawText(Canvas& canvas, const FloatRectangle& bounds, const { GET_COLOR_CONFIG(EDITTIME::TEXT_NORMAL, textColor); + if (__pEditTime->GetDateTimeBar() != null && __pEditTime->GetDateTimeBar()->IsActivated() && + (GetLastSelectedId() == boxId)) + { + GET_COLOR_CONFIG(EDITTIME::TEXT_PRESSED, textColor); + } + if (boxId == DATETIME_ID_AMPM) { GET_COLOR_CONFIG(EDITTIME::BUTTON_TEXT_NORMAL, textColor); @@ -960,11 +966,11 @@ _EditTimePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to __pEditTime->GetDateTimeBar()->Close(); } - Draw(); - __selectedId = DATETIME_ID_NONE; SetLastSelectedId(__selectedId); + Draw(); + return true; } @@ -1062,11 +1068,9 @@ _EditTimePresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touch return false; } - FloatPoint touchPoint = touchinfo.GetCurrentPosition(); - - if (GetBoxIdFromPosition(touchPoint) != __selectedId) + if (__pEditTime->GetDateTimeBar() != null && __pEditTime->GetDateTimeBar()->IsActivated()) { - __selectedId = DATETIME_ID_NONE; + return true; } return false;