mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 21:20:30 +02:00
IDE: global build modes
git-svn-id: trunk@17999 -
This commit is contained in:
parent
5de189d7af
commit
7332c0b540
@ -205,7 +205,7 @@ begin
|
|||||||
|
|
||||||
OnBackupFileInteractive:=@BackupFile;
|
OnBackupFileInteractive:=@BackupFile;
|
||||||
RunCompilerWithOptions:=@OnRunCompilerWithOptions;
|
RunCompilerWithOptions:=@OnRunCompilerWithOptions;
|
||||||
BuildModeSet:=TBuildModeSet.Create;
|
GlobalBuildModeSet:=TBuildModeSet.Create;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TBuildManager.Destroy;
|
destructor TBuildManager.Destroy;
|
||||||
@ -213,7 +213,7 @@ begin
|
|||||||
LazConfMacroFunc:=nil;
|
LazConfMacroFunc:=nil;
|
||||||
OnBackupFileInteractive:=nil;
|
OnBackupFileInteractive:=nil;
|
||||||
FreeAndNil(InputHistories);
|
FreeAndNil(InputHistories);
|
||||||
FreeAndNil(BuildModeSet);
|
FreeAndNil(GlobalBuildModeSet);
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
MainBuildBoss:=nil;
|
MainBuildBoss:=nil;
|
||||||
|
@ -68,9 +68,15 @@ type
|
|||||||
procedure Assign(Source: TIDEBuildMode);
|
procedure Assign(Source: TIDEBuildMode);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TBuildModeSet = class;
|
||||||
|
|
||||||
{ TIDEBuildModes }
|
{ TIDEBuildModes }
|
||||||
|
|
||||||
TIDEBuildModes = class(TLazBuildModes)
|
TIDEBuildModes = class(TLazBuildModes)
|
||||||
|
private
|
||||||
|
FBuildModeSet: TBuildModeSet;
|
||||||
|
fPrevModes, fNextModes: TIDEBuildModes;
|
||||||
|
procedure SetBuildModeSet(const AValue: TBuildModeSet);
|
||||||
protected
|
protected
|
||||||
FItems: TFPList;// list of TIDEBuildMode
|
FItems: TFPList;// list of TIDEBuildMode
|
||||||
function GetItems(Index: integer): TLazBuildMode; override;
|
function GetItems(Index: integer): TLazBuildMode; override;
|
||||||
@ -82,12 +88,13 @@ type
|
|||||||
procedure Delete(Index: integer); override;
|
procedure Delete(Index: integer); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function IndexOfIdentifier(Identifier: string): integer; override;
|
function IndexOfIdentifier(Identifier: string): integer; override;
|
||||||
function ModeWithIdentifier(Identifier: string): TLazBuildMode; override;
|
function ModeWithIdentifier(Identifier: string): TIDEBuildMode; override;
|
||||||
procedure Move(OldIndex, NewIndex: integer); override;
|
procedure Move(OldIndex, NewIndex: integer); override;
|
||||||
procedure LoadFromXMLConfig(AXMLConfig: TXMLConfig; const Path: string; DoSwitchPathDelims: boolean);
|
procedure LoadFromXMLConfig(AXMLConfig: TXMLConfig; const Path: string; DoSwitchPathDelims: boolean);
|
||||||
procedure SaveToXMLConfig(AXMLConfig: TXMLConfig; const Path: string);
|
procedure SaveToXMLConfig(AXMLConfig: TXMLConfig; const Path: string);
|
||||||
procedure CreateDiff(OtherModes: TLazBuildModes; Tool: TCompilerDiffTool);
|
procedure CreateDiff(OtherModes: TLazBuildModes; Tool: TCompilerDiffTool);
|
||||||
procedure Assign(Source: TLazBuildModes);
|
procedure Assign(Source: TLazBuildModes);
|
||||||
|
property BuildModeSet: TBuildModeSet read FBuildModeSet write SetBuildModeSet;// active in BuildModeSet
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TBuildModeSet }
|
{ TBuildModeSet }
|
||||||
@ -95,9 +102,13 @@ type
|
|||||||
TBuildModeSet = class
|
TBuildModeSet = class
|
||||||
private
|
private
|
||||||
FEvaluator: TExpressionEvaluator;
|
FEvaluator: TExpressionEvaluator;
|
||||||
|
FFirstBuildModes: TIDEBuildModes;
|
||||||
public
|
public
|
||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
function FindModeWithIdentifier(Identifier: string; out BuildModes: TIDEBuildModes;
|
||||||
|
out BuildMode: TIDEBuildMode): boolean;
|
||||||
|
function GetUniqueModeName: string;
|
||||||
property Evaluator: TExpressionEvaluator read FEvaluator;
|
property Evaluator: TExpressionEvaluator read FEvaluator;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -499,7 +510,7 @@ type
|
|||||||
TCompilerOptions = TBaseCompilerOptions;
|
TCompilerOptions = TBaseCompilerOptions;
|
||||||
|
|
||||||
var
|
var
|
||||||
BuildModeSet: TBuildModeSet;
|
GlobalBuildModeSet: TBuildModeSet;
|
||||||
|
|
||||||
const
|
const
|
||||||
CompileReasonNames: array[TCompileReason] of string = (
|
CompileReasonNames: array[TCompileReason] of string = (
|
||||||
@ -826,7 +837,7 @@ constructor TBaseCompilerOptions.Create(const AOwner: TObject;
|
|||||||
const AToolClass: TCompilationToolClass);
|
const AToolClass: TCompilationToolClass);
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
FConditionals := TCompOptConditionals.Create(BuildModeSet.Evaluator);
|
FConditionals := TCompOptConditionals.Create(GlobalBuildModeSet.Evaluator);
|
||||||
FParsedOpts := TParsedCompilerOptions.Create(TCompOptConditionals(FConditionals));
|
FParsedOpts := TParsedCompilerOptions.Create(TCompOptConditionals(FConditionals));
|
||||||
FExecuteBefore := AToolClass.Create;
|
FExecuteBefore := AToolClass.Create;
|
||||||
FExecuteAfter := AToolClass.Create;
|
FExecuteAfter := AToolClass.Create;
|
||||||
@ -2856,7 +2867,7 @@ end;
|
|||||||
constructor TAdditionalCompilerOptions.Create(TheOwner: TObject);
|
constructor TAdditionalCompilerOptions.Create(TheOwner: TObject);
|
||||||
begin
|
begin
|
||||||
fOwner:=TheOwner;
|
fOwner:=TheOwner;
|
||||||
FConditionals:=TCompOptConditionals.Create(BuildModeSet.Evaluator);
|
FConditionals:=TCompOptConditionals.Create(GlobalBuildModeSet.Evaluator);
|
||||||
FParsedOpts:=TParsedCompilerOptions.Create(FConditionals);
|
FParsedOpts:=TParsedCompilerOptions.Create(FConditionals);
|
||||||
Clear;
|
Clear;
|
||||||
end;
|
end;
|
||||||
@ -3248,6 +3259,32 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TBuildModeSet.FindModeWithIdentifier(Identifier: string; out
|
||||||
|
BuildModes: TIDEBuildModes; out BuildMode: TIDEBuildMode): boolean;
|
||||||
|
begin
|
||||||
|
BuildMode:=nil;
|
||||||
|
BuildModes:=FFirstBuildModes;
|
||||||
|
while BuildModes<>nil do begin
|
||||||
|
BuildMode:=BuildModes.ModeWithIdentifier(Identifier);
|
||||||
|
if BuildMode<>nil then exit(true);
|
||||||
|
BuildModes:=BuildModes.fNextModes;
|
||||||
|
end;
|
||||||
|
Result:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TBuildModeSet.GetUniqueModeName: string;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
BuildModes: TIDEBuildModes;
|
||||||
|
BuildMode: TIDEBuildMode;
|
||||||
|
begin
|
||||||
|
i:=0;
|
||||||
|
repeat
|
||||||
|
inc(i);
|
||||||
|
Result:='Mode'+IntToStr(i);
|
||||||
|
until not FindModeWithIdentifier(Result,BuildModes,BuildMode);
|
||||||
|
end;
|
||||||
|
|
||||||
{ TIDEBuildMode }
|
{ TIDEBuildMode }
|
||||||
|
|
||||||
procedure TIDEBuildMode.SetIdentifier(const AValue: string);
|
procedure TIDEBuildMode.SetIdentifier(const AValue: string);
|
||||||
@ -3280,7 +3317,7 @@ constructor TIDEBuildMode.Create;
|
|||||||
begin
|
begin
|
||||||
FValues:=TStringList.Create;
|
FValues:=TStringList.Create;
|
||||||
FValueDescriptions:=TStringList.Create;
|
FValueDescriptions:=TStringList.Create;
|
||||||
FDefaultValue:=TCompOptConditionals.Create(BuildModeSet.Evaluator);
|
FDefaultValue:=TCompOptConditionals.Create(GlobalBuildModeSet.Evaluator);
|
||||||
FDefaultValue.Root.NodeType:=cocntAddValue;
|
FDefaultValue.Root.NodeType:=cocntAddValue;
|
||||||
FDefaultValue.Root.ValueType:=cocvtNone;
|
FDefaultValue.Root.ValueType:=cocvtNone;
|
||||||
end;
|
end;
|
||||||
@ -3350,6 +3387,23 @@ end;
|
|||||||
|
|
||||||
{ TIDEBuildModes }
|
{ TIDEBuildModes }
|
||||||
|
|
||||||
|
procedure TIDEBuildModes.SetBuildModeSet(const AValue: TBuildModeSet);
|
||||||
|
begin
|
||||||
|
if FBuildModeSet=AValue then exit;
|
||||||
|
FBuildModeSet:=AValue;
|
||||||
|
if FBuildModeSet<>nil then begin
|
||||||
|
fNextModes:=GlobalBuildModeSet.FFirstBuildModes;
|
||||||
|
GlobalBuildModeSet.FFirstBuildModes:=Self;
|
||||||
|
end else begin
|
||||||
|
if GlobalBuildModeSet.FFirstBuildModes=Self then
|
||||||
|
GlobalBuildModeSet.FFirstBuildModes:=fNextModes;
|
||||||
|
if fNextModes<>nil then fNextModes.fPrevModes:=fPrevModes;
|
||||||
|
if fPrevModes<>nil then fPrevModes.fNextModes:=fNextModes;
|
||||||
|
fPrevModes:=nil;
|
||||||
|
fNextModes:=nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TIDEBuildModes.GetItems(Index: integer): TLazBuildMode;
|
function TIDEBuildModes.GetItems(Index: integer): TLazBuildMode;
|
||||||
begin
|
begin
|
||||||
Result:=TLazBuildMode(FItems[Index]);
|
Result:=TLazBuildMode(FItems[Index]);
|
||||||
@ -3391,6 +3445,7 @@ end;
|
|||||||
|
|
||||||
destructor TIDEBuildModes.Destroy;
|
destructor TIDEBuildModes.Destroy;
|
||||||
begin
|
begin
|
||||||
|
BuildModeSet:=nil;
|
||||||
Clear;
|
Clear;
|
||||||
FreeAndNil(FItems);
|
FreeAndNil(FItems);
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
@ -3403,7 +3458,7 @@ begin
|
|||||||
dec(Result);
|
dec(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TIDEBuildModes.ModeWithIdentifier(Identifier: string): TLazBuildMode;
|
function TIDEBuildModes.ModeWithIdentifier(Identifier: string): TIDEBuildMode;
|
||||||
var
|
var
|
||||||
i: LongInt;
|
i: LongInt;
|
||||||
begin
|
begin
|
||||||
@ -3411,7 +3466,7 @@ begin
|
|||||||
if i<0 then
|
if i<0 then
|
||||||
Result:=nil
|
Result:=nil
|
||||||
else
|
else
|
||||||
Result:=Items[i];
|
Result:=TIDEBuildMode(Items[i]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIDEBuildModes.Move(OldIndex, NewIndex: integer);
|
procedure TIDEBuildModes.Move(OldIndex, NewIndex: integer);
|
||||||
|
@ -8,8 +8,8 @@ object CompOptBuildModesFrame: TCompOptBuildModesFrame
|
|||||||
Ctl3D = False
|
Ctl3D = False
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Visible = False
|
Visible = False
|
||||||
DesignLeft = 309
|
DesignLeft = 324
|
||||||
DesignTop = 328
|
DesignTop = 400
|
||||||
object ModesGroupBox: TGroupBox
|
object ModesGroupBox: TGroupBox
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 229
|
Height = 229
|
||||||
@ -70,7 +70,7 @@ object CompOptBuildModesFrame: TCompOptBuildModesFrame
|
|||||||
NumGlyphs = 0
|
NumGlyphs = 0
|
||||||
OnClick = MoveUpSpeedButtonClick
|
OnClick = MoveUpSpeedButtonClick
|
||||||
end
|
end
|
||||||
object ModesListBox: TListBox
|
object ModesGrid: TStringGrid
|
||||||
AnchorSideBottom.Control = NewSpeedButton
|
AnchorSideBottom.Control = NewSpeedButton
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 188
|
Height = 188
|
||||||
@ -78,9 +78,11 @@ object CompOptBuildModesFrame: TCompOptBuildModesFrame
|
|||||||
Width = 182
|
Width = 182
|
||||||
Align = alTop
|
Align = alTop
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
ItemHeight = 0
|
ColCount = 1
|
||||||
|
FixedCols = 0
|
||||||
|
FixedRows = 0
|
||||||
|
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goDblClickAutoSize, goSmoothScroll]
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
TopIndex = -1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object ValuesGroupBox: TGroupBox
|
object ValuesGroupBox: TGroupBox
|
||||||
@ -102,6 +104,7 @@ object CompOptBuildModesFrame: TCompOptBuildModesFrame
|
|||||||
Align = alClient
|
Align = alClient
|
||||||
ColCount = 2
|
ColCount = 2
|
||||||
FixedCols = 0
|
FixedCols = 0
|
||||||
|
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goColSizing, goEditing, goDblClickAutoSize, goSmoothScroll]
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object DefaultValueGroupBox: TGroupBox
|
object DefaultValueGroupBox: TGroupBox
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
|
{ This is an automatically generated lazarus resource file }
|
||||||
|
|
||||||
LazarusResources.Add('TCompOptBuildModesFrame','FORMDATA',[
|
LazarusResources.Add('TCompOptBuildModesFrame','FORMDATA',[
|
||||||
'TPF0'#23'TCompOptBuildModesFrame'#22'CompOptBuildModesFrame'#4'Left'#2#0#6'H'
|
'TPF0'#23'TCompOptBuildModesFrame'#22'CompOptBuildModesFrame'#4'Left'#2#0#6'H'
|
||||||
+'eight'#3#233#0#3'Top'#2#0#5'Width'#3#236#1#12'ClientHeight'#3#229#0#11'Clie'
|
+'eight'#3#233#0#3'Top'#2#0#5'Width'#3#236#1#12'ClientHeight'#3#229#0#11'Clie'
|
||||||
+'ntWidth'#3#232#1#5'Ctl3D'#8#8'TabOrder'#2#0#7'Visible'#8#10'DesignLeft'#3'5'
|
+'ntWidth'#3#232#1#5'Ctl3D'#8#8'TabOrder'#2#0#7'Visible'#8#10'DesignLeft'#3'D'
|
||||||
+#1#9'DesignTop'#3'H'#1#0#9'TGroupBox'#13'ModesGroupBox'#4'Left'#2#0#6'Height'
|
+#1#9'DesignTop'#3#144#1#0#9'TGroupBox'#13'ModesGroupBox'#4'Left'#2#0#6'Heigh'
|
||||||
+#3#229#0#3'Top'#2#0#5'Width'#3#186#0#5'Align'#7#6'alLeft'#7'Caption'#6#13'Mo'
|
+'t'#3#229#0#3'Top'#2#0#5'Width'#3#186#0#5'Align'#7#6'alLeft'#7'Caption'#6#13
|
||||||
+'desGroupBox'#12'ClientHeight'#3#210#0#11'ClientWidth'#3#182#0#5'Ctl3D'#8#8
|
+'ModesGroupBox'#12'ClientHeight'#3#210#0#11'ClientWidth'#3#182#0#5'Ctl3D'#8#8
|
||||||
+'TabOrder'#2#0#0#12'TSpeedButton'#14'NewSpeedButton'#22'AnchorSideLeft.Contr'
|
+'TabOrder'#2#0#0#12'TSpeedButton'#14'NewSpeedButton'#22'AnchorSideLeft.Contr'
|
||||||
+'ol'#7#13'ModesGroupBox'#24'AnchorSideBottom.Control'#7#13'ModesGroupBox'#21
|
+'ol'#7#13'ModesGroupBox'#24'AnchorSideBottom.Control'#7#13'ModesGroupBox'#21
|
||||||
+'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#22#3'Top'#3
|
+'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#2#0#6'Height'#2#22#3'Top'#3
|
||||||
@ -22,30 +24,34 @@ LazarusResources.Add('TCompOptBuildModesFrame','FORMDATA',[
|
|||||||
+'eft.Control'#7#19'MoveDownSpeedButton'#19'AnchorSideLeft.Side'#7#9'asrBotto'
|
+'eft.Control'#7#19'MoveDownSpeedButton'#19'AnchorSideLeft.Side'#7#9'asrBotto'
|
||||||
+'m'#21'AnchorSideTop.Control'#7#14'NewSpeedButton'#4'Left'#2'E'#6'Height'#2
|
+'m'#21'AnchorSideTop.Control'#7#14'NewSpeedButton'#4'Left'#2'E'#6'Height'#2
|
||||||
+#22#3'Top'#3#188#0#5'Width'#2#23#5'Color'#7#9'clBtnFace'#9'NumGlyphs'#2#0#7
|
+#22#3'Top'#3#188#0#5'Width'#2#23#5'Color'#7#9'clBtnFace'#9'NumGlyphs'#2#0#7
|
||||||
+'OnClick'#7#22'MoveUpSpeedButtonClick'#0#0#8'TListBox'#12'ModesListBox'#24'A'
|
+'OnClick'#7#22'MoveUpSpeedButtonClick'#0#0#11'TStringGrid'#9'ModesGrid'#24'A'
|
||||||
+'nchorSideBottom.Control'#7#14'NewSpeedButton'#4'Left'#2#0#6'Height'#3#188#0
|
+'nchorSideBottom.Control'#7#14'NewSpeedButton'#4'Left'#2#0#6'Height'#3#188#0
|
||||||
+#3'Top'#2#0#5'Width'#3#182#0#5'Align'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'ak'
|
+#3'Top'#2#0#5'Width'#3#182#0#5'Align'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'ak'
|
||||||
+'Left'#7'akRight'#8'akBottom'#0#10'ItemHeight'#2#0#8'TabOrder'#2#0#8'TopInde'
|
+'Left'#7'akRight'#8'akBottom'#0#8'ColCount'#2#1#9'FixedCols'#2#0#9'FixedRows'
|
||||||
+'x'#2#255#0#0#0#9'TGroupBox'#14'ValuesGroupBox'#4'Left'#3#191#0#6'Height'#3
|
+#2#0#7'Options'#11#15'goFixedVertLine'#15'goFixedHorzLine'#10'goVertLine'#10
|
||||||
+#229#0#3'Top'#2#0#5'Width'#3')'#1#5'Align'#7#8'alClient'#7'Caption'#6#14'Val'
|
+'goHorzLine'#13'goRangeSelect'#9'goEditing'#18'goDblClickAutoSize'#14'goSmoo'
|
||||||
+'uesGroupBox'#12'ClientHeight'#3#210#0#11'ClientWidth'#3'%'#1#5'Ctl3D'#8#8'T'
|
+'thScroll'#0#8'TabOrder'#2#0#0#0#0#9'TGroupBox'#14'ValuesGroupBox'#4'Left'#3
|
||||||
+'abOrder'#2#1#0#11'TStringGrid'#16'ValuesStringGrid'#4'Left'#2#0#6'Height'#2
|
+#191#0#6'Height'#3#229#0#3'Top'#2#0#5'Width'#3')'#1#5'Align'#7#8'alClient'#7
|
||||||
+'_'#3'Top'#2#0#5'Width'#3'%'#1#5'Align'#7#8'alClient'#8'ColCount'#2#2#9'Fixe'
|
+'Caption'#6#14'ValuesGroupBox'#12'ClientHeight'#3#210#0#11'ClientWidth'#3'%'
|
||||||
+'dCols'#2#0#8'TabOrder'#2#0#0#0#9'TGroupBox'#20'DefaultValueGroupBox'#4'Left'
|
+#1#5'Ctl3D'#8#8'TabOrder'#2#1#0#11'TStringGrid'#16'ValuesStringGrid'#4'Left'
|
||||||
+#2#0#6'Height'#2'm'#3'Top'#2'e'#5'Width'#3'%'#1#5'Align'#7#8'alBottom'#7'Cap'
|
+#2#0#6'Height'#2'_'#3'Top'#2#0#5'Width'#3'%'#1#5'Align'#7#8'alClient'#8'ColC'
|
||||||
+'tion'#6#20'DefaultValueGroupBox'#12'ClientHeight'#2'Z'#11'ClientWidth'#3'!'
|
+'ount'#2#2#9'FixedCols'#2#0#7'Options'#11#15'goFixedVertLine'#15'goFixedHorz'
|
||||||
+#1#5'Ctl3D'#8#8'TabOrder'#2#1#0#244#26'TCompOptsConditionalsFrame'#18'Defaul'
|
+'Line'#10'goVertLine'#10'goHorzLine'#13'goRangeSelect'#11'goColSizing'#9'goE'
|
||||||
+'tValueEditor'#6'Height'#2'Z'#5'Width'#3'!'#1#5'Align'#7#8'alClient'#12'Clie'
|
+'diting'#18'goDblClickAutoSize'#14'goSmoothScroll'#0#8'TabOrder'#2#0#0#0#9'T'
|
||||||
+'ntHeight'#2'V'#11'ClientWidth'#3#29#1#7'Visible'#9#10'DesignLeft'#3#178#1#9
|
+'GroupBox'#20'DefaultValueGroupBox'#4'Left'#2#0#6'Height'#2'm'#3'Top'#2'e'#5
|
||||||
+'DesignTop'#3'I'#1#0#241#9'TTreeView'#11'COCTreeView'#6'Height'#2'V'#5'Width'
|
+'Width'#3'%'#1#5'Align'#7#8'alBottom'#7'Caption'#6#20'DefaultValueGroupBox'
|
||||||
+#3#29#1#0#0#241#10'TPopupMenu'#12'COCPopupMenu'#0#241#9'TMenuItem'#19'Insert'
|
+#12'ClientHeight'#2'Z'#11'ClientWidth'#3'!'#1#5'Ctl3D'#8#8'TabOrder'#2#1#0
|
||||||
+'AboveMenuItem'#0#0#241#9'TMenuItem'#19'InsertBelowMenuItem'#0#0#241#9'TMenu'
|
+#244#26'TCompOptsConditionalsFrame'#18'DefaultValueEditor'#6'Height'#2'Z'#5
|
||||||
+'Item'#19'InsertChildMenuItem'#0#0#241#9'TMenuItem'#14'DeleteMenuItem'#0#0
|
+'Width'#3'!'#1#5'Align'#7#8'alClient'#12'ClientHeight'#2'V'#11'ClientWidth'#3
|
||||||
+#241#9'TMenuItem'#14'MoveUpMenuItem'#0#0#241#9'TMenuItem'#16'MoveDownMenuIte'
|
+#29#1#7'Visible'#9#10'DesignLeft'#3#178#1#9'DesignTop'#3'I'#1#0#241#9'TTreeV'
|
||||||
+'m'#0#0#241#9'TMenuItem'#17'MoveLvlUpMenuItem'#0#0#241#9'TMenuItem'#19'MoveL'
|
+'iew'#11'COCTreeView'#6'Height'#2'V'#5'Width'#3#29#1#0#0#241#10'TPopupMenu'
|
||||||
+'vlDownMenuItem'#0#0#241#9'TMenuItem'#18'PropertiesMenuItem'#0#0#0#0#0#9'TSp'
|
+#12'COCPopupMenu'#0#241#9'TMenuItem'#19'InsertAboveMenuItem'#0#0#241#9'TMenu'
|
||||||
+'litter'#14'ValuesSplitter'#6'Cursor'#7#8'crVSplit'#4'Left'#2#0#6'Height'#2#6
|
+'Item'#19'InsertBelowMenuItem'#0#0#241#9'TMenuItem'#19'InsertChildMenuItem'#0
|
||||||
+#3'Top'#2'_'#5'Width'#3'%'#1#5'Align'#7#8'alBottom'#12'ResizeAnchor'#7#8'akB'
|
+#0#241#9'TMenuItem'#14'DeleteMenuItem'#0#0#241#9'TMenuItem'#14'MoveUpMenuIte'
|
||||||
+'ottom'#0#0#0#9'TSplitter'#12'MainSplitter'#4'Left'#3#186#0#6'Height'#3#229#0
|
+'m'#0#0#241#9'TMenuItem'#16'MoveDownMenuItem'#0#0#241#9'TMenuItem'#17'MoveLv'
|
||||||
+#3'Top'#2#0#5'Width'#2#5#0#0#0
|
+'lUpMenuItem'#0#0#241#9'TMenuItem'#19'MoveLvlDownMenuItem'#0#0#241#9'TMenuIt'
|
||||||
|
+'em'#18'PropertiesMenuItem'#0#0#0#0#0#9'TSplitter'#14'ValuesSplitter'#6'Curs'
|
||||||
|
+'or'#7#8'crVSplit'#4'Left'#2#0#6'Height'#2#6#3'Top'#2'_'#5'Width'#3'%'#1#5'A'
|
||||||
|
+'lign'#7#8'alBottom'#12'ResizeAnchor'#7#8'akBottom'#0#0#0#9'TSplitter'#12'Ma'
|
||||||
|
+'inSplitter'#4'Left'#3#186#0#6'Height'#3#229#0#3'Top'#2#0#5'Width'#2#5#0#0#0
|
||||||
]);
|
]);
|
||||||
|
@ -36,9 +36,9 @@ type
|
|||||||
TCompOptBuildModesFrame = class(TFrame)
|
TCompOptBuildModesFrame = class(TFrame)
|
||||||
DefaultValueEditor: TCompOptsConditionalsFrame;
|
DefaultValueEditor: TCompOptsConditionalsFrame;
|
||||||
DefaultValueGroupBox: TGroupBox;
|
DefaultValueGroupBox: TGroupBox;
|
||||||
|
ModesGrid: TStringGrid;
|
||||||
ValuesGroupBox: TGroupBox;
|
ValuesGroupBox: TGroupBox;
|
||||||
ModesGroupBox: TGroupBox;
|
ModesGroupBox: TGroupBox;
|
||||||
ModesListBox: TListBox;
|
|
||||||
NewSpeedButton: TSpeedButton;
|
NewSpeedButton: TSpeedButton;
|
||||||
DeleteSpeedButton: TSpeedButton;
|
DeleteSpeedButton: TSpeedButton;
|
||||||
MoveDownSpeedButton: TSpeedButton;
|
MoveDownSpeedButton: TSpeedButton;
|
||||||
@ -69,8 +69,14 @@ implementation
|
|||||||
{ TCompOptBuildModesFrame }
|
{ TCompOptBuildModesFrame }
|
||||||
|
|
||||||
procedure TCompOptBuildModesFrame.NewSpeedButtonClick(Sender: TObject);
|
procedure TCompOptBuildModesFrame.NewSpeedButtonClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
NewIdentifier: String;
|
||||||
begin
|
begin
|
||||||
|
NewIdentifier:=GlobalBuildModeSet.GetUniqueModeName;
|
||||||
|
BuildModes.Add(NewIdentifier);
|
||||||
|
ModesGrid.RowCount:=BuildModes.Count;
|
||||||
|
ModesGrid.Cells[0,BuildModes.Count-1]:=NewIdentifier;
|
||||||
|
ModesGrid.Row:=BuildModes.Count-1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCompOptBuildModesFrame.DeleteSpeedButtonClick(Sender: TObject);
|
procedure TCompOptBuildModesFrame.DeleteSpeedButtonClick(Sender: TObject);
|
||||||
@ -79,16 +85,16 @@ var
|
|||||||
i: LongInt;
|
i: LongInt;
|
||||||
begin
|
begin
|
||||||
if not GetSelectedBuildMode(BuildMode) then exit;
|
if not GetSelectedBuildMode(BuildMode) then exit;
|
||||||
i:=ModesListBox.ItemIndex;
|
i:=ModesGrid.Row;
|
||||||
if MessageDlg('Confirm delete',
|
if MessageDlg('Confirm delete',
|
||||||
'Delete build mode "'+BuildMode.Identifier+'"?',
|
'Delete build mode "'+BuildMode.Identifier+'"?',
|
||||||
mtConfirmation,[mbYes,mbCancel],0)<>mrYes
|
mtConfirmation,[mbYes,mbCancel],0)<>mrYes
|
||||||
then exit;
|
then exit;
|
||||||
BuildModes.Delete(i);
|
BuildModes.Delete(i);
|
||||||
ModesListBox.Items.Delete(i);
|
ModesGrid.DeleteColRow(true,i);
|
||||||
if i=ModesListBox.Items.Count then
|
if i=ModesGrid.RowCount then
|
||||||
dec(i);
|
dec(i);
|
||||||
ModesListBox.ItemIndex:=i;
|
ModesGrid.Row:=i;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCompOptBuildModesFrame.MoveDownSpeedButtonClick(Sender: TObject);
|
procedure TCompOptBuildModesFrame.MoveDownSpeedButtonClick(Sender: TObject);
|
||||||
@ -97,11 +103,12 @@ var
|
|||||||
BuildMode: TIDEBuildMode;
|
BuildMode: TIDEBuildMode;
|
||||||
begin
|
begin
|
||||||
if not GetSelectedBuildMode(BuildMode) then exit;
|
if not GetSelectedBuildMode(BuildMode) then exit;
|
||||||
i:=ModesListBox.ItemIndex;
|
i:=ModesGrid.Row;
|
||||||
if i<ModesListBox.Items.Count-1 then begin
|
if i<ModesGrid.Row-1 then begin
|
||||||
BuildModes.Move(i,i+1);
|
BuildModes.Move(i,i+1);
|
||||||
ModesListBox.Items.Move(i,i+1);
|
ModesGrid.Cells[0,i]:=BuildModes.Items[i].Identifier;
|
||||||
ModesListBox.ItemIndex:=i+1;
|
ModesGrid.Cells[0,i+1]:=BuildModes.Items[i+1].Identifier;
|
||||||
|
ModesGrid.Row:=i+1;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -111,11 +118,12 @@ var
|
|||||||
BuildMode: TIDEBuildMode;
|
BuildMode: TIDEBuildMode;
|
||||||
begin
|
begin
|
||||||
if not GetSelectedBuildMode(BuildMode) then exit;
|
if not GetSelectedBuildMode(BuildMode) then exit;
|
||||||
i:=ModesListBox.ItemIndex;
|
i:=ModesGrid.Row;
|
||||||
if i>0 then begin
|
if i>0 then begin
|
||||||
BuildModes.Move(i,i-1);
|
BuildModes.Move(i,i-1);
|
||||||
ModesListBox.Items.Move(i,i-1);
|
ModesGrid.Cells[0,i]:=BuildModes.Items[i].Identifier;
|
||||||
ModesListBox.ItemIndex:=i-1;
|
ModesGrid.Cells[0,i-1]:=BuildModes.Items[i-1].Identifier;
|
||||||
|
ModesGrid.Row:=i-1;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -130,14 +138,14 @@ procedure TCompOptBuildModesFrame.UpdateModes;
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
ModesListBox.Items.BeginUpdate;
|
ModesGrid.BeginUpdate;
|
||||||
ModesListBox.Items.Clear;
|
ModesGrid.ColCount:=1;
|
||||||
|
ModesGrid.RowCount:=BuildModes.Count;
|
||||||
if BuildModes<>nil then begin
|
if BuildModes<>nil then begin
|
||||||
for i:=0 to BuildModes.Count-1 do begin
|
for i:=0 to BuildModes.Count-1 do
|
||||||
ModesListBox.Items.Add(BuildModes.Items[i].Identifier);
|
ModesGrid.Cells[0,i]:=BuildModes.Items[i].Identifier;
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
ModesListBox.Items.EndUpdate;
|
ModesGrid.EndUpdate;
|
||||||
UpdateValues;
|
UpdateValues;
|
||||||
UpdateButtons;
|
UpdateButtons;
|
||||||
end;
|
end;
|
||||||
@ -177,10 +185,10 @@ end;
|
|||||||
procedure TCompOptBuildModesFrame.UpdateButtons;
|
procedure TCompOptBuildModesFrame.UpdateButtons;
|
||||||
begin
|
begin
|
||||||
NewSpeedButton.Enabled:=BuildModes<>nil;
|
NewSpeedButton.Enabled:=BuildModes<>nil;
|
||||||
DeleteSpeedButton.Enabled:=(ModesListBox.ItemIndex>=0);
|
DeleteSpeedButton.Enabled:=(ModesGrid.Row>=0);
|
||||||
MoveDownSpeedButton.Enabled:=(ModesListBox.ItemIndex>=0)
|
MoveDownSpeedButton.Enabled:=(ModesGrid.Row>=0)
|
||||||
and (ModesListBox.ItemIndex<ModesListBox.Items.Count-1);
|
and (ModesGrid.Row<ModesGrid.RowCount-1);
|
||||||
MoveUpSpeedButton.Enabled:=(ModesListBox.ItemIndex>0);
|
MoveUpSpeedButton.Enabled:=(ModesGrid.Row>0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCompOptBuildModesFrame.GetSelectedBuildMode(
|
function TCompOptBuildModesFrame.GetSelectedBuildMode(
|
||||||
@ -188,8 +196,8 @@ function TCompOptBuildModesFrame.GetSelectedBuildMode(
|
|||||||
begin
|
begin
|
||||||
BuildMode:=nil;
|
BuildMode:=nil;
|
||||||
if BuildModes=nil then exit(false);
|
if BuildModes=nil then exit(false);
|
||||||
if ModesListBox.ItemIndex<0 then exit(false);
|
if ModesGrid.Row<0 then exit(false);
|
||||||
BuildMode:=TIDEBuildMode(BuildModes.Items[ModesListBox.ItemIndex]);
|
BuildMode:=TIDEBuildMode(BuildModes.Items[ModesGrid.Row]);
|
||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user