From 366b84671fb5be79def734bedbaa7d1c13b8c4da Mon Sep 17 00:00:00 2001 From: woojin nam Date: Fri, 28 Jun 2013 13:33:02 +0000 Subject: [PATCH] Revert "Revert "Defect fix SetFocusControl / Check window enable state" This reverts commit 2c2ccbc4518f2c7a6f6a8cfefbfcb0b10ee473dc" This reverts commit 96286be50ce0320eba68cd2dff2712692bf0d062 Change-Id: Ief237ffc0721cc4040379a96d044ec982078191a --- src/ui/FUi_FocusManagerImpl.cpp | 5 +++++ src/ui/controls/FUiCtrl_Frame.cpp | 22 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/ui/FUi_FocusManagerImpl.cpp b/src/ui/FUi_FocusManagerImpl.cpp index 13f1ff1..51d01f5 100644 --- a/src/ui/FUi_FocusManagerImpl.cpp +++ b/src/ui/FUi_FocusManagerImpl.cpp @@ -262,6 +262,11 @@ void _FocusManagerImpl::StartFocusTraversal(_Control* pControl, FocusDirection focusDirection) { _Window* pTop = pControl->GetRootWindow(); + bool isWindowEnabled = pTop->IsEnabled(); + if (!isWindowEnabled) + { + return; + } if (pTop) { _Control* pFocusTraversalControl = pTop->GetFocusTraversalControl(pControl); diff --git a/src/ui/controls/FUiCtrl_Frame.cpp b/src/ui/controls/FUiCtrl_Frame.cpp index 89d7376..af15a84 100644 --- a/src/ui/controls/FUiCtrl_Frame.cpp +++ b/src/ui/controls/FUiCtrl_Frame.cpp @@ -816,6 +816,7 @@ _Frame::SetFocusControl(const _Control* pControl , bool on) SysAssert(pControlMgr); _Form* pForm = null; _Form* pCurrentForm = GetCurrentForm(); + _Frame* pFrame = null; const _Control* pTempControl = pControl; bool isCurrentForm = false; @@ -825,7 +826,15 @@ _Frame::SetFocusControl(const _Control* pControl , bool on) if (pForm) { - break; + pFrame = dynamic_cast<_Frame*>(pForm->GetParent()); + if (pFrame) + { + break; + } + else + { + pTempControl = pTempControl->GetParent(); + } } else { @@ -903,13 +912,22 @@ _Frame::SetFocusTraversalControl(_Control* pControl) { _Form* pForm = null; _Control* pTempControl = pControl; + _Frame* pFrame = null; while(pTempControl) { pForm = dynamic_cast<_Form*>(const_cast<_Control*>(pTempControl)); if (pForm) { - break; + pFrame = dynamic_cast<_Frame*>(pForm->GetParent()); + if (pFrame) + { + break; + } + else + { + pTempControl = pTempControl->GetParent(); + } } else { -- 2.7.4