LCL: Temporary fix for focus jumping on Arrow keys between controls. Will be moved to WS code. Issue #22191, patch from AlexeyT.

git-svn-id: trunk@53933 -
This commit is contained in:
juha 2017-01-12 15:44:56 +00:00
parent fa280dc697
commit b2658d37bc
3 changed files with 14 additions and 0 deletions

View File

@ -1102,4 +1102,15 @@ begin
end;
end;
procedure TCustomComboBox.CMWantSpecialKey(var Message: TCMWantSpecialKey);
begin
{$ifdef darwin}
// don't allow LCL to handle arrow keys for edit controls
if Message.CharCode in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN] then
Message.Result := 1
else
{$endif}
inherited;
end;
// included by stdctrls.pp

View File

@ -505,10 +505,12 @@ end;
procedure TCustomEdit.CMWantSpecialKey(var Message: TCMWantSpecialKey);
begin
{$ifdef darwin}
// don't allow LCL to handle arrow keys for edit controls
if Message.CharCode in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN] then
Message.Result := 1
else
{$endif}
inherited;
end;

View File

@ -316,6 +316,7 @@ type
procedure MeasureItem(Index: Integer; var TheHeight: Integer); virtual;
class function GetControlClassDefaultSize: TSize; override;
procedure LMChanged(var Msg); message LM_CHANGED;
procedure CMWantSpecialKey(var Message: TCMWantSpecialKey); message CM_WANTSPECIALKEY;
procedure Change; virtual;
procedure Select; virtual;
procedure DropDown; virtual;