From 2727a29ce32be682149b2fff407a70bb12be83d5 Mon Sep 17 00:00:00 2001 From: Taejun Date: Mon, 8 Jul 2013 21:37:48 +0900 Subject: [PATCH] Fix N_SE-45120 Change-Id: Ie728e51cb0e0a8d05ebc2b29021ceaac89eb1436 --- src/ui/controls/FUiCtrl_Edit.cpp | 10 ++++-- src/ui/controls/FUiCtrl_EditPresenter.cpp | 56 +++++++++++++++++++++++++++---- src/ui/inc/FUiCtrl_EditPresenter.h | 3 +- 3 files changed, 59 insertions(+), 10 deletions(-) diff --git a/src/ui/controls/FUiCtrl_Edit.cpp b/src/ui/controls/FUiCtrl_Edit.cpp index b865dba..3795d65 100755 --- a/src/ui/controls/FUiCtrl_Edit.cpp +++ b/src/ui/controls/FUiCtrl_Edit.cpp @@ -2152,7 +2152,13 @@ _Edit::OnAncestorEnableStateChanged(const _Control& control) if (!enableState) { - _pEditPresenter->ChangeToUnbindState(); + _pEditPresenter->ChangeToUnbindState(false); + } + + if (this == dynamic_cast< const _Edit* >(&control)) + { + _pEditPresenter->SetKeypadEventSkipped(!enableState); + _pEditPresenter->SetCursorDisabled(!enableState); } Invalidate(); @@ -2168,7 +2174,7 @@ _Edit::OnAncestorVisibleStateChanged(const _Control& control) if (!visibleState) { - _pEditPresenter->ChangeToUnbindState(); + _pEditPresenter->ChangeToUnbindState(false); } Invalidate(); diff --git a/src/ui/controls/FUiCtrl_EditPresenter.cpp b/src/ui/controls/FUiCtrl_EditPresenter.cpp index 4fd45c6..5e19fe7 100755 --- a/src/ui/controls/FUiCtrl_EditPresenter.cpp +++ b/src/ui/controls/FUiCtrl_EditPresenter.cpp @@ -1326,6 +1326,10 @@ _EditPresenter::IsCurrentFocused(void) const return true; } } + else + { + return __pEdit->IsInternalFocused(); + } } _EditPresenter* @@ -5798,7 +5802,17 @@ _EditPresenter::SetViewModeEnabled(bool enable) if (__pInputConnection) { - __pInputConnection->SetKeyEventSkipped(enable); + if (enable) + { + __pInputConnection->SetKeyEventSkipped(true); + } + else + { + if (IsKeypadEnabled()) + { + __pInputConnection->SetKeyEventSkipped(false); + } + } } return __pEditModel->SetViewModeEnabled(enable); @@ -5901,12 +5915,38 @@ _EditPresenter::SetKeypadEnabled(bool enable) if (__pInputConnection) { - __pInputConnection->SetKeyEventSkipped(!enable); + if (!enable) + { + __pInputConnection->SetKeyEventSkipped(true); + } + else + { + if (!__pEditModel->IsViewModeEnabled()) + { + __pInputConnection->SetKeyEventSkipped(false); + } + } } return; } +void +_EditPresenter::SetKeypadEventSkipped(bool skip) +{ + if (skip) + { + __pInputConnection->SetKeyEventSkipped(true); + } + else + { + if (__pEdit->IsEnabled() && !__pEditModel->IsViewModeEnabled() && IsKeypadEnabled()) + { + __pInputConnection->SetKeyEventSkipped(false); + } + } +} + bool _EditPresenter::IsKeypadEnabled(void) { @@ -6382,7 +6422,7 @@ _EditPresenter::OnFrameRestored(const _Frame& source) } void -_EditPresenter::ChangeToUnbindState(void) +_EditPresenter::ChangeToUnbindState(bool removeFocus) { if(__latestBoundedContext != (unsigned int)this)//context is already changed. { @@ -6396,10 +6436,7 @@ _EditPresenter::ChangeToUnbindState(void) if (__isInputConnectionBound) { - if (__isKeypadExist) - { - HideKeypad(false); - } + HideKeypad(removeFocus); if (__isClipboardExist) { @@ -11429,6 +11466,11 @@ _EditPresenter::IsClearIconPressed(void) const result _EditPresenter::DrawFocusRing(Tizen::Graphics::Canvas& canvas) const { + if (IsViewModeEnabled() || !__pEdit->IsEnabled()) + { + return E_SUCCESS; + } + result r = E_SUCCESS; Bitmap* pFocusRing = null; Color color = __pEdit->GetColor(EDIT_STATUS_HIGHLIGHTED); diff --git a/src/ui/inc/FUiCtrl_EditPresenter.h b/src/ui/inc/FUiCtrl_EditPresenter.h index 029331f..3451755 100755 --- a/src/ui/inc/FUiCtrl_EditPresenter.h +++ b/src/ui/inc/FUiCtrl_EditPresenter.h @@ -141,7 +141,7 @@ public: virtual result Draw(Tizen::Graphics::Canvas& canvas); virtual result DrawCursor(Tizen::Graphics::Canvas& canvas, Tizen::Graphics::FloatRectangle& cursorRect, bool isCursorOpaque); virtual result DrawScrollBar(void); - virtual void ChangeToUnbindState(void); + virtual void ChangeToUnbindState(bool removeFocus); virtual bool OnFocusGained(void); virtual bool OnFocusLost(void); @@ -253,6 +253,7 @@ public: bool IsFocused(void) const; bool IsInternalFocused(void) const; bool IsKeypadActionEnabled(void) ; + void SetKeypadEventSkipped(bool skip); bool IsKeypadEnabled(void) ; bool IsLowerCaseModeEnabled(void) const; bool IsKeypadCommandButtonVisible(void) const; -- 2.7.4