mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-03 15:39:26 +01:00
parent
77ced8537a
commit
0629c5baf0
@ -157,7 +157,7 @@ function TDataSetAction.HandlesTarget(Target: TObject): Boolean;
|
||||
|
||||
begin
|
||||
Result:=(DataSource<>Nil);
|
||||
if Result then
|
||||
if Result and (DataSource=Target) then
|
||||
Result:=(DataSource.DataSet<>Nil)
|
||||
else
|
||||
Result:=(Target is TDataSource) and (TDataSource(Target).DataSet<>Nil);
|
||||
@ -352,4 +352,4 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
end.
|
||||
|
||||
@ -1531,23 +1531,28 @@ end;
|
||||
|
||||
function TCustomForm.DoUpdateAction(TheAction: TBasicAction): boolean;
|
||||
|
||||
function ProcessUpdate(Control: TControl): Boolean;
|
||||
function ProcessUpdate(Component: TComponent): Boolean;
|
||||
begin
|
||||
Result := (Control <> nil) and
|
||||
Control.UpdateAction(TheAction);
|
||||
Result := (Component <> nil) and
|
||||
Component.UpdateAction(TheAction);
|
||||
end;
|
||||
|
||||
function ComponentAllowed(Component: TComponent): Boolean;
|
||||
begin
|
||||
result := not (Component is TControl) or TControl(Component).Visible;
|
||||
end;
|
||||
|
||||
function TraverseClients(Container: TWinControl): Boolean;
|
||||
var
|
||||
I: Integer;
|
||||
Control: TControl;
|
||||
Component: TComponent;
|
||||
begin
|
||||
if Container.Showing then
|
||||
for I := 0 to Container.ControlCount - 1 do
|
||||
for I := 0 to Container.ComponentCount - 1 do
|
||||
begin
|
||||
Control := Container.Controls[I];
|
||||
if Control.Visible and ProcessUpdate(Control)
|
||||
or (Control is TWinControl) and TraverseClients(TWinControl(Control))
|
||||
Component := Container.Components[I];
|
||||
if ComponentAllowed(Component) and ProcessUpdate(Component)
|
||||
or (Component is TWinControl) and TraverseClients(TWinControl(Component))
|
||||
then begin
|
||||
Result := True;
|
||||
exit;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user