mirror of https://gitlab.com/basile.b/dexed.git
prevent widget update when not visible
This commit is contained in:
parent
8fa2a71147
commit
cf5e15b427
|
@ -52,6 +52,7 @@ type
|
|||
procedure projCompiling(aProject: TCEProject);
|
||||
protected
|
||||
procedure UpdateByEvent; override;
|
||||
procedure SetVisible(Value: boolean); override;
|
||||
public
|
||||
constructor create(aOwner: TComponent); override;
|
||||
destructor destroy; override;
|
||||
|
@ -90,6 +91,13 @@ begin
|
|||
EntitiesConnector.removeObserver(self);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TCEProjectConfigurationWidget.SetVisible(Value: boolean);
|
||||
begin
|
||||
inherited;
|
||||
if Visible then UpdateByEvent;
|
||||
end;
|
||||
|
||||
{$ENDREGION --------------------------------------------------------------------}
|
||||
|
||||
{$REGION ICEProjectObserver ----------------------------------------------------}
|
||||
|
@ -97,7 +105,7 @@ procedure TCEProjectConfigurationWidget.projNew(aProject: TCEProject);
|
|||
begin
|
||||
beginUpdateByEvent;
|
||||
fProj := aProject;
|
||||
endUpdateByEvent;
|
||||
if Visible then UpdateByEvent;
|
||||
syncroMode := false;
|
||||
end;
|
||||
|
||||
|
@ -114,18 +122,15 @@ end;
|
|||
|
||||
procedure TCEProjectConfigurationWidget.projChanged(aProject: TCEProject);
|
||||
begin
|
||||
if fProj <> aProject then
|
||||
exit;
|
||||
beginUpdateByEvent;
|
||||
if fProj <> aProject then exit;
|
||||
fProj := aProject;
|
||||
endUpdateByEvent;
|
||||
if Visible then UpdateByEvent;
|
||||
end;
|
||||
|
||||
procedure TCEProjectConfigurationWidget.projFocused(aProject: TCEProject);
|
||||
begin
|
||||
beginUpdateByEvent;
|
||||
fProj := aProject;
|
||||
endUpdateByEvent;
|
||||
if Visible then UpdateByEvent;
|
||||
end;
|
||||
|
||||
procedure TCEProjectConfigurationWidget.projCompiling(aProject: TCEProject);
|
||||
|
@ -359,10 +364,11 @@ var
|
|||
begin
|
||||
selConf.ItemIndex:= -1;
|
||||
selConf.Clear;
|
||||
if fProj = nil then exit;
|
||||
//
|
||||
for i:= 0 to fProj.OptionsCollection.Count-1 do
|
||||
selConf.Items.Add(fProj.configuration[i].name);
|
||||
selConf.ItemIndex := fProj.ConfigurationIndex;
|
||||
|
||||
inspector.TIObject := getGridTarget;
|
||||
end;
|
||||
{$ENDREGION --------------------------------------------------------------------}
|
||||
|
|
|
@ -31,6 +31,7 @@ type
|
|||
procedure TreeSelectionChanged(Sender: TObject);
|
||||
protected
|
||||
procedure UpdateByEvent; override;
|
||||
procedure SetVisible(Value: boolean); override;
|
||||
private
|
||||
fActOpenFile: TAction;
|
||||
fActSelConf: TAction;
|
||||
|
@ -111,6 +112,11 @@ begin
|
|||
inherited;
|
||||
end;
|
||||
|
||||
procedure TCEProjectInspectWidget.SetVisible(Value: boolean);
|
||||
begin
|
||||
inherited;
|
||||
if Value then UpdateByEvent;
|
||||
end;
|
||||
{$ENDREGION}
|
||||
|
||||
{$REGION ICEContextualActions---------------------------------------------------}
|
||||
|
@ -143,7 +149,7 @@ end;
|
|||
procedure TCEProjectInspectWidget.projNew(aProject: TCEProject);
|
||||
begin
|
||||
fProject := aProject;
|
||||
UpdateByEvent;
|
||||
if Visible then UpdateByEvent;
|
||||
end;
|
||||
|
||||
procedure TCEProjectInspectWidget.projClosing(aProject: TCEProject);
|
||||
|
@ -157,14 +163,13 @@ end;
|
|||
procedure TCEProjectInspectWidget.projFocused(aProject: TCEProject);
|
||||
begin
|
||||
fProject := aProject;
|
||||
UpdateByEvent;
|
||||
if Visible then UpdateByEvent;
|
||||
end;
|
||||
|
||||
procedure TCEProjectInspectWidget.projChanged(aProject: TCEProject);
|
||||
begin
|
||||
if fProject <> aProject then
|
||||
exit;
|
||||
UpdateByEvent;
|
||||
if fProject <> aProject then exit;
|
||||
if Visible then UpdateByEvent;
|
||||
end;
|
||||
|
||||
procedure TCEProjectInspectWidget.projCompiling(aProject: TCEProject);
|
||||
|
|
|
@ -76,6 +76,8 @@ type
|
|||
function contextName: string; override;
|
||||
function contextActionCount: integer; override;
|
||||
function contextAction(index: integer): TAction; override;
|
||||
//
|
||||
procedure SetVisible(Value: boolean); override;
|
||||
published
|
||||
property autoRefresh: boolean read fAutoRefresh write fAutoRefresh;
|
||||
property refreshOnChange: boolean read fRefreshOnChange write fRefreshOnChange;
|
||||
|
@ -160,6 +162,13 @@ begin
|
|||
fLogMessager.Free;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TCEStaticExplorerWidget.SetVisible(Value: boolean);
|
||||
begin
|
||||
inherited;
|
||||
if Value then
|
||||
produceJsonInfo;
|
||||
end;
|
||||
{$ENDREGION}
|
||||
|
||||
{$REGION ICESessionOptionsObserver ---------------------------------------------}
|
||||
|
@ -277,6 +286,8 @@ end;
|
|||
procedure TCEStaticExplorerWidget.docFocused(aDoc: TCESynMemo);
|
||||
begin
|
||||
fDoc := aDoc;
|
||||
if not Visible then exit;
|
||||
//
|
||||
if fAutoRefresh then beginUpdateByDelay
|
||||
else if fRefreshOnFocus then produceJsonInfo;
|
||||
end;
|
||||
|
@ -284,10 +295,10 @@ end;
|
|||
procedure TCEStaticExplorerWidget.docChanged(aDoc: TCESynMemo);
|
||||
begin
|
||||
if fDoc <> aDoc then exit;
|
||||
if fAutoRefresh then
|
||||
beginUpdateByDelay
|
||||
else if fRefreshOnChange then
|
||||
produceJsonInfo;
|
||||
if not Visible then exit;
|
||||
//
|
||||
if fAutoRefresh then beginUpdateByDelay
|
||||
else if fRefreshOnChange then produceJsonInfo;
|
||||
end;
|
||||
{$ENDREGION}
|
||||
|
||||
|
|
|
@ -89,6 +89,8 @@ type
|
|||
procedure lstItemsDoubleClick(sender: TObject);
|
||||
procedure btnRefreshClick(sender: TObject);
|
||||
procedure filterItems(sender: TObject);
|
||||
protected
|
||||
procedure SetVisible(Value: boolean); override;
|
||||
public
|
||||
constructor create(aOwner: TComponent); override;
|
||||
destructor destroy; override;
|
||||
|
@ -185,6 +187,14 @@ begin
|
|||
fLogMessager.Free;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TCETodoListWidget.SetVisible(Value: boolean);
|
||||
begin
|
||||
inherited;
|
||||
if Value then
|
||||
callToolProcess;
|
||||
end;
|
||||
|
||||
{$ENDREGION}
|
||||
|
||||
{$REGION ICEMultiDocObserver ---------------------------------------------------}
|
||||
|
@ -195,7 +205,8 @@ end;
|
|||
procedure TCETodoListWidget.docFocused(aDoc: TCESynMemo);
|
||||
begin
|
||||
fDoc := aDoc;
|
||||
callToolProcess;
|
||||
if Visible then
|
||||
callToolProcess;
|
||||
end;
|
||||
|
||||
procedure TCETodoListWidget.docChanged(aDoc: TCESynMemo);
|
||||
|
@ -220,7 +231,8 @@ end;
|
|||
procedure TCETodoListWidget.projChanged(aProject: TCEProject);
|
||||
begin
|
||||
if fProj <> aProject then exit;
|
||||
callToolProcess;
|
||||
if Visible then
|
||||
callToolProcess;
|
||||
end;
|
||||
|
||||
procedure TCETodoListWidget.projClosing(aProject: TCEProject);
|
||||
|
@ -233,7 +245,8 @@ end;
|
|||
procedure TCETodoListWidget.projFocused(aProject: TCEProject);
|
||||
begin
|
||||
fProj := aProject;
|
||||
callToolProcess;
|
||||
if Visible then
|
||||
callToolProcess;
|
||||
end;
|
||||
|
||||
procedure TCETodoListWidget.projCompiling(aProject: TCEProject);
|
||||
|
|
Loading…
Reference in New Issue