customdrawn: TCDEdit caret position and text deletion fixes

git-svn-id: trunk@33504 -
This commit is contained in:
sekelsenmat 2011-11-13 08:01:28 +00:00
parent 5b030ad856
commit f54a3f8510

View File

@ -955,7 +955,11 @@ begin
// Text right of the selection
lTextRight := UTF8Copy(lControlText, lSelLeftPos+lSelLength+1, Length(lControlText));
// Execute the deletion
Text := lTextLeft + lTextRight;
// Correct the caret position
FEditState.CaretPos.X := Length(lTextLeft);
end;
DoClearSelection;
@ -1067,7 +1071,7 @@ begin
VK_BACK:
begin
// Selection backspace
if FEditState.SelLength > 0 then
if IsSomethingSelected() then
DoDeleteSelection()
// Normal backspace
else if FEditState.CaretPos.X > 0 then
@ -1084,7 +1088,7 @@ begin
VK_DELETE:
begin
// Selection delete
if FEditState.SelLength > 0 then
if IsSomethingSelected() then
DoDeleteSelection()
// Normal delete
else if FEditState.CaretPos.X < lOldTextLength then