LCL-CustomDrawn: Starts support for tabbing between controls, didnt yet work in Mac OS X

git-svn-id: trunk@38236 -
This commit is contained in:
sekelsenmat 2012-08-14 07:27:02 +00:00
parent 15460809da
commit eda6929eb0

View File

@ -214,12 +214,15 @@ end;
procedure CallbackKeyDown(AWindowHandle: TCDForm; AKey: Word);
var
lTarget: TWinControl;
lIsTab, lTabDirForward: Boolean;
lTabNextControl: TWinControl;
begin
lTarget := AWindowHandle.GetFocusedControl();
{$ifdef VerboseCDEvents}
DebugLn(Format('CallbackKeyDown FocusedControl=%s:%s AKey=%x', [lTarget.Name, lTarget.ClassName, AKey]));
{$endif}
lIsTab := AKey = VK_TAB;
LCLSendKeyDownEvent(lTarget, AKey, 0, True, False);
// If this is a interface control, send the message to the main LCL control too
@ -231,6 +234,15 @@ begin
{$endif}
LCLSendKeyDownEvent(lTarget, AKey, 0, True, False);
end;
// If the control didn't eat the tab, then circle around controls
// Shift+Tab circles in the opposite direction
lIsTab := lIsTab and (AKey = VK_TAB);
if (lTarget.Parent <> nil) and lIsTab then
begin
lTabDirForward := LCLIntf.GetKeyState(VK_SHIFT) = 0;
lTarget.Parent.SelectNext(lTarget, lTabDirForward, True);
end;
end;
procedure CallbackKeyUp(AWindowHandle: TCDForm; AKey: Word);