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 Width = 445
ClientHeight = 273 ClientHeight = 273
ClientWidth = 445 ClientWidth = 445
object Panel1: TPanel[0] object pnlToolBar: TPanel[0]
Left = 4 Left = 4
Height = 24 Height = 24
Top = 2 Top = 2

View File

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

View File

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

View File

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