From: Chulheon Date: Fri, 31 May 2013 12:24:06 +0000 (+0900) Subject: fixed bug (N_SE-40102) X-Git-Tag: accepted/tizen/20130924.144426~1^2~680^2~46^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31926dda7eda93d78ea5a17942cabe580c1bfdaf;p=platform%2Fframework%2Fnative%2Fuifw.git fixed bug (N_SE-40102) Change-Id: I6ba1a920c70aa6a6cabf5004f16f84d4d21b2302 --- diff --git a/src/ui/controls/FUiCtrl_Edit.cpp b/src/ui/controls/FUiCtrl_Edit.cpp index 1ea4935..20e4801 100644 --- a/src/ui/controls/FUiCtrl_Edit.cpp +++ b/src/ui/controls/FUiCtrl_Edit.cpp @@ -506,7 +506,15 @@ _Edit::Initialize(int editStyle, InputStyle inputStyle, int limitLength, GroupSt { __pTextAccessibilityElement = new _AccessibilityElement(true); __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height)); - __pTextAccessibilityElement->SetLabel(GetTitleText() + GetGuideText() + GetText()); + if ((GetEditStyle() & EDIT_STYLE_TITLE_TOP) || (GetEditStyle() & EDIT_STYLE_TITLE_LEFT)) + { + __pTextAccessibilityElement->SetLabel(GetTitleText() + GetGuideText() + GetText()); + } + else + { + __pTextAccessibilityElement->SetLabel(GetGuideText() + GetText()); + } + __pTextAccessibilityElement->SetTrait(L"Edit Field"); __pTextAccessibilityElement->SetName(L"EditText"); pEditAccessibilityContainer->AddElement(*__pTextAccessibilityElement); @@ -586,8 +594,6 @@ _Edit::GetContentSizeInternalF(bool horizontalMode, bool verticalMode) const } FloatDimension dimension(0.0f,0.0f); - float leftMargin = 0.0f; - float rightMargin = 0.0f; float textLeftMargin = 0.0f; float textRightMargin = 0.0f; float textTopMargin = 0.0f; diff --git a/src/ui/controls/FUiCtrl_EditPresenter.cpp b/src/ui/controls/FUiCtrl_EditPresenter.cpp index 3b82178..6ab659a 100644 --- a/src/ui/controls/FUiCtrl_EditPresenter.cpp +++ b/src/ui/controls/FUiCtrl_EditPresenter.cpp @@ -104,6 +104,7 @@ float _EditPresenter::__clipboardHeight = 0.0f; _EditFooterVisibleStatus _EditPresenter::__initialFooterVisibleStatus = EDIT_FOOTER_VISIBLE_STATUS_NONE; bool _EditPresenter::__footerVisibleChanged = false; unsigned int _EditPresenter::__latestBoundedContext = null; +const float _EditPresenter::TOUCH_PRESS_THRESHOLD_IN_CLEAR_AREA = 0.04f; _EditAnimationProvider::_EditAnimationProvider(void) { @@ -216,6 +217,7 @@ _EditPresenter::_EditPresenter(void) , __isFontInitialized(false) , __contentFontSize(0.0f) , __titleFontSize(0.0f) + , __defaultTouchMoveThreshold(0.0f) , __contentFontStyle(FONT_STYLE_PLAIN) , __contentTextStyle(TEXT_BOX_TEXT_STYLE_NORMAL) , __titleFontFaceName("") @@ -2922,9 +2924,12 @@ _EditPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchIn if (__pEdit->GetEditStyle() & EDIT_STYLE_CLEAR && __pTextString->GetLength() > 0) { - if ((__pressedPoint.x >= __clearIconBounds.x) && (__pressedPoint.x <= __clearIconBounds.x + __clearIconBounds.width)) // Clear Icon Pressed + if ((__pressedPoint.x >= __clearIconBounds.x) && (__pressedPoint.x <= __clearIconBounds.x + __clearIconBounds.width) + && (__pressedPoint.y >= __clearIconBounds.y) && (__pressedPoint.y <= __clearIconBounds.y + __clearIconBounds.height)) // Clear Icon Pressed { __isClearIconPressed = true; + __defaultTouchMoveThreshold = __pEdit->GetTouchPressThreshold(); + __pEdit->SetTouchPressThreshold(TOUCH_PRESS_THRESHOLD_IN_CLEAR_AREA); } } StopFlickTimer(); @@ -2992,6 +2997,7 @@ _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchI __isTouchPressed = false; __isMovingCursorByTouchMove = false; __pEdit->Invalidate(); + __pEdit->SetTouchPressThreshold(__defaultTouchMoveThreshold); } } } @@ -4491,7 +4497,11 @@ String _EditPresenter::GetText(int start, int end) const { String tempString; - SysTryReturn(NID_UI_CTRL, (start <= end), tempString, E_SYSTEM, "[E_SYSTEM] The invalid argument(start = %d, end = %d) is given.", start, end); + + if (start != 0 && end != -1) + { + SysTryReturn(NID_UI_CTRL, (start <= end), tempString, E_SYSTEM, "[E_SYSTEM] The invalid argument(start = %d, end = %d) is given.", start, end); + } int textLength = GetTextLength(); SysTryReturn(NID_UI_CTRL, (start < textLength && end < textLength), tempString, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The invalid argument(start = %d, end = %d) is given.", start, end); diff --git a/src/ui/inc/FUiCtrl_EditPresenter.h b/src/ui/inc/FUiCtrl_EditPresenter.h index 35594a3..e11b96d 100644 --- a/src/ui/inc/FUiCtrl_EditPresenter.h +++ b/src/ui/inc/FUiCtrl_EditPresenter.h @@ -554,6 +554,7 @@ private: static _EditFooterVisibleStatus __initialFooterVisibleStatus; static bool __footerVisibleChanged; static unsigned int __latestBoundedContext; + static const float TOUCH_PRESS_THRESHOLD_IN_CLEAR_AREA; wchar_t __echoChar; @@ -568,6 +569,7 @@ private: bool __isFontInitialized; float __contentFontSize; float __titleFontSize; + float __defaultTouchMoveThreshold; unsigned long __contentFontStyle; unsigned long __contentTextStyle; Tizen::Base::String __titleFontFaceName;