From 788aa5e18dbd25534b043b74601c60a03b547233 Mon Sep 17 00:00:00 2001 From: minkyu kim Date: Thu, 11 Apr 2013 20:41:53 +0900 Subject: [PATCH] modify touch position for popup which added indicator area and add E_UNSUPPORTED_OPERATION Change-Id: Id7ef72462a5fb90b0ea41508ad08322b5c788420 --- inc/FUiTouchPinchGestureDetector.h | 16 +++++++++++++--- src/ui/FUi_Control.cpp | 38 ++++++++++++++++++++++++++++++++++---- src/ui/FUi_EflUiEventManager.cpp | 20 ++++++++++++++++++-- 3 files changed, 65 insertions(+), 9 deletions(-) diff --git a/inc/FUiTouchPinchGestureDetector.h b/inc/FUiTouchPinchGestureDetector.h index b6c6a63..746fe70 100644 --- a/inc/FUiTouchPinchGestureDetector.h +++ b/inc/FUiTouchPinchGestureDetector.h @@ -68,11 +68,21 @@ public: * Initializes this instance of %TouchPinchGestureDetector. * * @since 2.0 - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - */ + * @feature %http://tizen.org/feature/multi_point_touch.pinch_zoom + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature. @b Since: @b 2.1 + * For more information, see + * + * Application Filtering. + * @remarks Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue() + * methods. + */ result Construct(void); + /** * Adds the ITouchPinchGestureEventListener instance to the pinch gesture detector instance. @n * The added listener gets notified when a gesture is recognized. diff --git a/src/ui/FUi_Control.cpp b/src/ui/FUi_Control.cpp index f02801b..9e09b79 100644 --- a/src/ui/FUi_Control.cpp +++ b/src/ui/FUi_Control.cpp @@ -53,6 +53,7 @@ #include "FUiCtrl_Form.h" #include "FUiCtrl_Frame.h" #include "FUi_ContainerImpl.h" +#include "FUiCtrl_Popup.h" using namespace std; using namespace Tizen::Base; @@ -61,6 +62,7 @@ using namespace Tizen::Base::Runtime; using namespace Tizen::Graphics; using namespace Tizen::Ui; using namespace Tizen::Ui::Animations; +using namespace Tizen::Ui::Controls; namespace { @@ -3537,8 +3539,22 @@ _Control::GetAbsoluteBounds(void) const { Point winPoint = pWindow->GetPosition(); - accumPoint.x += winPoint.x; - accumPoint.y += winPoint.y; + Rectangle popupRect(0, 0, 0, 0); + _Popup* pPopup = dynamic_cast<_Popup*>(pWindow); + if (pPopup) + { + if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) + { + popupRect = pPopup->GetNativeBounds(true); + } + else + { + popupRect = pPopup->GetNativeBounds(false); + } + } + + accumPoint.x = accumPoint.x + winPoint.x + popupRect.x; + accumPoint.y = accumPoint.y + winPoint.y + popupRect.y; } absoluteBounds.x = accumPoint.x; @@ -3580,8 +3596,22 @@ _Control::GetAbsoluteBoundsF(void) const { FloatPoint winPoint = pWindow->GetPositionF(); - accumPoint.x += winPoint.x; - accumPoint.y += winPoint.y; + Rectangle popupRect(0, 0, 0, 0); + _Popup* pPopup = dynamic_cast<_Popup*>(pWindow); + if (pPopup) + { + if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) + { + popupRect = pPopup->GetNativeBounds(true); + } + else + { + popupRect = pPopup->GetNativeBounds(false); + } + } + + accumPoint.x = accumPoint.x + winPoint.x + _CoordinateSystemUtils::ConvertToFloat(popupRect).x; + accumPoint.y = accumPoint.y + winPoint.y + _CoordinateSystemUtils::ConvertToFloat(popupRect).y; } absoluteBounds.x = accumPoint.x; diff --git a/src/ui/FUi_EflUiEventManager.cpp b/src/ui/FUi_EflUiEventManager.cpp index dcbe33d..7ef7090 100644 --- a/src/ui/FUi_EflUiEventManager.cpp +++ b/src/ui/FUi_EflUiEventManager.cpp @@ -46,10 +46,12 @@ #include "FUiAnim_ControlVisualElement.h" #include "FUiAnim_RootVisualElement.h" #include "FUiAnim_EflLayer.h" +#include "FUiCtrl_Popup.h" using namespace std; using namespace Tizen::Ui; using namespace Tizen::Ui::Animations; +using namespace Tizen::Ui::Controls; using namespace Tizen::Graphics; using namespace Tizen::Base::Collection; using namespace Tizen::Base; @@ -719,10 +721,24 @@ private: pWindow = pControlManager->GetTouchedWindow(); SysTryReturn(NID_UI, pWindow, null, E_SYSTEM, "[E_SYSTEM] A system error occurred."); + Rectangle popupRect(0, 0, 0, 0); + _Popup* pPopup = dynamic_cast<_Popup*>(pWindow); + if (pPopup) + { + if (pPopup->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) + { + popupRect = pPopup->GetNativeBounds(true); + } + else + { + popupRect = pPopup->GetNativeBounds(false); + } + } + Rectangle winBounds = pWindow->GetBounds(); - ptf.x = static_cast(x - winBounds.x); - ptf.y = static_cast(y - winBounds.y); + ptf.x = static_cast(x - winBounds.x - popupRect.x); + ptf.y = static_cast(y - winBounds.y - popupRect.y); pRootControlElement = dynamic_cast <_ControlVisualElement*>(pWindow->GetVisualElement()); } -- 2.7.4