From 9e131596ecef1860baea1e405944a5fe9a4726a5 Mon Sep 17 00:00:00 2001 From: Chulheon Date: Mon, 17 Jun 2013 21:53:08 +0900 Subject: [PATCH] fixed bug (N_SE-41739,N_SE-41731) Change-Id: Id477683c8902160db2b6ef1bd53ef2136d5cff2a --- src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp | 43 ++++++++++++++++++++++-- src/ui/controls/FUiCtrl_EditPresenter.cpp | 11 +++++- src/ui/inc/FUiCtrl_EditPresenter.h | 1 + src/ui/inc/FUi_ResourceEditConfig.h | 37 ++++++++++---------- src/ui/resource/FUi_ResourceEditConfig.cpp | 1 + 5 files changed, 72 insertions(+), 21 deletions(-) diff --git a/src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp b/src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp index cd45d97..208a64f 100644 --- a/src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp +++ b/src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp @@ -144,6 +144,10 @@ _EditCopyPasteMagnifier::CreateInstanceN(const FloatPoint& point, int handlerCur GET_SHAPE_CONFIG(EDIT::COPYPASTE_MAGNIFIER_HEIGHT, orientation, height); bounds = FloatRectangle(cursorPoint.x - width/2, cursorPoint.y - height, width, height); + if (bounds.y < 0.0f) + { + bounds.y = 0.0f; + } pCopyPasteMagnifier->SetBounds(bounds); pCopyPasteMagnifier->Open(); @@ -384,6 +388,10 @@ _EditCopyPasteMagnifier::MoveMagnifier(const FloatPoint& point, int handlerCurso { FloatRectangle bounds = FloatRectangle(point.x - GetBoundsF().width/2, point.y - GetBoundsF().height, GetBoundsF().width, GetBoundsF().height); __handlerCursorPos = handlerCursorPos; + if (bounds.y < 0.0f) + { + bounds.y = 0.0f; + } SetBounds(bounds); Invalidate(); } @@ -587,6 +595,18 @@ _EditCopyPasteHandler::ChangeHandlerBitmap(void) delete __pHandlerBitmap; __pHandlerBitmap = null; } + if (__singleHandler) + { + if (__handlerDirection == HANDLER_DIRECTION_NONE) + { + GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_ICON_CENTER_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerBitmap); + } + else + { + GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_ICON_REVERSE_CENTER_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerBitmap); + } + return; + } if (__leftHandler) { switch(__handlerDirection) @@ -867,6 +887,10 @@ _EditCopyPasteHandler::AdjustBounds(void) rect.x = cursorRect.x - __pHandlerBitmap->GetWidthF()/2.0f; rect.y = cursorRect.y + cursorRect.height; checkPoint = FloatPoint(cursorRect.x , cursorRect.y + cursorRect.height); + if (__handlerDirection == HANDLER_DIRECTION_REVERSE_2) + { + rect.y -= (cursorRect.height + __pHandlerBitmap->GetHeightF()); + } } else { @@ -999,6 +1023,7 @@ _EditCopyPasteHandler::CheckReverseStatus(void) _Edit* pEdit = __pCopyPasteManager->GetEdit(); _ControlOrientation orientation = pEdit->GetOrientation(); FloatRectangle rect = GetBoundsF(); + FloatRectangle cursorAbsBounds = __pCopyPasteManager->GetCursorBoundsF(true); if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { @@ -1012,6 +1037,20 @@ _EditCopyPasteHandler::CheckReverseStatus(void) if (__singleHandler) { + if ((__handlerDirection == HANDLER_DIRECTION_NONE) && ((cursorAbsBounds.y + cursorAbsBounds.height + rect.height) > screenSize.height)) + { + __handlerDirection = HANDLER_DIRECTION_REVERSE_2; + rect.y -= (cursorAbsBounds.height + rect.height); + __reverseCheck = true; + } + else if ((__handlerDirection == HANDLER_DIRECTION_REVERSE_2) && ((cursorAbsBounds.y + cursorAbsBounds.height + rect.height) <= screenSize.height)) + { + __handlerDirection = HANDLER_DIRECTION_NONE; + rect.y += (cursorAbsBounds.height + rect.height); + __reverseCheck = true; + } + ChangeHandlerBitmap(); + SetBounds(rect); return; } @@ -1291,7 +1330,7 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to pEditPresenter->CalculateAbsoluteCursorBounds(__rowIndex, __columnIndex, absCursorRect); } - if (absTextObjectBounds.height > (totalHeight - firstDisplayY)) + if (absTextObjectBounds.height >= (totalHeight - firstDisplayY)) { absTextObjectBounds.height = totalHeight - firstDisplayY; absTextObjectBounds.y += absCursorRect.height/2.0f; @@ -2272,7 +2311,7 @@ _EditCopyPasteManager::Show(void) __pHandle[HANDLER_TYPE_CENTER]->SetHandlerCursorPosition(__pEdit->GetCursorPosition()); // __pHandle[HANDLER_TYPE_CENTER]->MoveCopyPasteMagnifier(); } - __pHandle[HANDLER_TYPE_CENTER]->AdjustBounds(); + __pHandle[HANDLER_TYPE_CENTER]->CheckReverseStatus(); __pEdit->Invalidate(); } diff --git a/src/ui/controls/FUiCtrl_EditPresenter.cpp b/src/ui/controls/FUiCtrl_EditPresenter.cpp index a460484..c71836c 100755 --- a/src/ui/controls/FUiCtrl_EditPresenter.cpp +++ b/src/ui/controls/FUiCtrl_EditPresenter.cpp @@ -235,6 +235,7 @@ _EditPresenter::_EditPresenter(void) , __rowCursorIndex(-1) , __columnCursorIndex(-1) , __isPasswordVisible(false) + , __needToCreateCopyPastePopup(false) { } @@ -6235,7 +6236,11 @@ _EditPresenter::OnNotifiedN(IList* pArgs) if (__pCopyPasteManager) { __pCopyPasteManager->CreateHandle(); - __pCopyPasteManager->CreateCopyPastePopup(); + if (__needToCreateCopyPastePopup) + { + __pCopyPasteManager->CreateCopyPastePopup(); + __needToCreateCopyPastePopup = false; + } __pCopyPasteManager->Show(); } } @@ -7184,6 +7189,10 @@ _EditPresenter::ChangeLayout(_ControlOrientation orientation) if (__pCopyPasteManager) { + if (__pCopyPasteManager->GetCopyPastePopup()) + { + __needToCreateCopyPastePopup = true; + } __pCopyPasteManager->Release(); } diff --git a/src/ui/inc/FUiCtrl_EditPresenter.h b/src/ui/inc/FUiCtrl_EditPresenter.h index 95d7332..46b0600 100755 --- a/src/ui/inc/FUiCtrl_EditPresenter.h +++ b/src/ui/inc/FUiCtrl_EditPresenter.h @@ -581,6 +581,7 @@ private: int __rowCursorIndex; int __columnCursorIndex; bool __isPasswordVisible; + bool __needToCreateCopyPastePopup; }; // _EditPresenter }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUi_ResourceEditConfig.h b/src/ui/inc/FUi_ResourceEditConfig.h index 5909e9c..435b7d5 100644 --- a/src/ui/inc/FUi_ResourceEditConfig.h +++ b/src/ui/inc/FUi_ResourceEditConfig.h @@ -49,24 +49,25 @@ DECLARE_UI_CONFIG(EDIT); DECLARE_IMAGE_CONFIG(BG_DISABLED, 4) DECLARE_IMAGE_CONFIG(BG_EFFECT, 5) DECLARE_IMAGE_CONFIG(COPY_PASTE_ICON_CENTER_NORMAL, 6) - DECLARE_IMAGE_CONFIG(COPY_PASTE_ICON_LEFT_NORMAL, 7) - DECLARE_IMAGE_CONFIG(COPY_PASTE_ICON_RIGHT_NORMAL, 8) - DECLARE_IMAGE_CONFIG(COPY_PASTE_ICON_REVERSE_LEFT_NORMAL, 9) - DECLARE_IMAGE_CONFIG(COPY_PASTE_ICON_REVERSE_RIGHT_NORMAL, 10) - DECLARE_IMAGE_CONFIG(COPY_PASTE_SEARCH_ICON, 11) - DECLARE_IMAGE_CONFIG(COPY_PASTE_MAGNIFIER, 12) - DECLARE_IMAGE_CONFIG(BG_ROUND_NORMAL, 13) - DECLARE_IMAGE_CONFIG(BG_ROUND_EFFECT, 14) - DECLARE_IMAGE_CONFIG(CLEAR_ICON_NORMAL, 15) - DECLARE_IMAGE_CONFIG(CLEAR_ICON_PRESSED, 16) - DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_NORMAL, 17) - DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_NORMAL, 18) - DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_NORMAL, 19) - DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_EFFECT_NORMAL, 20) - DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_NORMAL, 21) - DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_EFFECT_NORMAL, 22) - DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_NORMAL, 23) - DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_EFFECT_NORMAL, 24) + DECLARE_IMAGE_CONFIG(COPY_PASTE_ICON_REVERSE_CENTER_NORMAL, 7) + DECLARE_IMAGE_CONFIG(COPY_PASTE_ICON_LEFT_NORMAL, 8) + DECLARE_IMAGE_CONFIG(COPY_PASTE_ICON_RIGHT_NORMAL, 9) + DECLARE_IMAGE_CONFIG(COPY_PASTE_ICON_REVERSE_LEFT_NORMAL, 10) + DECLARE_IMAGE_CONFIG(COPY_PASTE_ICON_REVERSE_RIGHT_NORMAL, 11) + DECLARE_IMAGE_CONFIG(COPY_PASTE_SEARCH_ICON, 12) + DECLARE_IMAGE_CONFIG(COPY_PASTE_MAGNIFIER, 13) + DECLARE_IMAGE_CONFIG(BG_ROUND_NORMAL, 14) + DECLARE_IMAGE_CONFIG(BG_ROUND_EFFECT, 15) + DECLARE_IMAGE_CONFIG(CLEAR_ICON_NORMAL, 16) + DECLARE_IMAGE_CONFIG(CLEAR_ICON_PRESSED, 17) + DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_NORMAL, 18) + DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_NORMAL, 19) + DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_NORMAL, 20) + DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_EFFECT_NORMAL, 21) + DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_NORMAL, 22) + DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_EFFECT_NORMAL, 23) + DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_NORMAL, 24) + DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_EFFECT_NORMAL, 25) DECLARE_DIMENSION_CONFIG(MIN_SIZE, 1) DECLARE_DIMENSION_CONFIG(TITLE_STYLE_MIN_SIZE, 2) diff --git a/src/ui/resource/FUi_ResourceEditConfig.cpp b/src/ui/resource/FUi_ResourceEditConfig.cpp index 2384aa9..8d088c1 100644 --- a/src/ui/resource/FUi_ResourceEditConfig.cpp +++ b/src/ui/resource/FUi_ResourceEditConfig.cpp @@ -48,6 +48,7 @@ START_UI_CONFIG(EDIT); ADD_IMAGE_CONFIG(BG_DISABLED, #00_edit_field_no_line_square_bg.#.png); ADD_IMAGE_CONFIG(BG_EFFECT, #00_edit_field_no_line_square_bg.#.png); ADD_IMAGE_CONFIG(COPY_PASTE_ICON_CENTER_NORMAL, #copy&paste_Handler_center.png); + ADD_IMAGE_CONFIG(COPY_PASTE_ICON_REVERSE_CENTER_NORMAL, #copy&paste_Handler_center_reverse.png); ADD_IMAGE_CONFIG(COPY_PASTE_ICON_LEFT_NORMAL, #copy&paste_Handler_left_01.png); ADD_IMAGE_CONFIG(COPY_PASTE_ICON_RIGHT_NORMAL, #copy&paste_Handler_right.png); ADD_IMAGE_CONFIG(COPY_PASTE_ICON_REVERSE_LEFT_NORMAL, #copy&paste_Handler_left.png); -- 2.7.4