Revisión de TCustomEditor.UpdateActions para tratar de solucionar el alto consumo de CPU

git-svn-id: https://192.168.0.254/svn/Componentes.Internos.GUISDK/trunk@23 e3f7d858-3362-1a4e-b49c-1b1bd96e4488
This commit is contained in:
David Arranz 2016-09-07 09:40:46 +00:00
parent 95a3799962
commit 31b180cadf
13 changed files with 24 additions and 17 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -49,25 +49,14 @@
<MainSource>MainSource</MainSource> <MainSource>MainSource</MainSource>
</DelphiCompile> </DelphiCompile>
<DCCReference Include="..\Source\uGUIRegister.pas" /> <DCCReference Include="..\Source\uGUIRegister.pas" />
<DCCReference Include="designide.dcp" /> <DCCReference Include="C:\Documents and Settings\Usuario\designide.dcp" />
<DCCReference Include="G.dcp" /> <DCCReference Include="C:\Documents and Settings\Usuario\GUISDK_D11R.dcp" />
<DCCReference Include="GU.dcp" /> <DCCReference Include="C:\Documents and Settings\Usuario\rtl.dcp" />
<DCCReference Include="GUI.dcp" />
<DCCReference Include="GUIS.dcp" />
<DCCReference Include="GUISD.dcp" />
<DCCReference Include="GUISDJ.dcp" />
<DCCReference Include="GUISDK.dcp" />
<DCCReference Include="GUISDK_.dcp" />
<DCCReference Include="GUISDK_D.dcp" />
<DCCReference Include="GUISDK_D1.dcp" />
<DCCReference Include="GUISDK_D11.dcp" />
<DCCReference Include="GUISDK_D11R.dcp" />
<DCCReference Include="rtl.dcp" />
</ItemGroup> </ItemGroup>
</Project> </Project>
<!-- EurekaLog First Line <!-- EurekaLog First Line
[Exception Log] [Exception Log]
EurekaLog Version=6011 EurekaLog Version=6006
Activate=0 Activate=0
Activate Handle=1 Activate Handle=1
Save Log File=1 Save Log File=1

View File

@ -280,7 +280,25 @@ procedure TCustomEditor.UpdateActions;
var var
I: Integer; I: Integer;
{ Copiado de http://stackoverflow.com/questions/10127685/how-can-i-use-an-action-to-determine-a-controls-visibility }
procedure TraverseClients(Container: TWinControl); procedure TraverseClients(Container: TWinControl);
var
I: Integer;
Control: TControl;
begin
Application.ProcessMessages; // <--- Modificación
if Container.Showing and not (csDesigning in Container.ComponentState) then
for I := 0 to Container.ControlCount - 1 do
begin
Control := Container.Controls[I];
if (csActionClient in Control.ControlStyle) and Control.Visible then
Control.InitiateAction;
if (Control is TWinControl) and (TWinControl(Control).ControlCount > 0) then
TraverseClients(TWinControl(Control));
end;
end;
{procedure TraverseClients(Container: TWinControl);
var var
I: Integer; I: Integer;
Control: TControl; Control: TControl;
@ -299,14 +317,14 @@ var
TraverseClients(TWinControl(Control)); TraverseClients(TWinControl(Control));
end; end;
end; end;
end; end;}
begin begin
if (csDesigning in ComponentState) or not Showing then Exit; if (csDesigning in ComponentState) or not Showing then Exit;
{ Update form } { Update form }
InitiateAction; InitiateAction;
{ Update main menu's top-most items } { Update main menu's top-most items }
if Menu <> nil then if (Assigned(Menu) and Assigned(Menu.Items)) then
for I := 0 to Menu.Items.Count - 1 do for I := 0 to Menu.Items.Count - 1 do
with Menu.Items[I] do with Menu.Items[I] do
if Visible then InitiateAction; if Visible then InitiateAction;