lcl: some work on TCustomMemo.WantReturns (part of issue #0022732). The memo already calls default action but still not eat a key

git-svn-id: trunk@41659 -
This commit is contained in:
paul 2013-06-10 09:31:30 +00:00
parent f03b51d173
commit 915f42b9b9
2 changed files with 12 additions and 1 deletions

View File

@ -227,7 +227,7 @@ end;
{------------------------------------------------------------------------------
procedure TCustomMemo.SetScrollbars(const Value : TScrollStyle);
------------------------------------------------------------------------------}
procedure TCustomMemo.SetScrollbars(const Value: TScrollStyle);
procedure TCustomMemo.SetScrollBars(const Value: TScrollStyle);
begin
if Value <> FScrollbars then begin
FScrollbars:= Value;
@ -260,6 +260,16 @@ begin
end;
end;
procedure TCustomMemo.WMGetDlgCode(var Message: TLMNoParams);
begin
inherited;
Message.Result := Message.Result and not (DLGC_WANTTAB or DLGC_WANTALLKEYS);
if WantTabs then
Message.Result := Message.Result or DLGC_WANTTAB;
if WantReturns then
Message.Result := Message.Result or DLGC_WANTALLKEYS;
end;
class function TCustomMemo.GetControlClassDefaultSize: TSize;
begin
Result.CX := 150;

View File

@ -820,6 +820,7 @@ type
procedure SetScrollBars(const Value: TScrollStyle);
procedure Loaded; override;
procedure CMWantSpecialKey(var Message: TCMWantSpecialKey); message CM_WANTSPECIALKEY;
procedure WMGetDlgCode(var Message: TLMNoParams); message LM_GETDLGCODE;
class function GetControlClassDefaultSize: TSize; override;
public
constructor Create(AOwner: TComponent); override;