ide: don't reserve space for build mode combo if it is not visible

git-svn-id: trunk@41716 -
This commit is contained in:
paul 2013-06-14 14:45:58 +00:00
parent e3f594943a
commit 81bcce809a
2 changed files with 34 additions and 13 deletions

View File

@ -45,6 +45,8 @@ object IDEOptionsDialog: TIDEOptionsDialog
Width = 4
end
object CategoryPanel: TPanel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
Left = 0
Height = 364
Top = 0
@ -63,11 +65,11 @@ object IDEOptionsDialog: TIDEOptionsDialog
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = SettingsPanel
Left = 6
Height = 308
Top = 36
Height = 309
Top = 35
Width = 249
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Top = 5
BorderSpacing.Top = 6
DefaultItemHeight = 18
ReadOnly = True
TabOrder = 0
@ -79,10 +81,11 @@ object IDEOptionsDialog: TIDEOptionsDialog
end
object FilterEdit: TTreeFilterEdit
AnchorSideLeft.Control = CategoryPanel
AnchorSideTop.Control = CategoryPanel
AnchorSideRight.Side = asrBottom
Left = 6
Height = 23
Top = 8
Top = 6
Width = 200
OnFilterItem = FilterEditFilterItem
UseFormActivate = True
@ -90,6 +93,7 @@ object IDEOptionsDialog: TIDEOptionsDialog
NumGlyphs = 1
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Font.Color = clBtnShadow
MaxLength = 0
ParentFont = False
@ -111,16 +115,17 @@ object IDEOptionsDialog: TIDEOptionsDialog
object BuildModeSelectPanel: TPanel
AnchorSideLeft.Control = CatTVSplitter
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Owner
AnchorSideRight.Control = EditorsPanel
AnchorSideRight.Side = asrBottom
Left = 259
Height = 40
Top = 0
Width = 427
Width = 424
Anchors = [akTop, akLeft, akRight]
BevelOuter = bvNone
ClientHeight = 40
ClientWidth = 427
ClientWidth = 424
TabOrder = 3
object BuildModeLabel: TLabel
Left = 12
@ -181,16 +186,19 @@ object IDEOptionsDialog: TIDEOptionsDialog
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = BuildModeSelectPanel
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = ButtonPanel
Left = 259
Height = 324
Top = 40
Width = 427
HorzScrollBar.Page = 427
Width = 424
HorzScrollBar.Page = 424
HorzScrollBar.Tracking = True
VertScrollBar.Page = 324
VertScrollBar.Tracking = True
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Right = 6
BorderStyle = bsNone
TabOrder = 4
end

View File

@ -97,6 +97,7 @@ type
procedure SetSettings(const AValue: TIDEOptionsEditorSettings);
function AllBuildModes: boolean;
procedure UpdateBuildModeButtons;
procedure SetBuldModeVisibility(AVisibility: Boolean);
public
constructor Create(AOwner: TComponent); override;
function ShowModal: Integer; override;
@ -132,7 +133,7 @@ begin
FEditorsCreated := False;
FEditorToOpen := nil;
SettingsPanel.Constraints.MinHeight:=0;
BuildModeSelectPanel.Visible:=false;
SetBuldModeVisibility(False);
BuildModeLabel.Caption:=lisBuildMode;
BuildModeInSessionCheckBox.Caption:=lisInSession;
BuildModeInSessionCheckBox.Hint:=
@ -199,10 +200,7 @@ begin
GroupClass := FindGroupClass(Node);
end;
// Show the Build Mode panel for project compiler options
if (GroupClass <> nil) and (GroupClass.InheritsFrom(TProjectCompilerOptions)) then
BuildModeSelectPanel.Visible:=true
else
BuildModeSelectPanel.Visible:=false;
SetBuldModeVisibility((GroupClass <> nil) and (GroupClass.InheritsFrom(TProjectCompilerOptions)));
// Hide the old and show the new editor frame
if Assigned(AEditor) then
FNewLastSelected := AEditor.Rec;
@ -621,6 +619,21 @@ begin
BuildModeInSessionCheckBox.Checked:=Project1.ActiveBuildMode.InSession;
end;
procedure TIDEOptionsDialog.SetBuldModeVisibility(AVisibility: Boolean);
begin
BuildModeSelectPanel.Visible := AVisibility;
if AVisibility then
begin
EditorsPanel.AnchorSide[akTop].Control := BuildModeSelectPanel;
EditorsPanel.AnchorSide[akTop].Side := asrBottom;
end
else
begin
EditorsPanel.AnchorSide[akTop].Control := Self;
EditorsPanel.AnchorSide[akTop].Side := asrTop;
end;
end;
procedure TIDEOptionsDialog.DoOpenEditor(EditorToOpen: TAbstractIDEOptionsEditorClass);
var
Node: TTreeNode;