}
void
-_Control::SetTouchCapture(bool allowOutOfBounds)
+_Control::SetTouchCapture(_TouchCapture touchCaptureType)
{
_TouchManager* pTouchManager = _TouchManager::GetInstance();
SysTryReturnVoidResult(NID_UI, pTouchManager != null, E_SYSTEM, "[E_SYSTEM] TouchManager Instance is null");
- pTouchManager->SetCapturedControl(this, allowOutOfBounds);
+ pTouchManager->SetCapturedControl(this, touchCaptureType);
}
void
_TouchManager* pTouchManager = _TouchManager::GetInstance();
SysTryReturnVoidResult(NID_UI, pTouchManager != null, E_SYSTEM, "[E_SYSTEM] TouchManager Instance is null");
- pTouchManager->SetCapturedControl(null, false);
+ pTouchManager->SetCapturedControl(null, _TOUCH_CAPTURE_ALLOW_INNER_BOUNDS);
}
_Control*
if (pCapturedControl)
{
- if (pTouchManager->IsCaptureAllowedOutOfBounds())
+ if (pTouchManager->GetCaptureAllowedType() == _TOUCH_CAPTURE_ALLOW_OUT_OF_BOUNDS)
{
pControl = pCapturedControl;
}
+ else if (pTouchManager->GetCaptureAllowedType() == _TOUCH_CAPTURE_ALLOW_OWNER_BOUNDS)
+ {
+ Tizen::Graphics::Rectangle rc(pCapturedControl->GetAbsoluteBounds());
+ Tizen::Graphics::Rectangle ownerRc((dynamic_cast<_Window*>(pCapturedControl)->GetOwner())->GetAbsoluteBounds());
+
+ if ((x < ownerRc.x) || (x > (ownerRc.x + ownerRc.width)) || (y < ownerRc.y) || (y > (ownerRc.y + ownerRc.height)))
+ {
+ pControl = dynamic_cast<_Window*>(pCapturedControl)->GetOwner();
+ }
+
+ if ((x < rc.x) || (x > (rc.x + rc.width)) || (y < rc.y) || (y > (rc.y + rc.height)))
+ {
+ pControl = pCapturedControl;
+ }
+ }
else
{
Tizen::Graphics::Rectangle rc(pCapturedControl->GetAbsoluteBounds());
, __touchCanceled(false)
, __touchAllowed(true)
, __pTouchEventListener(null)
- , __captureAllowOutOfBounds(false)
+ , __touchCaptureType(_TOUCH_CAPTURE_ALLOW_INNER_BOUNDS)
, __isSendingDelayedEvent(true)
, __touchCanceledOnGestureSuccess(false)
, __changedTouchableTarget(null)
}
void
-_TouchManager::SetCapturedControl(const _Control* pControl, bool allowOutOfBounds)
+_TouchManager::SetCapturedControl(const _Control* pControl, _TouchCapture touchCaptureType)
{
if (pControl)
{
__capturedControlHandle = _ControlHandle();
}
- __captureAllowOutOfBounds = allowOutOfBounds;
+ __touchCaptureType = touchCaptureType;
}
_Control*
return pControlManager->GetObject(__capturedControlHandle);
}
-bool
-_TouchManager::IsCaptureAllowedOutOfBounds(void) const
+_TouchCapture
+_TouchManager::GetCaptureAllowedType(void) const
{
- return __captureAllowOutOfBounds;
+ return __touchCaptureType;
}
void
if (__style == CONTEXT_MENU_CORE_STYLE_LIST)
{
- SetTouchCapture();
+ SetTouchCapture(_TOUCH_CAPTURE_ALLOW_INNER_BOUNDS);
}
else
{
- SetTouchCapture(true);
+ SetTouchCapture(_TOUCH_CAPTURE_ALLOW_OUT_OF_BOUNDS);
}
SetAllAccessibilityElement();
__pDateTimeBarPresenter->StartAnimationEffect();
- SetTouchCapture();
+ SetTouchCapture(_TOUCH_CAPTURE_ALLOW_INNER_BOUNDS);
__isAttachedToMainTree = true;
else
{
__onAccessibility = true;
- __pFastScroll->SetTouchCapture(true);
+ __pFastScroll->SetTouchCapture(_TOUCH_CAPTURE_ALLOW_OUT_OF_BOUNDS);
}
_AccessibilityContainer* pAccessibilityContainer = __pFastScroll->GetAccessibilityContainer();
if (__pMessageBox->GetMsgBoxStyle() == MSGBOX_STYLE_NONE)
{
- __pMessageBox->SetTouchCapture(true);
+ __pMessageBox->SetTouchCapture(_TOUCH_CAPTURE_ALLOW_OUT_OF_BOUNDS);
}
else
{
- __pMessageBox->SetTouchCapture();
+ __pMessageBox->SetTouchCapture(_TOUCH_CAPTURE_ALLOW_INNER_BOUNDS);
}
ProcessEvent();
}
__pSubMenu->Open();
- SetTouchCapture();
+ SetTouchCapture(_TOUCH_CAPTURE_ALLOW_INNER_BOUNDS);
__subMenuIndex = mainIndex;
return E_SUCCESS;
__pOptionMenuPresenter->SetOptionMenuVisibility(true);
}
- SetTouchCapture();
+ SetTouchCapture(_TOUCH_CAPTURE_ALLOW_INNER_BOUNDS);
}
void
{
if (_ControlManager::GetInstance()->GetTopWindow() == __pOptionMenu)
{
- __pOptionMenu->SetTouchCapture();
+ __pOptionMenu->SetTouchCapture(_TOUCH_CAPTURE_ALLOW_INNER_BOUNDS);
}
}
else
if (__pOptionMenu->IsSubMenuShown() == true)
{
__pOptionMenu->DestroySubMenu();
- __pOptionMenu->SetTouchCapture();
+ __pOptionMenu->SetTouchCapture(_TOUCH_CAPTURE_ALLOW_INNER_BOUNDS);
return true;
}
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
}
- SetTouchCapture();
+ SetTouchCapture(_TOUCH_CAPTURE_ALLOW_INNER_BOUNDS);
}
else
{
r = _pDimmingLayer->SetDimmingEnabled(true);
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- SetTouchCapture();
+ SetTouchCapture(_TOUCH_CAPTURE_ALLOW_INNER_BOUNDS);
}
else
{
void SetMultiTouchEnabled(bool enabled);
bool IsMultiTouchEnabled(void) const;
- void SetTouchCapture(bool allowOutOfBounds = false);
+ void SetTouchCapture(_TouchCapture touchCaptureType);
void ReleaseTouchCapture(void);
bool IsDragEnabled(void) const;
*
* @since 2.0
*/
- void SetCapturedControl(const _Control* pControl, bool allowOutOfBounds);
+ void SetCapturedControl(const _Control* pControl, _TouchCapture touchCaptureType);
/**
* This method returns touch captured control
*/
_Control* GetCapturedControl(void) const;
- bool IsCaptureAllowedOutOfBounds(void) const;
+ _TouchCapture GetCaptureAllowedType(void) const;
/**
* This method resets touch information, point count and cursorID etc.
bool __touchCanceled;
bool __touchAllowed;
_ITouchEventListener* __pTouchEventListener;
- bool __captureAllowOutOfBounds; //will be deleted
+ _TouchCapture __touchCaptureType; //will be deleted
bool __isSendingDelayedEvent;
bool __touchCanceledOnGestureSuccess;
_Control* __changedTouchableTarget;
_CONTROL_ZORDER_UPDATE_DOWNWARD,
};
+enum _TouchCapture
+{
+ _TOUCH_CAPTURE_ALLOW_INNER_BOUNDS,
+ _TOUCH_CAPTURE_ALLOW_OWNER_BOUNDS,
+ _TOUCH_CAPTURE_ALLOW_OUT_OF_BOUNDS
+};
+
template <int V>
struct _IntToType
{