proj conf/insp btn enabled only if proj assigned

This commit is contained in:
Basile Burg 2015-06-03 11:06:56 +02:00
parent eaee7ee30a
commit a81d15e01e
4 changed files with 8 additions and 8 deletions

View File

@ -16,7 +16,7 @@ inherited CEProjectConfigurationWidget: TCEProjectConfigurationWidget
Width = 445
ClientHeight = 273
ClientWidth = 445
object Panel1: TPanel[0]
object pnlToolBar: TPanel[0]
Left = 4
Height = 24
Top = 2

View File

@ -19,7 +19,7 @@ type
imgList: TImageList;
Panel2: TPanel;
selConf: TComboBox;
Panel1: TPanel;
pnlToolBar: TPanel;
btnAddConf: TSpeedButton;
btnDelConf: TSpeedButton;
btnCloneConf: TSpeedButton;
@ -113,6 +113,7 @@ begin
fProj := aProject;
if Visible then updateImperative;
syncroMode := false;
pnlToolBar.Enabled:=true;
end;
procedure TCEProjectConfigurationWidget.projClosing(aProject: TCEProject);
@ -123,6 +124,7 @@ begin
inspector.ItemIndex := -1;
self.selConf.Clear;
syncroMode := false;
pnlToolBar.Enabled:=false;
fProj := nil;
end;
@ -136,6 +138,7 @@ end;
procedure TCEProjectConfigurationWidget.projFocused(aProject: TCEProject);
begin
fProj := aProject;
pnlToolBar.Enabled:=true;
if Visible then updateImperative;
end;

View File

@ -48,7 +48,7 @@ inherited CEProjectInspectWidget: TCEProjectInspectWidget
20736F7572636573
}
end
object Panel1: TPanel[1]
object pnlToolBar: TPanel[1]
Left = 2
Height = 24
Top = 2

View File

@ -13,7 +13,7 @@ type
TCEProjectInspectWidget = class(TCEWidget, ICEProjectObserver)
btnRemFold: TSpeedButton;
imgList: TImageList;
Panel1: TPanel;
pnlToolBar: TPanel;
btnAddFile: TSpeedButton;
btnProjOpts: TSpeedButton;
btnAddFold: TSpeedButton;
@ -388,10 +388,7 @@ begin
fXtraNode.DeleteChildren;
//
hasProj := fProject <> nil;
btnAddFile.Enabled := hasProj;
btnRemFile.Enabled := hasProj;
btnAddFold.Enabled := hasProj;
btnRemFold.Enabled := hasProj;
pnlToolBar.Enabled := hasProj;
if not hasProj then exit;
//
Tree.BeginUpdate;