Fix N_SE-46297
authorTaejun <tj.twt.park@samsung.com>
Tue, 16 Jul 2013 04:49:30 +0000 (13:49 +0900)
committerTaejun <tj.twt.park@samsung.com>
Tue, 16 Jul 2013 04:49:30 +0000 (13:49 +0900)
Change-Id: I30822fe43d0e331f5a05b8d1e3829fa4f83fb9d7

src/ui/controls/FUiCtrl_Edit.cpp
src/ui/controls/FUiCtrl_EditPresenter.cpp
src/ui/inc/FUiCtrl_EditPresenter.h

index 73466c0..689af2d 100755 (executable)
@@ -2162,6 +2162,13 @@ _Edit::OnAncestorEnableStateChanged(const _Control& control)
        {
                _pEditPresenter->ChangeToUnbindState(false);
        }
+       else
+       {
+               if (_pEditPresenter->IsCurrentFocused())
+               {
+                       _pEditPresenter->InitializeFocusedCondition();
+               }
+       }
 
        if (this == dynamic_cast< const _Edit* >(&control))
        {
index 86a09ce..b74bb31 100755 (executable)
@@ -1318,16 +1318,6 @@ _EditPresenter::IsUsbKeyboardConnected(void) const
 bool
 _EditPresenter::IsCurrentFocused(void)
 {
-       if (!__pParentForm)
-       {
-               __pParentForm = GetParentForm();
-
-               if (!__pParentForm && __isKeypadCommandButtonVisible)
-               {
-                       __isKeypadCommandButtonVisible = false;
-               }
-       }
-
        _ControlManager* pControlManager = _ControlManager::GetInstance();
 
        if (pControlManager)
@@ -1348,6 +1338,51 @@ _EditPresenter::IsCurrentFocused(void)
        }
 }
 
+bool
+_EditPresenter::InitializeFocusedCondition(void)
+{
+       if (!__pParentForm)
+       {
+               __pParentForm = GetParentForm();
+
+               if (!__pParentForm && __isKeypadCommandButtonVisible)
+               {
+                       __isKeypadCommandButtonVisible = false;
+               }
+       }
+
+       if (!__pTextVisualElement)
+       {
+               result r = E_SUCCESS;
+               __pTextVisualElement = new (std::nothrow) _VisualElement;
+               SysTryReturn(NID_UI_CTRL, __pTextVisualElement != null, false, E_OUT_OF_MEMORY, "Unable to create __pTextVisualElement instance.");
+
+               r = __pTextVisualElement->Construct();
+               SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to construct", GetErrorMessage(r));
+
+               __pTextVisualElement->SetSurfaceOpaque(false);
+               __pTextVisualElement->SetImplicitAnimationEnabled(false);
+
+               __pTextVisualElement->SetShowState(true);
+
+               _VisualElement* pEditVisualElement = __pEdit->GetVisualElement();
+               SysTryCatch(NID_UI_CTRL, pEditVisualElement, , r = E_SYSTEM, "[E_SYSTEM] Unable to get root visual element.");
+
+               pEditVisualElement->AttachChild(*__pTextVisualElement);
+               SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to add child", GetErrorMessage(r));
+       }
+
+       __isCursorOpaque = true;
+
+       return true;
+
+CATCH:
+       __pTextVisualElement->Destroy();
+       __pTextVisualElement = null;
+
+       return false;
+}
+
 _EditPresenter*
 _EditPresenter::CreateInstanceN(void)
 {
index 47bfbbb..651cec0 100755 (executable)
@@ -267,6 +267,7 @@ public:
        void CheckUSBKeyboardStatus(void);
        bool IsUsbKeyboardConnected(void) const;
        bool IsCurrentFocused(void);
+       bool InitializeFocusedCondition(void);
 
        result AppendCharacter(const Tizen::Base::Character& character);
        result AppendText(const Tizen::Base::String& text);