mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-15 06:09:30 +02:00
LCL-CustomDrawn: Adds a better identifier for CD injected controls and starts improving the tabbing between controls
git-svn-id: trunk@39447 -
This commit is contained in:
parent
8624b78a67
commit
547ebc6bc7
@ -1899,6 +1899,7 @@ type
|
||||
FDoubleBuffered: Boolean;
|
||||
FDockSite: Boolean;
|
||||
FUseDockManager: Boolean;
|
||||
FIsCDIntfControl: Boolean;
|
||||
procedure AlignControl(AControl: TControl);
|
||||
function GetBrush: TBrush;
|
||||
function GetControl(const Index: Integer): TControl;
|
||||
@ -2107,6 +2108,7 @@ type
|
||||
property DoubleBuffered: Boolean read FDoubleBuffered write FDoubleBuffered default False;
|
||||
property Handle: HWND read GetHandle write SetHandle;
|
||||
property IsResizing: Boolean read GetIsResizing;
|
||||
property IsCDIntfControl: Boolean read FIsCDIntfControl write FIsCDIntfControl default False;
|
||||
property TabOrder: TTabOrder read GetTabOrder write SetTaborder default -1;
|
||||
property TabStop: Boolean read FTabStop write SetTabStop default false;
|
||||
property OnAlignInsertBefore: TAlignInsertBeforeEvent read FOnAlignInsertBefore write FOnAlignInsertBefore;
|
||||
|
@ -4600,7 +4600,8 @@ begin
|
||||
for I := 0 to FTabList.Count - 1 do
|
||||
begin
|
||||
lWinControl := TWinControl(FTabList[I]);
|
||||
if lWinControl.CanFocus then
|
||||
// The tab order list should exclude injected LCL-CustomDrawn controls
|
||||
if lWinControl.CanFocus and (not lWinControl.IsCDIntfControl) then
|
||||
List.Add(lWinControl);
|
||||
lWinControl.GetTabOrderList(List);
|
||||
end;
|
||||
|
@ -84,4 +84,5 @@
|
||||
{.$define VerboseCDClipboard}
|
||||
{.$define VerboseCDFocus}
|
||||
{.$define VerboseCDKeyInput}
|
||||
{.$define VerboseCDInjectedControlNames}
|
||||
|
||||
|
@ -216,6 +216,7 @@ var
|
||||
lTarget: TWinControl;
|
||||
lIsTab, lTabDirForward: Boolean;
|
||||
lTabNextControl: TWinControl;
|
||||
i: Integer;
|
||||
begin
|
||||
lTarget := AWindowHandle.GetFocusedControl();
|
||||
{$ifdef VerboseCDEvents}
|
||||
@ -242,6 +243,20 @@ begin
|
||||
begin
|
||||
lTabDirForward := LCLIntf.GetKeyState(VK_SHIFT) = 0;
|
||||
lTarget.Parent.SelectNext(lTarget, lTabDirForward, True);
|
||||
end
|
||||
// slightly different code when the currently selected item is the form itself
|
||||
else if lIsTab then
|
||||
begin
|
||||
// find the first TWinControl and select it
|
||||
lTabNextControl := nil;
|
||||
for i := 0 to lTarget.ControlCount - 1 do
|
||||
if lTarget.Controls[i] is TWinControl then
|
||||
begin
|
||||
lTabNextControl := TWinControl(lTarget.Controls[i]);
|
||||
Break;
|
||||
end;
|
||||
|
||||
if lTabNextControl <> nil then lTabNextControl.SetFocus();
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -292,15 +307,15 @@ end;
|
||||
|
||||
function IsIntfControl(AControl: TWinControl): Boolean;
|
||||
begin
|
||||
Result := (AControl <> nil) and (AControl.Parent <> nil);
|
||||
if Result then Result :=
|
||||
Result := (AControl <> nil) and (AControl.Parent <> nil) and AControl.IsCDIntfControl;
|
||||
{if Result then Result :=
|
||||
// Standard Tab
|
||||
(AControl is TCDIntfButton) or (AControl is TCDIntfEdit) or (AControl is TCDIntfCheckBox) or
|
||||
// Additional Tab
|
||||
(AControl is TCDIntfStaticText) or
|
||||
// Common Controls Tab
|
||||
(AControl is TCDIntfProgressBar) or (AControl is TCDIntfTrackBar) or
|
||||
(AControl is TCDIntfPageControl);
|
||||
(AControl is TCDIntfPageControl);}
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -290,6 +290,8 @@ begin
|
||||
TCDIntfPageControl(ACDControlField).LCLControl := TCustomTabControl(AWinControl);
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
class function TCDWSCustomTabControl.CreateHandle(
|
||||
@ -426,6 +428,8 @@ begin
|
||||
TCDIntfTrackBar(ACDControlField).LCLControl := TCustomTrackBar(AWinControl);
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
class function TCDWSTrackBar.CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle;
|
||||
@ -565,6 +569,8 @@ begin
|
||||
TCDIntfProgressBar(ACDControlField).LCLControl := TCustomProgressBar(AWinControl);
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
class function TCDWSProgressBar.CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle;
|
||||
|
@ -355,6 +355,8 @@ begin
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
class function TCDWSCustomMemo.CreateHandle(const AWinControl: TWinControl;
|
||||
@ -420,6 +422,8 @@ begin
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
class function TCDWSScrollBar.CreateHandle(const AWinControl: TWinControl;
|
||||
@ -820,6 +824,8 @@ begin
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
class function TCDWSCustomComboBox.CreateHandle(const AWinControl: TWinControl;
|
||||
@ -1302,6 +1308,8 @@ begin
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
TCDIntfEdit(ACDControlField).ReadOnly := TCustomEdit(AWinControl).ReadOnly;
|
||||
end;
|
||||
|
||||
@ -1568,6 +1576,8 @@ begin
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -1637,6 +1647,8 @@ begin
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -1726,6 +1738,8 @@ begin
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -1796,6 +1810,8 @@ begin
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user