mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-05 20:37:19 +01:00
customdrawn: TCDEdit caret position and text deletion fixes
git-svn-id: trunk@33504 -
This commit is contained in:
parent
5b030ad856
commit
f54a3f8510
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user