mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 22:50:22 +02:00
IDE: build modes: selected
git-svn-id: trunk@23360 -
This commit is contained in:
parent
5509fc02c5
commit
9e0bd4b9e8
@ -5040,16 +5040,22 @@ end;
|
|||||||
procedure TBuildMode.Include(aMode: TBuildMode);
|
procedure TBuildMode.Include(aMode: TBuildMode);
|
||||||
begin
|
begin
|
||||||
if aMode=nil then exit;
|
if aMode=nil then exit;
|
||||||
if FIncludes.IndexOf(aMode)<0 then
|
if FIncludes.IndexOf(aMode)>=0 then exit;
|
||||||
|
if aMode.FIncludedBy.IndexOf(Self)>=0 then
|
||||||
|
RaiseException('');
|
||||||
FIncludes.Add(aMode);
|
FIncludes.Add(aMode);
|
||||||
if aMode.FIncludedBy.IndexOf(Self)<0 then
|
|
||||||
aMode.FIncludedBy.Add(Self);
|
aMode.FIncludedBy.Add(Self);
|
||||||
|
if Active or aMode.Active then
|
||||||
|
Graph.UpdateActiveModes;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBuildMode.Exclude(aMode: TBuildMode);
|
procedure TBuildMode.Exclude(aMode: TBuildMode);
|
||||||
begin
|
begin
|
||||||
|
if FIncludes.IndexOf(aMode)<0 then exit;
|
||||||
FIncludes.Remove(aMode);
|
FIncludes.Remove(aMode);
|
||||||
if aMode<>nil then aMode.FIncludedBy.Remove(Self);
|
aMode.FIncludedBy.Remove(Self);
|
||||||
|
if Active or aMode.Active then
|
||||||
|
Graph.UpdateActiveModes;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBuildMode.IsIncludedBy(aMode: TBuildMode): boolean;
|
function TBuildMode.IsIncludedBy(aMode: TBuildMode): boolean;
|
||||||
|
@ -71,32 +71,6 @@ object BuildModesEditorFrame: TBuildModesEditorFrame
|
|||||||
ShowHint = True
|
ShowHint = True
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
end
|
end
|
||||||
object CurBuildModeLabel: TLabel
|
|
||||||
AnchorSideLeft.Control = NewBuildGroupSpeedButton
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
AnchorSideTop.Control = CurBuildModeComboBox
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
Left = 108
|
|
||||||
Height = 18
|
|
||||||
Top = 6
|
|
||||||
Width = 123
|
|
||||||
BorderSpacing.Left = 15
|
|
||||||
Caption = 'CurBuildModeLabel'
|
|
||||||
ParentColor = False
|
|
||||||
end
|
|
||||||
object CurBuildModeComboBox: TComboBox
|
|
||||||
AnchorSideLeft.Control = CurBuildModeLabel
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
Left = 231
|
|
||||||
Height = 29
|
|
||||||
Top = 1
|
|
||||||
Width = 176
|
|
||||||
ItemHeight = 0
|
|
||||||
ParentShowHint = False
|
|
||||||
ShowHint = True
|
|
||||||
TabOrder = 0
|
|
||||||
Text = 'CurBuildModeComboBox'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
object BuildModesPopupMenu: TPopupMenu
|
object BuildModesPopupMenu: TPopupMenu
|
||||||
left = 83
|
left = 83
|
||||||
|
@ -20,14 +20,6 @@ LazarusResources.Add('TBuildModesEditorFrame','FORMDATA',[
|
|||||||
+'edButton'#24'NewBuildGroupSpeedButton'#4'Left'#2'F'#6'Height'#2#29#3'Top'#2
|
+'edButton'#24'NewBuildGroupSpeedButton'#4'Left'#2'F'#6'Height'#2#29#3'Top'#2
|
||||||
+#1#5'Width'#2#23#5'Align'#7#6'alLeft'#8'AutoSize'#9#5'Color'#7#9'clBtnFace'#9
|
+#1#5'Width'#2#23#5'Align'#7#6'alLeft'#8'AutoSize'#9#5'Color'#7#9'clBtnFace'#9
|
||||||
+'NumGlyphs'#2#0#7'OnClick'#7#24'NewBuildGroupButtonClick'#8'ShowHint'#9#14'P'
|
+'NumGlyphs'#2#0#7'OnClick'#7#24'NewBuildGroupButtonClick'#8'ShowHint'#9#14'P'
|
||||||
+'arentShowHint'#8#0#0#6'TLabel'#17'CurBuildModeLabel'#22'AnchorSideLeft.Cont'
|
+'arentShowHint'#8#0#0#0#10'TPopupMenu'#19'BuildModesPopupMenu'#4'left'#2'S'#3
|
||||||
+'rol'#7#24'NewBuildGroupSpeedButton'#19'AnchorSideLeft.Side'#7#9'asrBottom'
|
+'top'#2's'#0#0#0
|
||||||
+#21'AnchorSideTop.Control'#7#20'CurBuildModeComboBox'#18'AnchorSideTop.Side'
|
|
||||||
+#7#9'asrCenter'#4'Left'#2'l'#6'Height'#2#18#3'Top'#2#6#5'Width'#2'{'#18'Bord'
|
|
||||||
+'erSpacing.Left'#2#15#7'Caption'#6#17'CurBuildModeLabel'#11'ParentColor'#8#0
|
|
||||||
+#0#9'TComboBox'#20'CurBuildModeComboBox'#22'AnchorSideLeft.Control'#7#17'Cur'
|
|
||||||
+'BuildModeLabel'#19'AnchorSideLeft.Side'#7#9'asrBottom'#4'Left'#3#231#0#6'He'
|
|
||||||
+'ight'#2#29#3'Top'#2#1#5'Width'#3#176#0#10'ItemHeight'#2#0#14'ParentShowHint'
|
|
||||||
+#8#8'ShowHint'#9#8'TabOrder'#2#0#4'Text'#6#20'CurBuildModeComboBox'#0#0#0#10
|
|
||||||
+'TPopupMenu'#19'BuildModesPopupMenu'#4'left'#2'S'#3'top'#2's'#0#0#0
|
|
||||||
]);
|
]);
|
||||||
|
@ -93,6 +93,8 @@ type
|
|||||||
function BuildGroupToCol(GroupIndex: integer): integer;
|
function BuildGroupToCol(GroupIndex: integer): integer;
|
||||||
function ColToBuildGroup(aCol: integer): integer;
|
function ColToBuildGroup(aCol: integer): integer;
|
||||||
function CellToInclude(aCol, aRow: integer): boolean;
|
function CellToInclude(aCol, aRow: integer): boolean;
|
||||||
|
function GetFirstGroupCol: integer;
|
||||||
|
function GetTypeCol: integer;
|
||||||
property Graph: TBuildModeGraph read FGraph;
|
property Graph: TBuildModeGraph read FGraph;
|
||||||
procedure RebuildGrid; // call this after Graph has changed
|
procedure RebuildGrid; // call this after Graph has changed
|
||||||
property ModeRowCount: integer read GetModeRowCount;
|
property ModeRowCount: integer read GetModeRowCount;
|
||||||
@ -106,8 +108,6 @@ type
|
|||||||
|
|
||||||
TBuildModesEditorFrame = class(TFrame)
|
TBuildModesEditorFrame = class(TFrame)
|
||||||
BuildModesPopupMenu: TPopupMenu;
|
BuildModesPopupMenu: TPopupMenu;
|
||||||
CurBuildModeComboBox: TComboBox;
|
|
||||||
CurBuildModeLabel: TLabel;
|
|
||||||
BuildModeBtnPanel: TPanel;
|
BuildModeBtnPanel: TPanel;
|
||||||
NewBuildModeSpeedButton: TSpeedButton;
|
NewBuildModeSpeedButton: TSpeedButton;
|
||||||
NewBuildFlagSpeedButton: TSpeedButton;
|
NewBuildFlagSpeedButton: TSpeedButton;
|
||||||
@ -185,11 +185,13 @@ var
|
|||||||
TypeCol: Integer;
|
TypeCol: Integer;
|
||||||
ValueCol: Integer;
|
ValueCol: Integer;
|
||||||
begin
|
begin
|
||||||
TypeCol:=GroupModeCount+1;
|
TypeCol:=GetTypeCol;
|
||||||
ValueCol:=TypeCol+1;
|
ValueCol:=TypeCol+1;
|
||||||
if i=0 then begin
|
if i=0 then begin
|
||||||
Columns[0].Title.Caption:=lisBuildMode;
|
Columns[0].Title.Caption:=lisBuildMode;
|
||||||
for i:=1 to GroupModeCount do Columns[i].Title.Caption:='';
|
Columns[1].Title.Caption:=lisSelected;
|
||||||
|
for i:=0 to GroupModeCount-1 do
|
||||||
|
Columns[i+GetFirstGroupCol].Title.Caption:=ModeRows[i].Mode.Name;
|
||||||
Columns[TypeCol].Title.Caption:=dlgEnvType;
|
Columns[TypeCol].Title.Caption:=dlgEnvType;
|
||||||
Columns[ValueCol].Title.Caption:=dlgValueColor;
|
Columns[ValueCol].Title.Caption:=dlgValueColor;
|
||||||
end else begin
|
end else begin
|
||||||
@ -199,13 +201,18 @@ begin
|
|||||||
Cells[0,i]:=CurRow.Mode.Name
|
Cells[0,i]:=CurRow.Mode.Name
|
||||||
else
|
else
|
||||||
Cells[0,i]:='';
|
Cells[0,i]:='';
|
||||||
|
// selected
|
||||||
|
if CurRow.Mode=Graph.SelectedMode then
|
||||||
|
Cells[1,i]:=Columns[1].ValueChecked
|
||||||
|
else
|
||||||
|
Cells[1,i]:=Columns[1].ValueUnchecked;
|
||||||
// included by
|
// included by
|
||||||
for j:=0 to GroupModeCount-1 do begin
|
for j:=0 to GroupModeCount-1 do begin
|
||||||
if CellToInclude(j+1,i) then
|
if CellToInclude(j+1,i) then
|
||||||
Cells[j+1,i]:=Columns[j+1].ValueChecked
|
Cells[j+1,i]:=Columns[j+1].ValueChecked
|
||||||
else
|
else
|
||||||
Cells[j+1,i]:=Columns[j+1].ValueUnchecked;
|
Cells[j+1,i]:=Columns[j+1].ValueUnchecked;
|
||||||
DebugLn(['TBuildModesGrid.FillGridRow ',j+1,' ',i,' ',Cells[j+1,i]]);
|
//DebugLn(['TBuildModesGrid.FillGridRow ',j+1,' ',i,' ',Cells[j+1,i]]);
|
||||||
end;
|
end;
|
||||||
// type + value
|
// type + value
|
||||||
CurFlag:=CurRow.Flag;
|
CurFlag:=CurRow.Flag;
|
||||||
@ -251,7 +258,7 @@ begin
|
|||||||
Result:=true;
|
Result:=true;
|
||||||
if (aRow>=1) and (aRow<=ModeRowCount) then begin
|
if (aRow>=1) and (aRow<=ModeRowCount) then begin
|
||||||
CurModeRow:=ModeRows[aRow-1];
|
CurModeRow:=ModeRows[aRow-1];
|
||||||
TypeCol:=GroupModeCount+1;
|
TypeCol:=GetTypeCol;
|
||||||
ValueCol:=TypeCol+1;
|
ValueCol:=TypeCol+1;
|
||||||
//DebugLn(['TBuildModesGrid.ValidateCell aCol=',acol,' aRow=',arow,' ValueCol=',ValueCol]);
|
//DebugLn(['TBuildModesGrid.ValidateCell aCol=',acol,' aRow=',arow,' ValueCol=',ValueCol]);
|
||||||
if aCol=0 then begin
|
if aCol=0 then begin
|
||||||
@ -260,6 +267,10 @@ begin
|
|||||||
// set new mode name
|
// set new mode name
|
||||||
NewValue:=Graph.FixModeName(NewValue,CurModeRow.Mode);
|
NewValue:=Graph.FixModeName(NewValue,CurModeRow.Mode);
|
||||||
CurModeRow.Mode.Name:=NewValue;
|
CurModeRow.Mode.Name:=NewValue;
|
||||||
|
if CurModeRow.Mode.ShowIncludes then begin
|
||||||
|
// this is a group mode => update column caption
|
||||||
|
Columns[ColToBuildGroup(aCol)].Title.Caption:=CurModeRow.Mode.Name;
|
||||||
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
// this is a sub flag => should be empty
|
// this is a sub flag => should be empty
|
||||||
NewValue:='';
|
NewValue:='';
|
||||||
@ -348,7 +359,7 @@ var
|
|||||||
s: String;
|
s: String;
|
||||||
sl: TStringList;
|
sl: TStringList;
|
||||||
begin
|
begin
|
||||||
TypeCol:=GroupModeCount+1;
|
TypeCol:=GetTypeCol;
|
||||||
Identifiers:=TStringToStringTree.Create(false);
|
Identifiers:=TStringToStringTree.Create(false);
|
||||||
sl:=nil;
|
sl:=nil;
|
||||||
try
|
try
|
||||||
@ -484,7 +495,7 @@ begin
|
|||||||
CurModeRow:=SelectedModeRow;
|
CurModeRow:=SelectedModeRow;
|
||||||
if CurModeRow=nil then exit;
|
if CurModeRow=nil then exit;
|
||||||
if CurModeRow.Flag=nil then exit;
|
if CurModeRow.Flag=nil then exit;
|
||||||
ValueCol:=GroupModeCount+2;
|
ValueCol:=GetTypeCol+1;
|
||||||
if CurModeRow.Flag.FlagType in BuildModeFlagPaths then begin
|
if CurModeRow.Flag.FlagType in BuildModeFlagPaths then begin
|
||||||
CurPathEditor:=TPathEditorDialog.Create(nil);
|
CurPathEditor:=TPathEditorDialog.Create(nil);
|
||||||
try
|
try
|
||||||
@ -503,12 +514,30 @@ end;
|
|||||||
|
|
||||||
procedure TBuildModesGrid.GetCheckBoxState(const aCol, aRow: Integer;
|
procedure TBuildModesGrid.GetCheckBoxState(const aCol, aRow: Integer;
|
||||||
var aState: TCheckboxState);
|
var aState: TCheckboxState);
|
||||||
|
var
|
||||||
|
CurModeRow: TBuildModeGridRow;
|
||||||
begin
|
begin
|
||||||
|
if (aRow>=1) and (aRow<=ModeRowCount) then
|
||||||
|
CurModeRow:=ModeRows[aRow-1]
|
||||||
|
else
|
||||||
|
CurModeRow:=nil;
|
||||||
|
if aCol=1 then
|
||||||
|
begin
|
||||||
|
aState:=cbUnchecked;
|
||||||
|
if (CurModeRow<>nil) and (CurModeRow.IndexInGroup=0) then
|
||||||
|
begin
|
||||||
|
if (Graph.SelectedMode=CurModeRow.Mode) then
|
||||||
|
aState:=cbChecked
|
||||||
|
else if CurModeRow.Mode.Active then
|
||||||
|
aState:=cbGrayed;
|
||||||
|
end;
|
||||||
|
end else begin
|
||||||
if CellToInclude(aCol,aRow) then
|
if CellToInclude(aCol,aRow) then
|
||||||
aState:=cbChecked
|
aState:=cbChecked
|
||||||
else
|
else
|
||||||
aState:=cbUnchecked;
|
aState:=cbUnchecked;
|
||||||
//DebugLn(['TBuildModesGrid.GetCheckBoxState ',acol,' ',arow,' ',ord(aState)]);
|
end;
|
||||||
|
//DebugLn(['TBuildModesGrid.GetCheckBoxState Col=',aCol,' Row=',aRow,' State=',ord(aState)]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBuildModesGrid.SetCheckboxState(const aCol, aRow: Integer;
|
procedure TBuildModesGrid.SetCheckboxState(const aCol, aRow: Integer;
|
||||||
@ -518,8 +547,9 @@ var
|
|||||||
GrpID: LongInt;
|
GrpID: LongInt;
|
||||||
GrpMode: TBuildMode;
|
GrpMode: TBuildMode;
|
||||||
NewState: TCheckBoxState;
|
NewState: TCheckBoxState;
|
||||||
|
dummystate: TCheckboxState;
|
||||||
begin
|
begin
|
||||||
DebugLn(['TBuildModesGrid.SetCheckboxState ',acol,' ',arow,' ',ord(aState)]);
|
//DebugLn(['TBuildModesGrid.SetCheckboxState Col=',acol,' Row=',arow,' State=',ord(aState)]);
|
||||||
NewState:=cbUnchecked;
|
NewState:=cbUnchecked;
|
||||||
if (aRow>=1) and (aRow<=ModeRowCount) and (ModeRows[aRow-1].IndexInGroup=0)
|
if (aRow>=1) and (aRow<=ModeRowCount) and (ModeRows[aRow-1].IndexInGroup=0)
|
||||||
then begin
|
then begin
|
||||||
@ -534,26 +564,34 @@ begin
|
|||||||
end else if CurModeRow.Mode.IsIncludedBy(GrpMode)<>(aState=cbChecked) then
|
end else if CurModeRow.Mode.IsIncludedBy(GrpMode)<>(aState=cbChecked) then
|
||||||
begin
|
begin
|
||||||
// state changed
|
// state changed
|
||||||
DebugLn(['TBuildModesGrid.SetCheckboxState STATE CHANGED']);
|
//DebugLn(['TBuildModesGrid.SetCheckboxState INCLUDE CHANGE check=',aState=cbChecked,' GrpMode=',GrpMode.Name,' ClickedMode=',CurModeRow.Mode.Name]);
|
||||||
if aState=cbChecked then begin
|
if aState=cbChecked then begin
|
||||||
GrpMode.Include(CurModeRow.Mode);
|
GrpMode.Include(CurModeRow.Mode);
|
||||||
NewState:=cbChecked;
|
NewState:=cbChecked;
|
||||||
end else begin
|
end else begin
|
||||||
GrpMode.Exclude(CurModeRow.Mode);
|
GrpMode.Exclude(CurModeRow.Mode);
|
||||||
end;
|
end;
|
||||||
|
InvalidateCol(1); // update selected
|
||||||
|
GetCheckBoxState(aCol,aRow,dummystate);
|
||||||
end else begin
|
end else begin
|
||||||
// state kept
|
// state kept
|
||||||
DebugLn(['TBuildModesGrid.SetCheckboxState STATE KEPT']);
|
//DebugLn(['TBuildModesGrid.SetCheckboxState STATE KEPT']);
|
||||||
if CurModeRow.Mode.IsIncludedBy(GrpMode) then
|
if CurModeRow.Mode.IsIncludedBy(GrpMode) then
|
||||||
NewState:=cbChecked;
|
NewState:=cbChecked;
|
||||||
end;
|
end;
|
||||||
end else begin
|
|
||||||
// invalid column
|
|
||||||
DebugLn(['TBuildModesGrid.SetCheckboxState invalid col ',ACol,' ',GrpId,' ',GroupModeCount]);
|
|
||||||
end;
|
|
||||||
end else begin
|
end else begin
|
||||||
// group grid is hidden => keep state
|
// group grid is hidden => keep state
|
||||||
DebugLn(['TBuildModesGrid.SetCheckboxState group grid is hidden']);
|
DebugLn(['TBuildModesGrid.SetCheckboxState group grid is hidden']);
|
||||||
|
end;
|
||||||
|
end else if (aCol=1) and (CurModeRow.IndexInGroup=0) then begin
|
||||||
|
if Graph.SelectedMode=CurModeRow.Mode then
|
||||||
|
Graph.SelectedMode:=nil
|
||||||
|
else
|
||||||
|
Graph.SelectedMode:=CurModeRow.Mode;
|
||||||
|
InvalidateCol(1); // update selected
|
||||||
|
end else begin
|
||||||
|
// invalid column
|
||||||
|
DebugLn(['TBuildModesGrid.SetCheckboxState invalid col Col=',ACol,' GrpID=',GrpId,' GroupModeCount=',GroupModeCount]);
|
||||||
if CellToInclude(aCol,aRow) then
|
if CellToInclude(aCol,aRow) then
|
||||||
NewState:=cbChecked;
|
NewState:=cbChecked;
|
||||||
end;
|
end;
|
||||||
@ -561,7 +599,7 @@ begin
|
|||||||
// invalid row
|
// invalid row
|
||||||
DebugLn(['TBuildModesGrid.SetCheckboxState invalid row']);
|
DebugLn(['TBuildModesGrid.SetCheckboxState invalid row']);
|
||||||
end;
|
end;
|
||||||
DebugLn(['TBuildModesGrid.SetCheckboxState END ',aCol,' ',aRow,' ',ord(NewState)]);
|
//DebugLn(['TBuildModesGrid.SetCheckboxState END Col=',aCol,' Row=',aRow,' NewState=',ord(NewState)]);
|
||||||
inherited SetCheckboxState(aCol, aRow, NewState);
|
inherited SetCheckboxState(aCol, aRow, NewState);
|
||||||
{for i:=1 to ModeRowCount do begin
|
{for i:=1 to ModeRowCount do begin
|
||||||
dbgout(' '+dbgs(i));
|
dbgout(' '+dbgs(i));
|
||||||
@ -615,7 +653,7 @@ var
|
|||||||
r: Integer;
|
r: Integer;
|
||||||
begin
|
begin
|
||||||
if (aRow>=1) and (aRow<=ModeRowCount) then begin
|
if (aRow>=1) and (aRow<=ModeRowCount) then begin
|
||||||
TypeCol:=GroupModeCount+1;
|
TypeCol:=GetTypeCol;
|
||||||
CurModeRow:=ModeRows[aRow-1];
|
CurModeRow:=ModeRows[aRow-1];
|
||||||
//DebugLn(['TBuildModesGrid.DrawCell ',aCol,' ',aRow,' IndexInGroup=',CurModeRow.IndexInGroup]);
|
//DebugLn(['TBuildModesGrid.DrawCell ',aCol,' ',aRow,' IndexInGroup=',CurModeRow.IndexInGroup]);
|
||||||
if (CurModeRow.IndexInGroup>0) and (aCol<TypeCol) then begin
|
if (CurModeRow.IndexInGroup>0) and (aCol<TypeCol) then begin
|
||||||
@ -723,7 +761,7 @@ begin
|
|||||||
InsertPos:=GroupModeCount;
|
InsertPos:=GroupModeCount;
|
||||||
InsertCol:=BuildGroupToCol(GroupModeCount-1);
|
InsertCol:=BuildGroupToCol(GroupModeCount-1);
|
||||||
InsertColRow(true,InsertCol);
|
InsertColRow(true,InsertCol);
|
||||||
Columns[InsertCol].Title.Caption:=' ';
|
Columns[InsertCol].Title.Caption:=Result.Name;
|
||||||
Columns[InsertCol].ButtonStyle:=cbsCheckboxColumn;
|
Columns[InsertCol].ButtonStyle:=cbsCheckboxColumn;
|
||||||
inc(FGroupModeCount);
|
inc(FGroupModeCount);
|
||||||
end else begin
|
end else begin
|
||||||
@ -809,22 +847,24 @@ begin
|
|||||||
// delete a group build mode
|
// delete a group build mode
|
||||||
GroupCol:=Row;
|
GroupCol:=Row;
|
||||||
DeleteColRow(true,GroupCol);
|
DeleteColRow(true,GroupCol);
|
||||||
|
dec(FGroupModeCount);
|
||||||
end;
|
end;
|
||||||
// delete a normal build mode
|
// delete a normal build mode
|
||||||
FModeRows.Remove(CurModeRow);
|
FModeRows.Remove(CurModeRow);
|
||||||
DeleteColRow(false,Row);
|
DeleteColRow(false,Row);
|
||||||
Graph.DeleteMode(CurModeRow.Mode);
|
Graph.DeleteMode(CurModeRow.Mode);
|
||||||
|
Invalidate;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBuildModesGrid.BuildGroupToCol(GroupIndex: integer): integer;
|
function TBuildModesGrid.BuildGroupToCol(GroupIndex: integer): integer;
|
||||||
begin
|
begin
|
||||||
Result:=GroupModeCount-GroupIndex;
|
Result:=GroupModeCount-GroupIndex-1+GetFirstGroupCol;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBuildModesGrid.ColToBuildGroup(aCol: integer): integer;
|
function TBuildModesGrid.ColToBuildGroup(aCol: integer): integer;
|
||||||
begin
|
begin
|
||||||
Result:=GroupModeCount-aCol;
|
Result:=GroupModeCount-1-(aCol-GetFirstGroupCol);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBuildModesGrid.CellToInclude(aCol, aRow: integer): boolean;
|
function TBuildModesGrid.CellToInclude(aCol, aRow: integer): boolean;
|
||||||
@ -832,7 +872,8 @@ var
|
|||||||
GrpID: LongInt;
|
GrpID: LongInt;
|
||||||
CurMode: TBuildModeGridRow;
|
CurMode: TBuildModeGridRow;
|
||||||
begin
|
begin
|
||||||
if (aRow>=1) and (ARow<=GroupModeCount) then begin
|
//DebugLn(['TBuildModesGrid.CellToInclude Col=',aCol,' aRow=',aRow,' GroupModeCount=',GroupModeCount]);
|
||||||
|
if (aRow>=1) and (ARow<=ModeRowCount) then begin
|
||||||
CurMode:=ModeRows[aRow-1];
|
CurMode:=ModeRows[aRow-1];
|
||||||
GrpID:=ColToBuildGroup(aCol);
|
GrpID:=ColToBuildGroup(aCol);
|
||||||
if (GrpID>=0) and (GrpID<GroupModeCount) then begin
|
if (GrpID>=0) and (GrpID<GroupModeCount) then begin
|
||||||
@ -843,6 +884,16 @@ begin
|
|||||||
Result:=false;
|
Result:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TBuildModesGrid.GetFirstGroupCol: integer;
|
||||||
|
begin
|
||||||
|
Result:=2;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TBuildModesGrid.GetTypeCol: integer;
|
||||||
|
begin
|
||||||
|
Result:=GetFirstGroupCol+GroupModeCount;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TBuildModesGrid.RebuildGrid;
|
procedure TBuildModesGrid.RebuildGrid;
|
||||||
var
|
var
|
||||||
GroupInsertPos: Integer;
|
GroupInsertPos: Integer;
|
||||||
@ -872,6 +923,7 @@ var
|
|||||||
TypeCol: Integer;
|
TypeCol: Integer;
|
||||||
ValueCol: Integer;
|
ValueCol: Integer;
|
||||||
CurFlag: TBuildModeFlag;
|
CurFlag: TBuildModeFlag;
|
||||||
|
NeededColCount: Integer;
|
||||||
begin
|
begin
|
||||||
FRebuilding:=true;
|
FRebuilding:=true;
|
||||||
try
|
try
|
||||||
@ -897,14 +949,17 @@ begin
|
|||||||
RowCount:=FModeRows.Count+1;
|
RowCount:=FModeRows.Count+1;
|
||||||
FixedRows:=1;
|
FixedRows:=1;
|
||||||
FixedCols:=0;
|
FixedCols:=0;
|
||||||
while Columns.Count<GroupModeCount+3 do
|
NeededColCount:=GroupModeCount+4;
|
||||||
|
while Columns.Count<NeededColCount do
|
||||||
Columns.Add;
|
Columns.Add;
|
||||||
while Columns.Count>GroupModeCount+3 do
|
while Columns.Count>NeededColCount do
|
||||||
Columns.Delete(Columns.Count-1);
|
Columns.Delete(Columns.Count-1);
|
||||||
TypeCol:=GroupModeCount+1;
|
TypeCol:=GetTypeCol;
|
||||||
ValueCol:=TypeCol+1;
|
ValueCol:=TypeCol+1;
|
||||||
Columns[0].Width:=150;
|
Columns[0].Width:=150;
|
||||||
for i:=1 to TypeCol-1 do begin
|
Columns[1].Width:=15;
|
||||||
|
Columns[1].ButtonStyle:=cbsCheckboxColumn;
|
||||||
|
for i:=GetFirstGroupCol to TypeCol-1 do begin
|
||||||
Columns[i].Width:=15;
|
Columns[i].Width:=15;
|
||||||
Columns[i].ButtonStyle:=cbsCheckboxColumn;
|
Columns[i].ButtonStyle:=cbsCheckboxColumn;
|
||||||
end;
|
end;
|
||||||
@ -1005,8 +1060,6 @@ begin
|
|||||||
DeleteBMRowSpeedButton.LoadGlyphFromLazarusResource('laz_delete');
|
DeleteBMRowSpeedButton.LoadGlyphFromLazarusResource('laz_delete');
|
||||||
NewBuildGroupSpeedButton.Hint:=lisNewGroupASetOfModes;
|
NewBuildGroupSpeedButton.Hint:=lisNewGroupASetOfModes;
|
||||||
NewBuildGroupSpeedButton.LoadGlyphFromLazarusResource('laz_add');
|
NewBuildGroupSpeedButton.LoadGlyphFromLazarusResource('laz_add');
|
||||||
CurBuildModeLabel.Caption:=lisCurrent;
|
|
||||||
CurBuildModeComboBox.Hint:=lisSelectTheActiveBuildMode;
|
|
||||||
|
|
||||||
// laz_edit, arrow_up, arrow_down
|
// laz_edit, arrow_up, arrow_down
|
||||||
UpdateButtons;
|
UpdateButtons;
|
||||||
|
@ -4599,6 +4599,7 @@ resourcestring
|
|||||||
lisUnableToWriteTheProjectInfoFileError = 'Unable to write the project info '
|
lisUnableToWriteTheProjectInfoFileError = 'Unable to write the project info '
|
||||||
+'file%s%s%s%s.%sError: %s';
|
+'file%s%s%s%s.%sError: %s';
|
||||||
lisBuildMode = 'Build mode';
|
lisBuildMode = 'Build mode';
|
||||||
|
lisSelected = 'Selected';
|
||||||
lisDeleteRow = 'Delete row';
|
lisDeleteRow = 'Delete row';
|
||||||
lisDeleteSetting = 'Delete setting';
|
lisDeleteSetting = 'Delete setting';
|
||||||
lisDeleteBuildMode = 'Delete build mode';
|
lisDeleteBuildMode = 'Delete build mode';
|
||||||
|
Loading…
Reference in New Issue
Block a user