From: DongJinJeon Date: Tue, 16 Apr 2013 05:51:14 +0000 (+0900) Subject: modify lockinputevent on Popup, contextmenu X-Git-Tag: accepted/tizen_2.1/20130425.033138~184^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6cb08cbd821590c254a7de620a6b6152de21d908;p=platform%2Fframework%2Fnative%2Fuifw.git modify lockinputevent on Popup, contextmenu Change-Id: I4c72dbb75470059b2678e59acf6d7f3a0a318381 Signed-off-by: DongJinJeon --- diff --git a/src/ui/controls/FUiCtrl_ContextMenu.cpp b/src/ui/controls/FUiCtrl_ContextMenu.cpp index 9c07616..6a3eeb4 100644 --- a/src/ui/controls/FUiCtrl_ContextMenu.cpp +++ b/src/ui/controls/FUiCtrl_ContextMenu.cpp @@ -283,7 +283,8 @@ _ContextMenu::OnAttachedToMainTree(void) __layout = _ControlManager::GetInstance()->GetOrientation(); #endif - if (GetOwner() == null) + _Control* pOwner = GetOwner(); + if (pOwner == null) { _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame()); SysTryReturn(NID_UI_CTRL, pFrame != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Current frame instance is not available."); @@ -296,9 +297,7 @@ _ContextMenu::OnAttachedToMainTree(void) #endif GET_SHAPE_CONFIG(CONTEXTMENU::ITEM_MAX_COUNT, __layout, __showItemMaxCount); } - - _Control* pOwner = GetOwner(); - if (pOwner != null && __isAttachedToMainTree == false) + else if (pOwner != null && __isAttachedToMainTree == false) { pOwner->LockInputEvent(); } diff --git a/src/ui/controls/FUiCtrl_Popup.cpp b/src/ui/controls/FUiCtrl_Popup.cpp index d45d32a..1906752 100644 --- a/src/ui/controls/FUiCtrl_Popup.cpp +++ b/src/ui/controls/FUiCtrl_Popup.cpp @@ -57,6 +57,7 @@ _Popup::_Popup(void) , _pComposedBgBitmap(null) , _pOutlineBitmap(null) , _pTitleTextAccessibilityElement(null) + , _isAttachedToMainTree(false) , __pPopupPresenter(null) , __bounds(0.0f, 0.0f, 0.0f, 0.0f) , __popupResult(POPUP_RESULT_NONE) @@ -66,7 +67,7 @@ _Popup::_Popup(void) _Popup::~_Popup(void) { _Control* pOwner = GetOwner(); - if (pOwner != null) + if (_isAttachedToMainTree == true && pOwner != null) { pOwner->UnlockInputEvent(); } @@ -404,7 +405,8 @@ _Popup::OnActivated(void) SetTouchCapture(false, false); } - if (GetOwner() == null) + _Control* pOwner = GetOwner(); + if (pOwner == null) { _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame()); SysTryReturnVoidResult(NID_UI_CTRL, pFrame != null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed."); @@ -419,6 +421,12 @@ _Popup::OnActivated(void) SetOwner(pFrame); } } + else if (pOwner != null && _isAttachedToMainTree == false) + { + pOwner->LockInputEvent(); + } + + _isAttachedToMainTree = true; _Window::OnActivated(); } @@ -432,6 +440,8 @@ _Popup::OnDeactivated(void) pOwner->UnlockInputEvent(); } + _isAttachedToMainTree = false; + ReleaseTouchCapture(); _Window::OnDeactivated(); diff --git a/src/ui/controls/FUiCtrl_ProgressPopup.cpp b/src/ui/controls/FUiCtrl_ProgressPopup.cpp index f1a53e3..5fdd57d 100755 --- a/src/ui/controls/FUiCtrl_ProgressPopup.cpp +++ b/src/ui/controls/FUiCtrl_ProgressPopup.cpp @@ -540,7 +540,8 @@ _ProgressPopup::OnActivated(void) SetTouchCapture(false, false); } - if (GetOwner() == null) + _Control* pOwner = GetOwner(); + if (pOwner == null) { _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame()); SysTryReturnVoidResult(NID_UI_CTRL, pFrame != null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed."); @@ -555,6 +556,12 @@ _ProgressPopup::OnActivated(void) SetOwner(pFrame); } } + else if (pOwner != null && _isAttachedToMainTree == false) + { + pOwner->LockInputEvent(); + } + + _isAttachedToMainTree = true; if (__isTransparent) { diff --git a/src/ui/inc/FUiCtrl_Popup.h b/src/ui/inc/FUiCtrl_Popup.h index a37b229..08c4c9d 100644 --- a/src/ui/inc/FUiCtrl_Popup.h +++ b/src/ui/inc/FUiCtrl_Popup.h @@ -154,6 +154,7 @@ protected: Tizen::Graphics::Bitmap* _pOutlineBitmap; Tizen::Ui::_AccessibilityElement* _pTitleTextAccessibilityElement; + bool _isAttachedToMainTree; private: _PopupPresenter* __pPopupPresenter;