lcl: don't insert Enter key to TMemo if WantReturns is set to False

git-svn-id: trunk@41673 -
This commit is contained in:
paul 2013-06-11 02:39:15 +00:00
parent bf6d88f9ad
commit b3ce447a57
2 changed files with 8 additions and 0 deletions

View File

@ -276,6 +276,13 @@ begin
Result.CY := 90;
end;
procedure TCustomMemo.UTF8KeyPress(var UTF8Key: TUTF8Char);
begin
inherited UTF8KeyPress(UTF8Key);
if not WantReturns and (UTF8Key = #13) then
UTF8Key := '';
end;
procedure TCustomMemo.SetWantTabs(const NewWantTabs: boolean);
begin
if FWantTabs = NewWantTabs then exit;

View File

@ -822,6 +822,7 @@ type
procedure CMWantSpecialKey(var Message: TCMWantSpecialKey); message CM_WANTSPECIALKEY;
procedure WMGetDlgCode(var Message: TLMNoParams); message LM_GETDLGCODE;
class function GetControlClassDefaultSize: TSize; override;
procedure UTF8KeyPress(var UTF8Key: TUTF8Char); override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;