mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-11 09:28:07 +02:00
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:
parent
15460809da
commit
eda6929eb0
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user