void CaptureTextArea(Canvas& canvas);
void MoveMagnifier(const FloatPoint& point, int handlerCursorPos);
Bitmap* GetMagnifierBitmap(void) const;
+ virtual result OnAttachedToMainTree(void);
private:
_EditCopyPasteMagnifier(const _EditCopyPasteMagnifier& value);
return null;
}
+result
+_EditCopyPasteMagnifier::OnAttachedToMainTree(void)
+{
+ result r = E_SUCCESS;
+
+ if (GetOwner() == null)
+ {
+ _Edit* pEdit = __pCopyPasteManager->GetEdit();
+ SysTryReturnResult(NID_UI_CTRL, pEdit, GetLastResult(), "Unable to get pEdit.");
+
+ _EditPresenter* pEditPresenter = pEdit->GetPresenter();
+ SysTryReturnResult(NID_UI_CTRL, pEdit, GetLastResult(), "Unable to get pEditPresenter.");
+
+ _Form* pParentForm = pEditPresenter->GetParentForm();
+ if (pParentForm)
+ {
+ SetOwner(pParentForm);
+ }
+ else
+ {
+ _Form* pForm = null;
+ _Frame* pCurrentFrame = dynamic_cast <_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
+ if (pCurrentFrame)
+ {
+ pForm = pCurrentFrame->GetCurrentForm();
+ if (pForm)
+ {
+ SetOwner(pForm);
+ }
+ else
+ {
+ SetOwner(pCurrentFrame);
+ }
+ }
+ }
+ }
+
+ return r;
+}
+
void
_EditCopyPasteMagnifier::OnDraw(void)
{
+ _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+ SysTryReturnVoidResult(NID_UI_CTRL, pEcoreEvas, E_INVALID_STATE, "pEcoreEvas is null.");
+
+ pEcoreEvas->SetWindowBounds(*GetRootWindow(), GetBoundsF());
+
Canvas* pCanvas = GetCanvasN();
if (pCanvas == null)
{
SysTryReturnVoidResult(NID_UI_CTRL, pTextVisualElement, E_INVALID_STATE, "pTextVisualElement is null.");
Canvas* pTextCanvas = pTextVisualElement->GetCanvasN();
+ SysTryReturnVoidResult(NID_UI_CTRL, pTextCanvas, E_INVALID_STATE, "pTextCanvas is null.");
float captureWidth = 0.0f;
float captureHeight = 0.0f;
FloatRectangle textVisualElementBounds = pTextVisualElement->GetBounds();
FloatRectangle captureBounds(0.0f, 0.0f, 0.0f, 0.0f);
-
if (cursorBounds.x >= captureWidth/2.0f)
{
captureBounds.x = cursorBounds.x - captureWidth/2.0f;
}
else
{
- captureBounds.x = captureWidth/2.0f - cursorBounds.x;
+ captureBounds.x = 0.0f;
}
+
if (cursorBounds.x <= textVisualElementBounds.width - captureWidth/2.0f)
{
- captureBounds.width = captureWidth;
+ if (captureBounds.x != 0.0f)
+ {
+ captureBounds.width = captureWidth;
+ }
+ else
+ {
+ captureBounds.width = captureWidth/2.0f + cursorBounds.x;
+ }
}
else
{
bitmap.Construct(*pTextCanvas, captureBounds);
bitmap.Scale(FloatDimension(bitmap.GetWidth()*1.5f, bitmap.GetHeight()*1.5f));
- canvas.DrawBitmap(FloatPoint(capturePosX, capturePosY), bitmap);
+ if (captureBounds.x != 0.0f)
+ {
+ canvas.DrawBitmap(FloatPoint(capturePosX, capturePosY), bitmap);
+ }
+ else
+ {
+
+ canvas.DrawBitmap(FloatPoint(capturePosX + (captureWidth/2.0f -cursorBounds.x)*1.5f, capturePosY), bitmap);
+ }
+
delete pTextCanvas;
}
screenSize.height = pControlManager->GetScreenSizeF().width;
}
+ if (__singleHandler)
+ {
+ return;
+ }
+
if (__leftHandler)
{
if (((__handlerDirection == HANDLER_DIRECTION_NONE) || (__handlerDirection == HANDLER_DIRECTION_REVERSE_2)) && rect.x < 0.0f)
}
else if (((__handlerDirection == HANDLER_DIRECTION_NONE) || (__handlerDirection == HANDLER_DIRECTION_REVERSE_1)) && ((rect.y + rect.height) > screenSize.height))
{
- if ((__handlerDirection == HANDLER_DIRECTION_NONE) && rect.x < 0.0f)
+ if ((__handlerDirection == HANDLER_DIRECTION_NONE) && rect.x < rect.width)
{
__handlerDirection = HANDLER_DIRECTION_REVERSE_3;
rect.x += rect.width;
//if (cursorPos == -1 || (!__pCopyPasteManager->CheckHandleBounds(FloatPoint(absCursorRect.x, absCursorRect.y + absCursorRect.height))))
if (cursorPos == -1 || (!__pCopyPasteManager->CheckHandleBounds(FloatPoint(checkPoint.x, checkPoint.y))))
{
- SysLog(NID_UI, "OnTouchMoved is called");
int curCursorLine = pTextObject->GetLineIndexAtTextIndex(__handlerCursorPos);
int totalLine = pTextObject->GetTotalLineCount();
FloatRectangle editVisibleArea = __pCopyPasteManager->GetEditVisibleAreaF();
- if (pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE)
+ if (pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE || (pEdit->GetEditStyle() & EDIT_STYLE_FLEXIBLE && totalLine == 1))
{
if (point.x - __touchPressedPoint.x >= 0.0f) // RightSide
{