Revert "Revert "Defect fix SetFocusControl / Check window enable state"
authorwoojin nam <w.nam@samsung.com>
Fri, 28 Jun 2013 13:33:02 +0000 (13:33 +0000)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Fri, 28 Jun 2013 13:33:02 +0000 (13:33 +0000)
 This reverts commit 2c2ccbc4518f2c7a6f6a8cfefbfcb0b10ee473dc"

This reverts commit 96286be50ce0320eba68cd2dff2712692bf0d062

Change-Id: Ief237ffc0721cc4040379a96d044ec982078191a

src/ui/FUi_FocusManagerImpl.cpp
src/ui/controls/FUiCtrl_Frame.cpp

index 13f1ff1..51d01f5 100644 (file)
@@ -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);
index 89d7376..af15a84 100644 (file)
@@ -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
                {