LCL: TCustomMemo should not trigger OnEditingDone when return is pressed and WantReturns=True.Patch by wp. issue #26769

git-svn-id: trunk@46320 -
This commit is contained in:
zeljko 2014-09-25 06:19:05 +00:00
parent e2ca5560c5
commit cab06a0777
2 changed files with 12 additions and 0 deletions

View File

@ -202,6 +202,17 @@ begin
Result := TWSCustomMemoClass(WidgetSetClass).GetCaretPos(Self);
end;
{------------------------------------------------------------------------------
Prevents false firing of the OnEditingDone event if the memo accepts the
RETURN key for new-line input.
------------------------------------------------------------------------------}
procedure TCustomMemo.KeyUpAfterInterface(var Key: Word; Shift: TShiftState);
begin
if (Key = VK_RETURN) and FWantReturns then
Key := 0;
inherited;
end;
{------------------------------------------------------------------------------
Method: TCustomMemo.SetLines
Params:

View File

@ -816,6 +816,7 @@ type
procedure RealSetText(const Value: TCaption); override;
function GetCachedText(var CachedText: TCaption): boolean; override;
function GetCaretPos: TPoint; override;
procedure KeyUpAfterInterface(var Key: Word; Shift: TShiftState); override;
procedure SetCaretPos(const Value: TPoint); override;
procedure SetLines(const Value: TStrings);
procedure SetSelText(const Val: string); override;