_EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
{
int cursorPos = -1;
- int previousCursorPos = -1;
FloatRectangle cursorRect(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle absCursorRect(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle rect = GetBoundsF();
FloatPoint touchPoint(0.0f, 0.0f);
FloatPoint checkPoint(0.0f, 0.0f);
__isTouchMoving = true;
- bool cursorChange = false;
_Edit* pEdit = __pCopyPasteManager->GetEdit();
SysTryReturn(NID_UI_CTRL, pEdit, false, E_INVALID_STATE, "[E_INVALID_STATE] pEdit is null.\n");
absTextObjectBounds.y = absEditBounds.y + textObjectBounds.y;
absTextObjectBounds.width = textObjectBounds.width;
absTextObjectBounds.height = textObjectBounds.height;
- bool needToFixYPosition= false;
-
if (__touchPressedPoint.x == point.x && __touchPressedPoint.y == point.y)
{
return true;
}
- if (!__singleHandler)
- {
- previousCursorPos = __pCopyPasteManager->GetCursorPosition();
- }
-
- FloatPoint absoluteTouchMovedPoint = FloatPoint(GetBoundsF().x + point.x, GetBoundsF().y + point.y);
- if (__handlerDirection == HANDLER_DIRECTION_REVERSE_2 || __handlerDirection == HANDLER_DIRECTION_REVERSE_3)
- {
- absoluteTouchMovedPoint.y += (GetBoundsF().height + absCursorRect.height);
- }
if (__rowIndex == -1 && __columnIndex == -1)
{
pEditPresenter->CalculateCursorBounds(pEditPresenter->GetTextBoundsF(), cursorRect,__handlerCursorPos);
pEditPresenter->CalculateAbsoluteCursorBounds(__rowIndex, __columnIndex, absCursorRect);
}
- if (absTextObjectBounds.height >= (totalHeight - firstDisplayY))
+ FloatPoint absoluteTouchMovedPoint = FloatPoint(GetBoundsF().x + point.x, GetBoundsF().y + point.y);
+ //Calculate handler's position
+ if (__singleHandler)
{
- absTextObjectBounds.height = totalHeight - firstDisplayY;
- absTextObjectBounds.y += absCursorRect.height/2.0f;
- if (absTextObjectBounds.y > absoluteTouchMovedPoint.y || (absTextObjectBounds.y + absTextObjectBounds.height) < absoluteTouchMovedPoint.y)
+ touchPoint.x = absoluteTouchMovedPoint.x;
+ if (__handlerDirection == HANDLER_DIRECTION_NONE)
+ {
+ touchPoint.y = absoluteTouchMovedPoint.y - GetBoundsF().height/2.0f;
+ }
+ else // HANDLER_DIRECTION_REVERSE_2
{
- needToFixYPosition = true;
+ touchPoint.y = absoluteTouchMovedPoint.y + GetBoundsF().height/2.0f;
}
}
else
{
- absTextObjectBounds.y += absCursorRect.height/2.0f;
- if (firstDisplayY == 0.0f && absTextObjectBounds.y > absoluteTouchMovedPoint.y)
+ if (__leftHandler)
+ {
+ if (__handlerDirection == HANDLER_DIRECTION_NONE)
+ {
+ touchPoint.x = absoluteTouchMovedPoint.x + GetBoundsF().width/2.0f;
+ touchPoint.y = absoluteTouchMovedPoint.y - GetBoundsF().height/2.0f;
+ }
+ else if (__handlerDirection == HANDLER_DIRECTION_REVERSE_1)
+ {
+ touchPoint.x = absoluteTouchMovedPoint.x - GetBoundsF().width/2.0f;
+ touchPoint.y = absoluteTouchMovedPoint.y - GetBoundsF().height/2.0f;
+ }
+ else if (__handlerDirection == HANDLER_DIRECTION_REVERSE_2)
+ {
+ touchPoint.x = absoluteTouchMovedPoint.x + GetBoundsF().width/2.0f;
+ touchPoint.y = absoluteTouchMovedPoint.y + GetBoundsF().height/2.0f;
+ }
+ else if (__handlerDirection == HANDLER_DIRECTION_REVERSE_3)
+ {
+ touchPoint.x = absoluteTouchMovedPoint.x - GetBoundsF().width/2.0f;
+ touchPoint.y = absoluteTouchMovedPoint.y + GetBoundsF().height/2.0f;
+ }
+ }
+ else
+ {
+ if (__handlerDirection == HANDLER_DIRECTION_NONE)
+ {
+ touchPoint.x = absoluteTouchMovedPoint.x - GetBoundsF().width/2.0f;
+ touchPoint.y = absoluteTouchMovedPoint.y - GetBoundsF().height/2.0f;
+ }
+ else if (__handlerDirection == HANDLER_DIRECTION_REVERSE_1)
+ {
+ touchPoint.x = absoluteTouchMovedPoint.x + GetBoundsF().width/2.0f;
+ touchPoint.y = absoluteTouchMovedPoint.y - GetBoundsF().height/2.0f;
+ }
+ else if (__handlerDirection == HANDLER_DIRECTION_REVERSE_2)
+ {
+ touchPoint.x = absoluteTouchMovedPoint.x - GetBoundsF().width/2.0f;
+ touchPoint.y = absoluteTouchMovedPoint.y + GetBoundsF().height/2.0f;
+ }
+ else if (__handlerDirection == HANDLER_DIRECTION_REVERSE_3)
+ {
+ touchPoint.x = absoluteTouchMovedPoint.x + GetBoundsF().width/2.0f;
+ touchPoint.y = absoluteTouchMovedPoint.y + GetBoundsF().height/2.0f;
+ }
+ }
+ }
+ if (totalHeight - firstDisplayY < absTextObjectBounds.height)
+ {
+ absTextObjectBounds.height = totalHeight - firstDisplayY - 1.0f; // check TextObject
+ }
+
+ if (totalLine != 1) //single line edit doesn't need to adjust horizontal value.
+ {
+ if (absTextObjectBounds.x > touchPoint.x)
+ {
+ touchPoint.x = absTextObjectBounds.x;
+ }
+ if (absTextObjectBounds.x + absTextObjectBounds.width <= touchPoint.x) // check FloatRectangle Contains?
+ {
+ touchPoint.x = absTextObjectBounds.x + absTextObjectBounds.width - 1.0f;
+ }
+ }
+ if (absTextObjectBounds.y > touchPoint.y)
+ {
+ if (totalLine == 1 || firstDisplayY == 0.0f) // whether need to scroll the text or not
{
- needToFixYPosition = true;
+ touchPoint.y = absTextObjectBounds.y; //not need to scroll the text.
}
- else if ((totalHeight - firstDisplayY) == absTextObjectBounds.height && (absTextObjectBounds.y + absTextObjectBounds.height) < absoluteTouchMovedPoint.y)
+ }
+ if (absTextObjectBounds.y + absTextObjectBounds.height < touchPoint.y)
+ {
+ if (totalLine == 1 || (totalHeight - firstDisplayY < textObjectBounds.height) || curCursorLine == (totalLine - 1)) // || pTextObject->IsDisplayedLastLine()) // whether need to scroll the text or not
{
- needToFixYPosition = true;
+ touchPoint.y = absTextObjectBounds.y + absTextObjectBounds.height - 1.0f; // check TextObject
}
}
if (curCursorLine == nextHandlerLine)
{
- if (__leftHandler && absoluteTouchMovedPoint.y > absCursorRect.y)
+ if (__leftHandler && absoluteTouchMovedPoint.y >= absCursorRect.y + absCursorRect.height)
{
- needToFixYPosition = true;
+ touchPoint.y = absCursorRect.y + absCursorRect.height/2.0f;
}
- else if (!__leftHandler && absoluteTouchMovedPoint.y < absCursorRect.y)
+ else if (!__leftHandler && absoluteTouchMovedPoint.y <= absCursorRect.y + absCursorRect.height)
{
- needToFixYPosition = true;
+ touchPoint.y = absCursorRect.y + absCursorRect.height/2.0f;
}
}
}
- touchPoint.x = cursorRect.x + (point.x - __touchPressedPoint.x);
- if (totalLine == 1 || needToFixYPosition)
- {
- touchPoint.y = cursorRect.y + cursorRect.height/2;
- }
- else
+ touchPoint.x = touchPoint.x - absEditBounds.x - textObjectBounds.x;
+ touchPoint.y = touchPoint.y - absEditBounds.y - textObjectBounds.y;
+
+ if (Math::Abs(touchPoint.y) < 1)
{
- touchPoint.y = cursorRect.y + cursorRect.height + (point.y - __touchPressedPoint.y);
+ touchPoint.y = 0.0f;
}
+
int rowIndex = -1;
int columnIndex = -1;
- bool cursorPosFromTouch = false;
- cursorPos = pEditPresenter->GetCursorPositionAt(touchPoint, rowIndex, columnIndex, true);
+ cursorPos = pTextObject->GetTextIndexFromPosition(touchPoint.x, touchPoint.y, rowIndex, columnIndex, true);
- if (cursorPos != -1 && __handlerCursorPos != cursorPos)
+ if (__handlerCursorPos == cursorPos)
{
- cursorPosFromTouch = true;
- FloatRectangle cursorBounds(0.0f, 0.0f, 0.0f, 0.0f);
- if (__rowIndex == -1 && __columnIndex == -1)
- {
- pEdit->CalculateAbsoluteCursorBounds(cursorPos, cursorBounds);
- }
- else
- {
- pEditPresenter->CalculateAbsoluteCursorBounds(__rowIndex, __columnIndex, cursorBounds);
- }
- cursorChange = true;
- checkPoint.x = cursorBounds.x;
-
- if (absoluteTouchMovedPoint.y -__absoluteTouchPressedPoint.y >= 0.0f || totalLine == 1)
- {
- checkPoint.y = cursorBounds.y + cursorBounds.height;
- }
- else
- {
- checkPoint.y = cursorBounds.y;
- }
+ return true;
}
- if (cursorPos == -1 || (cursorChange && !__pCopyPasteManager->CheckHandleBounds(FloatPoint(checkPoint.x, checkPoint.y))))
+ if (cursorPos == -1)
{
- if (cursorPos != -1)
+ //To get cursorPos
+ if (totalLine != 1)
{
- if (totalLine == 1)
+ if (absoluteTouchMovedPoint.y > (absCursorRect.y + absCursorRect.height))
{
- pTextObject->SetFirstDisplayLineIndexFromTextIndex(cursorPos);
- }
- else
- {
- if (absoluteTouchMovedPoint.y -__absoluteTouchPressedPoint.y >= 0.0f)
- {
- if (curCursorLine < totalLine - 1)
- {
- if (!pTextObject->IsDisplayedLastLine())
- {
- int line = pTextObject->GetFirstDisplayLineIndex();
- pTextObject->SetFirstDisplayLineIndex(line+1);
- }
- else
- {
- if (__singleHandler || __pCopyPasteManager->CheckHandlePosition(__leftHandler, cursorPos))
- {
- __pCopyPasteManager->SetCursorPosition(cursorPos);
- pEditPresenter->ScrollPanelToCursorPosition(true);
- }
- else
- {
- return true;
- }
- }
- }
- }
- else
- {
- if (curCursorLine !=0)
- {
- if (!pTextObject->IsDisplayedFirstLine())
- {
- int line = pTextObject->GetFirstDisplayLineIndex();
- pTextObject->SetFirstDisplayLineIndex(line-1);
- }
- else
- {
- __pCopyPasteManager->SetCursorPosition(cursorPos);
- pEditPresenter->ScrollPanelToCursorPosition(true);
- }
- }
- }
- }
- }
- else
- {
- if (totalLine == 1)
- {
- if (point.x - __touchPressedPoint.x == 0.0f)
- {
- return true;
-
- }
- else if (point.x - __touchPressedPoint.x > 0.0f)
- {
- if (__handlerCursorPos == pEditPresenter->GetTextLength())
- {
- cursorPos = __handlerCursorPos;
- }
- else
- {
- cursorPos = __handlerCursorPos + 1;
-
- if (!__singleHandler && __leftHandler && (cursorPos == pEditPresenter->GetTextLength()))
- {
- cursorPos = __handlerCursorPos;
- }
- }
- }
- else
+ if (curCursorLine < totalLine - 1)
{
- if (__handlerCursorPos != 0)
+ int offset = __handlerCursorPos - pTextObject->GetFirstTextIndexAt(curCursorLine);
+ int firstTextIndex = pTextObject->GetFirstTextIndexAt(curCursorLine+1);
+ cursorPos = offset + firstTextIndex;
+ int textLength = pTextObject->GetTextLengthAt(curCursorLine+1);
+ if (offset > textLength)
{
- cursorPos = __handlerCursorPos - 1;
-
- if (!__singleHandler && __leftHandler)
- {
- pTextObject->SetFirstDisplayLineIndexFromTextIndex(cursorPos);
- }
+ cursorPos = firstTextIndex+textLength;
}
}
- if (point.y < 0.0f || (point.y > GetBoundsF().height))
- {
- return true;
- }
}
else
{
- if (absoluteTouchMovedPoint.y -__absoluteTouchPressedPoint.y >= 0.0f)
+ if (curCursorLine !=0)
{
- if (curCursorLine < totalLine - 1)
+ if (__rowIndex == 0)
{
- int offset = __handlerCursorPos - pTextObject->GetFirstTextIndexAt(curCursorLine);
- int firstTextIndex = pTextObject->GetFirstTextIndexAt(curCursorLine+1);
- cursorPos = offset + firstTextIndex;
- int textLength = pTextObject->GetTextLengthAt(curCursorLine+1);
- if (offset > textLength)
- {
- cursorPos = firstTextIndex+textLength;
- }
- if (!pTextObject->IsDisplayedLastLine())
- {
- int line = pTextObject->GetFirstDisplayLineIndex();
- pTextObject->SetFirstDisplayLineIndex(line+1);
- __pCopyPasteManager->SetCursorPosition(cursorPos);
- pEditPresenter->ScrollPanelToCursorPosition(true);
- }
- else
- {
- if (__singleHandler || __pCopyPasteManager->CheckHandlePosition(__leftHandler, cursorPos))
- {
- __pCopyPasteManager->SetCursorPosition(cursorPos);
- pEditPresenter->ScrollPanelToCursorPosition(true);
- }
- else
- {
- return true;
- }
- }
+ return true;
}
- }
- else
- {
- if (curCursorLine !=0)
+ int offset = __handlerCursorPos - pTextObject->GetFirstTextIndexAt(curCursorLine);
+ int firstTextIndex = pTextObject->GetFirstTextIndexAt(curCursorLine-1);
+ cursorPos = offset + firstTextIndex;
+ int textLength = pTextObject->GetTextLengthAt(curCursorLine-1);
+ if (offset > textLength)
{
- if (__rowIndex == 0)
- {
- return true;
- }
- int offset = __handlerCursorPos - pTextObject->GetFirstTextIndexAt(curCursorLine);
- int firstTextIndex = pTextObject->GetFirstTextIndexAt(curCursorLine-1);
- cursorPos = offset + firstTextIndex;
- int textLength = pTextObject->GetTextLengthAt(curCursorLine-1);
- if (offset > textLength)
- {
- cursorPos = firstTextIndex+textLength;
- }
- if (!pTextObject->IsDisplayedFirstLine())
- {
- int line = pTextObject->GetFirstDisplayLineIndex();
- pTextObject->SetFirstDisplayLineIndex(line-1);
- __pCopyPasteManager->SetCursorPosition(cursorPos);
- pEditPresenter->ScrollPanelToCursorPosition(true);
- }
- else
- {
- __pCopyPasteManager->SetCursorPosition(cursorPos);
- pEditPresenter->ScrollPanelToCursorPosition(true);
- }
+ cursorPos = firstTextIndex+textLength;
}
}
}
}
+ if (cursorPos == -1)
+ {
+ return true;
+ }
}
- if (!__singleHandler && !__pCopyPasteManager->CheckHandlePosition(__leftHandler, cursorPos))
+ if (__handlerCursorPos == cursorPos)
{
- __pCopyPasteManager->SetCursorPosition(previousCursorPos);
- pEditPresenter->SetCursorChangedFlag(!__leftHandler);
-
- if ((__pCopyPasteManager->GetEdit()->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
- {
- _EditCopyPasteManager::HandlerType nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_MAX;
- if (__leftHandler)
- {
- nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_RIGHT;
- }
- else
- {
- nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_LEFT;
- }
- int nextHandler = __pCopyPasteManager->GetHandlerCursorPosition(nextHandlerType);
- if (Math::Abs(nextHandler - __handlerCursorPos) <= 1)
- {
- pTextObject->SetFirstDisplayLineIndexFromTextIndex(nextHandler);
- }
- }
return true;
}
-
- if (cursorPos == -1 || __handlerCursorPos == cursorPos)
+ if (!__singleHandler)
{
- if (!__singleHandler)
+ if (!__pCopyPasteManager->CheckHandlePosition(__leftHandler, cursorPos))
{
- __pCopyPasteManager->SetCursorPosition(previousCursorPos);
- pEditPresenter->SetCursorChangedFlag(!__leftHandler);
- }
- if (!__singleHandler && (__pCopyPasteManager->GetEdit()->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
- {
- _EditCopyPasteManager::HandlerType nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_MAX;
- if (__leftHandler)
- {
- nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_RIGHT;
- }
- else
- {
- nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_LEFT;
- }
- int nextHandler = __pCopyPasteManager->GetHandlerCursorPosition(nextHandlerType);
- if (Math::Abs(nextHandler - __handlerCursorPos) <= 1)
+ if (totalLine == 1)
{
- pTextObject->SetFirstDisplayLineIndexFromTextIndex(nextHandler);
+ _EditCopyPasteManager::HandlerType nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_MAX;
+ if (__leftHandler)
+ {
+ nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_RIGHT;
+ }
+ else
+ {
+ nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_LEFT;
+ }
+ int nextHandler = __pCopyPasteManager->GetHandlerCursorPosition(nextHandlerType);
+ if (Math::Abs(nextHandler - __handlerCursorPos) <= 1)
+ {
+ pTextObject->SetFirstDisplayLineIndexFromTextIndex(nextHandler);
+ }
}
+ return true;
}
- return true;
}
- if (cursorPosFromTouch && (rowIndex != -1 && columnIndex != -1))
+ if (rowIndex > -1 && columnIndex > -1)
{
__rowIndex = rowIndex;
__columnIndex = columnIndex;
_EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
- pEcoreEvas->SetWindowBounds(*GetRootWindow(), _CoordinateSystemUtils::ConvertToInteger(bounds));
+ pEcoreEvas->SetWindowBounds(*GetRootWindow(), bounds);
result r = GetLastResult();
SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
_EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
- pEcoreEvas->SetWindowBounds(*GetRootWindow(), _CoordinateSystemUtils::ConvertToInteger(bounds));
+ pEcoreEvas->SetWindowBounds(*GetRootWindow(), bounds);
result r = GetLastResult();
SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
{
editShowAreaAbsRect = editAbsRect;
FloatRectangle textObjectBounds = __pEditPresenter->GetTextBoundsF();
- editShowAreaAbsRect.x += textObjectBounds.x;
- editShowAreaAbsRect.y += textObjectBounds.y;
- editShowAreaAbsRect.width = textObjectBounds.width;
- if (!(__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
+
+ if (!(__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN))
{
- editShowAreaAbsRect.height = textObjectBounds.height;
+ editShowAreaAbsRect.x += textObjectBounds.x;
+ editShowAreaAbsRect.y += textObjectBounds.y;
+ editShowAreaAbsRect.width = textObjectBounds.width;
+
+ if (!(__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
+ {
+ editShowAreaAbsRect.height = textObjectBounds.height;
+ }
}
if (commandButtonExist)
__pEdit->CalculateAbsoluteCursorBounds(start, startRect);
__pEdit->CalculateAbsoluteCursorBounds(end, endRect);
- Point leftHandler(startRect.x, startRect.y + startRect.height);
- Point rightHandler(endRect.x, endRect.y + endRect.height);
+ FloatPoint leftHandler(startRect.x, startRect.y + startRect.height);
+ FloatPoint rightHandler(endRect.x, endRect.y + endRect.height);
__pHandle[HANDLER_TYPE_LEFT] = _EditCopyPasteHandler::CreateInstanceN(leftHandler, start, this, false, true);
__pHandle[HANDLER_TYPE_RIGHT] = _EditCopyPasteHandler::CreateInstanceN(rightHandler, end, this, false, false);
{
FloatRectangle centerRect;
__pEdit->CalculateAbsoluteCursorBounds(__pEdit->GetCursorPosition(), centerRect);
- Point centerHandler(centerRect.x, centerRect.y + centerRect.height);
+ FloatPoint centerHandler(centerRect.x, centerRect.y + centerRect.height);
__pHandle[HANDLER_TYPE_CENTER] = _EditCopyPasteHandler::CreateInstanceN(centerHandler, __pEdit->GetCursorPosition(), this, true, true);
#if EDIT_COPY_PASTE_MAGNIFIER
if (__pEdit->GetCursorPosition() != __pHandle[HANDLER_TYPE_CENTER]->GetHandlerCursorPosition())
{
__pHandle[HANDLER_TYPE_CENTER]->SetHandlerCursorPosition(__pEdit->GetCursorPosition());
-// __pHandle[HANDLER_TYPE_CENTER]->MoveCopyPasteMagnifier();
}
__pHandle[HANDLER_TYPE_CENTER]->AdjustBounds();
__pHandle[HANDLER_TYPE_CENTER]->CheckReverseStatus();
- __pEdit->Invalidate();
+ __pHandle[HANDLER_TYPE_CENTER]->Invalidate();
+ __pEditPresenter->DrawText();
}
if (__pHandle[HANDLER_TYPE_LEFT] && __pHandle[HANDLER_TYPE_RIGHT])
__pHandle[HANDLER_TYPE_RIGHT]->CheckReverseStatus();
__pHandle[HANDLER_TYPE_LEFT]->Invalidate();
__pHandle[HANDLER_TYPE_RIGHT]->Invalidate();
- __pEdit->Invalidate();
+ __pEditPresenter->DrawText();
}
if (__pCopyPastePopup)
FloatRectangle panelAbsoulteBounds(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle editAbsBounds = __pEdit->GetAbsoluteBoundsF();
FloatRectangle textObjectBounds = __pEditPresenter->GetTextBoundsF();
- editAbsBounds.x += textObjectBounds.x;
- editAbsBounds.y += textObjectBounds.y;
- editAbsBounds.width = textObjectBounds.width;
- if (!(__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
+ if (!(__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN))
{
- editAbsBounds.height = textObjectBounds.height;
+ editAbsBounds.x += textObjectBounds.x;
+ editAbsBounds.y += textObjectBounds.y;
+ editAbsBounds.width = textObjectBounds.width;
+
+ if (!(__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
+ {
+ editAbsBounds.height = textObjectBounds.height;
+ }
}
_Toolbar* pCommandButton = __pEditPresenter->GetKeypadCommandButton();
{
if (__clipboardConnected)
{
+ if (__isCopyPasteManagerExist)
+ {
+ InitializeCopyPasteManager();
+ __pTextObject->SetBlock(false);
+ __isTextBlocked = false;
+ }
+
if (__pClipboard)
{
__pClipboard->HidePopup();
if (__pScrollBar != null && __pEdit != null)
{
- result r = __pEdit->DetachSystemChild(*__pScrollBar);
-
- if (r == E_SUCCESS)
- {
- delete __pScrollBar;
- __pScrollBar = null;
- }
+ __pEdit->DetachSystemChild(*__pScrollBar);
+ delete __pScrollBar;
+ __pScrollBar = null;
}
if (__pFlickAnimationTimer)
Bitmap* pEditReplacedBitmapClear = null;
Color editClearIconColor;
- if (__isClearIconPressed)
+ if (!__pEdit->IsEnabled())
+ {
+ r = GET_BITMAP_CONFIG_N(EDIT::CLEAR_ICON_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pEditBitmapClear);
+
+ if (pEditBitmapClear == null)
+ {
+ return E_SYSTEM;
+ }
+
+ GET_COLOR_CONFIG(EDIT::CLEAR_ICON_DISABLED, editClearIconColor);
+ }
+ else if (__isClearIconPressed)
{
r = GET_BITMAP_CONFIG_N(EDIT::CLEAR_ICON_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pEditBitmapClear);
}
else if (editStyle & EDIT_STYLE_TITLE_TOP)
{
+ result r = E_SUCCESS;
float titletHeight = 0.0f;
float titleTextTopMargin = 0.0f;
GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_RECT_HEIGHT, orientation, titletHeight);
GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_TEXT_TOP_MARGIN, orientation, titleTextTopMargin);
+ _FontImpl* fontImpl = _FontImpl::GetInstance(*__pFont);
+ SysTryReturnVoidResult(NID_UI_CTRL, fontImpl != null, E_SYSTEM, "[E_SYSTEM] fontImpl is null.");
+
+ float originalSize = fontImpl->GetSizeF();
+ float titleFontSize = 0.0f;
+ GET_SHAPE_CONFIG(EDIT::DEFAULT_TITLE_FONT_SIZE, __pEdit->GetOrientation(), titleFontSize);
+
+ r = fontImpl->SetSize(titleFontSize);
+ SysTryReturnVoidResult(NID_UI_CTRL, !(IsFailed(r)), r, "SetSize is failed.");
+
+ if (titletHeight < fontImpl->GetMaxHeightF())
+ {
+ titleTextTopMargin -= (fontImpl->GetMaxHeightF()-titletHeight);
+ titletHeight = fontImpl->GetMaxHeightF();
+ }
+
+ r = fontImpl->SetSize(originalSize);
+ SysTryReturnVoidResult(NID_UI_CTRL, !(IsFailed(r)), r, "SetSize is failed.");
+
leftBorder = leftMargin;
rightBorder = rightMargin;
topBorder = titletHeight + titleTextTopMargin;
float titleTextTopMargin = 0.0f;
float titleTextBottomMargin = 0.0f;
float clearIconWidth = 0.0f;
+ float titletHeight = 0.0f;
_ControlOrientation orientation = __pEdit->GetOrientation();
GET_SHAPE_CONFIG(EDIT::FIELD_BOTTOM_MARGIN, orientation, bottomMargin);
GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_TEXT_TOP_MARGIN, orientation, titleTextTopMargin);
GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_TEXT_BOTTOM_MARGIN, orientation, titleTextBottomMargin);
GET_SHAPE_CONFIG(EDIT::CLEAR_ICON_WIDTH, orientation, clearIconWidth);
+ GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_RECT_HEIGHT, orientation, titletHeight);
if (!(editStyle & EDIT_STYLE_SINGLE_LINE))
{
__textObjectBounds.height = __clientBounds.height - textBottomMargin;
__titleBounds.x = titleTextLeftMargin;
+
+ _FontImpl* fontImpl = _FontImpl::GetInstance(*__pFont);
+ SysTryReturnResult(NID_UI_CTRL, fontImpl != null, E_SYSTEM, "fontImpl is null.");
+
+ float originalSize = fontImpl->GetSizeF();
+ float titleFontSize = 0.0f;
+ GET_SHAPE_CONFIG(EDIT::DEFAULT_TITLE_FONT_SIZE, __pEdit->GetOrientation(), titleFontSize);
+
+ r = fontImpl->SetSize(titleFontSize);
+ SysTryReturnResult(NID_UI_CTRL, !(IsFailed(r)), r, "SetSize is failed.");
+
+ if (titletHeight < fontImpl->GetMaxHeightF())
+ {
+ titleTextTopMargin -= (fontImpl->GetMaxHeightF()-titletHeight);
+ }
+
+ r = fontImpl->SetSize(originalSize);
+ SysTryReturnResult(NID_UI_CTRL, !(IsFailed(r)), r, "SetSize is failed.");
+
__titleBounds.y = titleTextTopMargin;
- __titleBounds.width = bounds.width - __titleBounds.x
- - titleTextRightMargin;
+ __titleBounds.width = bounds.width - __titleBounds.x - titleTextRightMargin;
__titleBounds.height = bounds.height - __titleBounds.y - __clientBounds.height
- bottomMargin;