LCL: memo: handle ESC in LM_GETDLGCODE (pass it)

git-svn-id: trunk@58260 -
This commit is contained in:
ondrej 2018-06-14 10:11:43 +00:00
parent 6ccdb67ff4
commit b7a40b3691

View File

@ -239,18 +239,22 @@ end;
procedure TCustomMemo.WMGetDlgCode(var Message: TLMGetDlgCode);
begin
inherited;
if Message.CharCode = VK_TAB then
begin
if WantTabs then
Message.Result := Message.Result or (DLGC_WANTTAB or DLGC_WANTALLKEYS)
else
Message.Result := Message.Result and not (DLGC_WANTTAB or DLGC_WANTALLKEYS);
end;
if Message.CharCode = VK_RETURN then
begin
if WantReturns then
Message.Result := Message.Result or DLGC_WANTALLKEYS
else
case Message.CharCode of
VK_TAB:
begin
if WantTabs then
Message.Result := Message.Result or (DLGC_WANTTAB or DLGC_WANTALLKEYS)
else
Message.Result := Message.Result and not (DLGC_WANTTAB or DLGC_WANTALLKEYS);
end;
VK_RETURN:
begin
if WantReturns then
Message.Result := Message.Result or DLGC_WANTALLKEYS
else
Message.Result := Message.Result and not DLGC_WANTALLKEYS;
end;
VK_ESCAPE:
Message.Result := Message.Result and not DLGC_WANTALLKEYS;
end;
end;