FloatPoint checkPoint(0.0f, 0.0f);
_Edit* pEdit = __pCopyPasteManager->GetEdit();
_EditPresenter* pEditPresenter = pEdit->GetPresenter();
+ TextObject* pTextObject = pEditPresenter->GetTextObject();
if (__singleHandler)
{
rect.x = cursorRect.x;
rect.y = cursorRect.y + cursorRect.height;
- checkPoint = FloatPoint(cursorRect.x + cursorRect.width/2.0f, cursorRect.y + cursorRect.height);
+
+ if (pTextObject->GetAlignment() & TEXT_OBJECT_ALIGNMENT_RIGHT)
+ {
+ checkPoint = FloatPoint(cursorRect.x, cursorRect.y + cursorRect.height);
+ }
+ else
+ {
+ checkPoint = FloatPoint(cursorRect.x + cursorRect.width/2.0f, cursorRect.y + cursorRect.height);
+ }
if (__leftHandler)
{
StopFlickTimer();
}
- if (__pScrollBar->IsOnFadeEffect() == true)
- {
- __pScrollBar->SetScrollVisibility(false);
- }
+ __pScrollBar->SetScrollVisibility(false);
return E_SYSTEM;
}
StopFlickTimer();
}
- if (__pScrollBar->IsOnFadeEffect() == true)
- {
- __pScrollBar->SetScrollVisibility(false);
- }
+ __pScrollBar->SetScrollVisibility(false);
return E_SYSTEM;
}
return E_SUCCESS;
}
-result
-_EditPresenter::ScrollContents(int moveY)
-{
- int moveLine = 0;
- int firstDisplayY = 0;
- int effectDistance = moveY;
-
- int totalHeight = __pTextObject->GetTotalHeight();
- int newFirstDisplayY = firstDisplayY = __pTextObject->GetFirstDisplayPositionY();
- int currentCursorLine = 0;
-
- if (__pTextObject->GetTextLength() < 1)
- {
- return E_SYSTEM;
- }
-
- if (__pScrollBar && __pScrollBar->GetScrollPosition() == 0 && effectDistance < 0)
- {
- if (__pFlickAnimationTimer)
- {
- StopFlickTimer();
- }
-
- if (__pScrollBar->IsOnFadeEffect() == true)
- {
- __pScrollBar->SetScrollVisibility(false);
- }
-
- return E_SYSTEM;
- }
- else if (__pScrollBar && __pScrollBar->GetScrollPosition() != 0 && __pScrollBar->GetScrollPosition() == __previousScrollBarMaxPos && effectDistance > 0)
- {
- if (__pFlickAnimationTimer)
- {
- StopFlickTimer();
- }
-
- if (__pScrollBar->IsOnFadeEffect() == true)
- {
- __pScrollBar->SetScrollVisibility(false);
- }
-
- return E_SYSTEM;
- }
-
- if (__pTextObject->GetCursorIndex() == __pTextObject->GetTextLength())
- {
- currentCursorLine = __pTextObject->GetTotalLineCount() - 1;
- }
- else
- {
- currentCursorLine = __pTextObject->GetLineIndexAtTextIndex(__pTextObject->GetCursorIndex());
- }
-
- if (currentCursorLine == -1)
- {
- return E_SYSTEM;
- }
-
- if (currentCursorLine < 0)
- {
- currentCursorLine = 0;
- }
-
- newFirstDisplayY += moveY;
-
- if (newFirstDisplayY > (totalHeight - _CoordinateSystemUtils::ConvertToInteger(__textObjectBounds.height)))
- {
- newFirstDisplayY = totalHeight - _CoordinateSystemUtils::ConvertToInteger(__textObjectBounds.height);
- }
-
- if (newFirstDisplayY < 0)
- {
- newFirstDisplayY = 0;
- }
-
- moveLine = __pTextObject->GetLineIndexAtPositionY(newFirstDisplayY);
-
- __pTextObject->SetFirstDisplayLineIndex(moveLine);
- __pTextObject->SetFirstDisplayPositionY(newFirstDisplayY);
-
- __isCursorOpaque = false;
- if (__isCopyPasteManagerExist)
- {
- __pCopyPasteManager->AdjustBounds();
- }
-
- return E_SUCCESS;
-}
-
bool
_EditPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchInfo)
{
return false;
}
- ReplaceTextIntoPasswordHyphenString();
-
if (__isClipboardExist)
{
if (__pClipboard)
HideKeypad();
}
+ ReplaceTextIntoPasswordHyphenString();
+
__pEdit->Invalidate();
return true;
return E_SUCCESS;
}
- if (__pScrollBar->IsOnFadeEffect() == true)
- {
- __pScrollBar->CancelFadeEffect();
- }
-
if (InitializeFlickAnimation() != E_SUCCESS)
{
return E_SYSTEM;
return false;
}
- if (__pScrollBar->IsOnFadeEffect() == true)
+ if (!__pScrollBar->GetScrollVisibility())
{
- __pScrollBar->CancelFadeEffect();
+ __pScrollBar->SetScrollVisibility(true);
}
ScrollContents(moveDistanceY);