mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 10:49:09 +02:00
IDE: mode matrix: new target
git-svn-id: trunk@40944 -
This commit is contained in:
parent
3ca47329ed
commit
b5991e8bb6
@ -99,8 +99,37 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFrame1.BMMNewTargetToolButtonClick(Sender: TObject);
|
procedure TFrame1.BMMNewTargetToolButtonClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
aRow: Integer;
|
||||||
|
MatRow: TGroupedMatrixRow;
|
||||||
|
Group: TGroupedMatrixGroup;
|
||||||
begin
|
begin
|
||||||
|
aRow:=Grid.Row;
|
||||||
|
if aRow<Grid.FixedRows then aRow:=Grid.FixedRows;
|
||||||
|
Grid.MatrixChanging;
|
||||||
|
try
|
||||||
|
Grid.StoreUndo;
|
||||||
|
MatRow:=Grid.Matrix[aRow-1];
|
||||||
|
if MatRow is TGroupedMatrixGroup then
|
||||||
|
Group:=TGroupedMatrixGroup(MatRow)
|
||||||
|
else
|
||||||
|
Group:=MatRow.Group;
|
||||||
|
if Group.Group=nil then begin
|
||||||
|
// Group is a storage group
|
||||||
|
// => add as first target of storage group
|
||||||
|
Grid.Matrix.AddGroup(Group,'Target: *');
|
||||||
|
Group.Move(Group.Count-1,0);
|
||||||
|
end else begin
|
||||||
|
// Group is a target
|
||||||
|
// => add target behind current target
|
||||||
|
Grid.Matrix.AddGroup(Group.Group,'Target: *');
|
||||||
|
Group.Group.Move(Group.Group.Count-1,Group.GetGroupIndex+1);
|
||||||
|
end;
|
||||||
|
Grid.Matrix.RebuildRows;
|
||||||
|
finally
|
||||||
|
Grid.MatrixChanged;
|
||||||
|
end;
|
||||||
|
UpdateButtons;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFrame1.BMMMoveDownToolButtonClick(Sender: TObject);
|
procedure TFrame1.BMMMoveDownToolButtonClick(Sender: TObject);
|
||||||
|
@ -67,6 +67,7 @@ type
|
|||||||
property Count: integer read GetCount;
|
property Count: integer read GetCount;
|
||||||
property Items[Index: integer]: TGroupedMatrixRow read GetItems; default;
|
property Items[Index: integer]: TGroupedMatrixRow read GetItems; default;
|
||||||
function IndexOfRow(aRow: TGroupedMatrixRow): integer;
|
function IndexOfRow(aRow: TGroupedMatrixRow): integer;
|
||||||
|
procedure Move(CurIndex, NewIndex: integer);
|
||||||
function GetNext: TGroupedMatrixRow; override;
|
function GetNext: TGroupedMatrixRow; override;
|
||||||
function GetLastLeaf: TGroupedMatrixRow; override;
|
function GetLastLeaf: TGroupedMatrixRow; override;
|
||||||
property Color: TColor read FColor write SetColor;
|
property Color: TColor read FColor write SetColor;
|
||||||
@ -141,13 +142,13 @@ type
|
|||||||
function GetTopLvlCount: integer;
|
function GetTopLvlCount: integer;
|
||||||
function GetTopLvlItems(Index: integer): TGroupedMatrixRow;
|
function GetTopLvlItems(Index: integer): TGroupedMatrixRow;
|
||||||
procedure InternalAdd(Group: TGroupedMatrixGroup; Row: TGroupedMatrixRow);
|
procedure InternalAdd(Group: TGroupedMatrixGroup; Row: TGroupedMatrixRow);
|
||||||
procedure RebuildRows;
|
|
||||||
public
|
public
|
||||||
procedure Assign(Source: TPersistent); override;
|
procedure Assign(Source: TPersistent); override;
|
||||||
constructor Create(aControl: TGroupedMatrixControl);
|
constructor Create(aControl: TGroupedMatrixControl);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
function Equals(Obj: TObject): boolean; override;
|
function Equals(Obj: TObject): boolean; override;
|
||||||
|
procedure RebuildRows;
|
||||||
property RowCount: integer read GetRowCount;
|
property RowCount: integer read GetRowCount;
|
||||||
property Rows[Index: integer]: TGroupedMatrixRow read GetRows; default;
|
property Rows[Index: integer]: TGroupedMatrixRow read GetRows; default;
|
||||||
procedure DeleteRow(Index: integer);
|
procedure DeleteRow(Index: integer);
|
||||||
@ -731,6 +732,11 @@ begin
|
|||||||
Result:=-1;
|
Result:=-1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TGroupedMatrixGroup.Move(CurIndex, NewIndex: integer);
|
||||||
|
begin
|
||||||
|
FItems.Move(CurIndex,NewIndex);
|
||||||
|
end;
|
||||||
|
|
||||||
function TGroupedMatrixGroup.GetNext: TGroupedMatrixRow;
|
function TGroupedMatrixGroup.GetNext: TGroupedMatrixRow;
|
||||||
begin
|
begin
|
||||||
if Count>0 then
|
if Count>0 then
|
||||||
|
Loading…
Reference in New Issue
Block a user