IDE: mode matrix: on delete build mode, delete grid columns

git-svn-id: trunk@41604 -
This commit is contained in:
mattias 2013-06-08 20:19:30 +00:00
parent 595f395fde
commit 4cd9929af6
2 changed files with 16 additions and 1 deletions

View File

@ -26,8 +26,8 @@
ToDo:
- update matrix, when deleting build mode
- move inherited to show options
- move conditionals to Other
- move IDE macros only for package usage
- move conditionals to Other
- undo: combine changes while editing a cell
}
unit Compiler_ModeMatrix;
@ -859,6 +859,11 @@ begin
end;
end;
end;
// delete build modes
while Grid.Modes.Count>BuildModes.Count do begin
Grid.Modes.Delete(Grid.Modes.Count-1);
GridHasChanged:=true;
end;
UpdateEnabledModesInGrid(EnvironmentOptions.BuildMatrixOptions,GroupIDE,ValuesHaveChanged);
UpdateEnabledModesInGrid(LazProject.BuildModes.SharedMatrixOptions,GroupProject,ValuesHaveChanged);

View File

@ -156,6 +156,7 @@ type
property Items[Index: integer]: TGroupedMatrixMode read GetItems; default;
function Count: integer;
function Add(aCaption: string; aColor: TColor = clDefault): TGroupedMatrixMode;
procedure Delete(Index: integer);
end;
TGroupedMatrixModesClass = class of TGroupedMatrixModes;
@ -411,6 +412,15 @@ begin
fItems.Add(Result);
end;
procedure TGroupedMatrixModes.Delete(Index: integer);
var
Item: TGroupedMatrixMode;
begin
Item:=Items[Index];
fItems.Delete(Index);
Item.Free;
end;
{ TGroupedMatrix }
function TGroupedMatrix.GetRows(Index: integer): TGroupedMatrixRow;