From 4cd9929af6e61deb341182fb275d610b52fa79de Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 8 Jun 2013 20:19:30 +0000 Subject: [PATCH] IDE: mode matrix: on delete build mode, delete grid columns git-svn-id: trunk@41604 - --- ide/frames/compiler_modematrix.pas | 7 ++++++- ide/frames/modematrixctrl.pas | 10 ++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ide/frames/compiler_modematrix.pas b/ide/frames/compiler_modematrix.pas index fbad81102e..50bc740270 100644 --- a/ide/frames/compiler_modematrix.pas +++ b/ide/frames/compiler_modematrix.pas @@ -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); diff --git a/ide/frames/modematrixctrl.pas b/ide/frames/modematrixctrl.pas index cac3b99b27..4f22b6cb73 100644 --- a/ide/frames/modematrixctrl.pas +++ b/ide/frames/modematrixctrl.pas @@ -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;