mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-18 11:40:44 +02:00
IDE: mode matrix: assign methods
git-svn-id: trunk@40914 -
This commit is contained in:
parent
be33c6031e
commit
38b403a0b7
@ -42,7 +42,7 @@ type
|
|||||||
BMMNewTargetToolButton: TToolButton;
|
BMMNewTargetToolButton: TToolButton;
|
||||||
BMMNewOptionToolButton: TToolButton;
|
BMMNewOptionToolButton: TToolButton;
|
||||||
BMMDeleteToolButton: TToolButton;
|
BMMDeleteToolButton: TToolButton;
|
||||||
procedure GridSelection(Sender: TObject; aCol, aRow: Integer);
|
procedure GridSelection(Sender: TObject; {%H-}aCol, {%H-}aRow: Integer);
|
||||||
private
|
private
|
||||||
FGrid: TGroupedMatrixControl;
|
FGrid: TGroupedMatrixControl;
|
||||||
procedure UpdateButtons;
|
procedure UpdateButtons;
|
||||||
|
@ -24,6 +24,7 @@ type
|
|||||||
FRowInGrid: integer;
|
FRowInGrid: integer;
|
||||||
procedure SetGroup(AValue: TGroupedMatrixGroup);
|
procedure SetGroup(AValue: TGroupedMatrixGroup);
|
||||||
public
|
public
|
||||||
|
procedure Assign(Source: TPersistent); override;
|
||||||
constructor Create(aMatrix: TGroupedMatrix); virtual;
|
constructor Create(aMatrix: TGroupedMatrix); virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Clear; virtual;
|
procedure Clear; virtual;
|
||||||
@ -54,6 +55,7 @@ type
|
|||||||
procedure SetCaption(AValue: TCaption);
|
procedure SetCaption(AValue: TCaption);
|
||||||
procedure SetColor(AValue: TColor);
|
procedure SetColor(AValue: TColor);
|
||||||
public
|
public
|
||||||
|
procedure Assign(Source: TPersistent); override;
|
||||||
constructor Create(aControl: TGroupedMatrix); override;
|
constructor Create(aControl: TGroupedMatrix); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Clear; override;
|
procedure Clear; override;
|
||||||
@ -79,6 +81,7 @@ type
|
|||||||
procedure SetTyp(AValue: string);
|
procedure SetTyp(AValue: string);
|
||||||
procedure SetValue(AValue: string);
|
procedure SetValue(AValue: string);
|
||||||
public
|
public
|
||||||
|
procedure Assign(Source: TPersistent); override;
|
||||||
constructor Create(aControl: TGroupedMatrix); override;
|
constructor Create(aControl: TGroupedMatrix); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
property Value: string read FValue write SetValue;
|
property Value: string read FValue write SetValue;
|
||||||
@ -94,6 +97,7 @@ type
|
|||||||
FCaption: string;
|
FCaption: string;
|
||||||
FColor: TColor;
|
FColor: TColor;
|
||||||
public
|
public
|
||||||
|
procedure Assign(Source: TPersistent); override;
|
||||||
constructor Create;
|
constructor Create;
|
||||||
property Caption: string read FCaption write FCaption;
|
property Caption: string read FCaption write FCaption;
|
||||||
property Color: TColor read FColor write FColor;
|
property Color: TColor read FColor write FColor;
|
||||||
@ -107,6 +111,7 @@ type
|
|||||||
fItems: TFPList; // list of TGroupedMatrixMode
|
fItems: TFPList; // list of TGroupedMatrixMode
|
||||||
function GetItems(Index: integer): TGroupedMatrixMode;
|
function GetItems(Index: integer): TGroupedMatrixMode;
|
||||||
public
|
public
|
||||||
|
procedure Assign(Source: TObject);
|
||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
@ -131,6 +136,7 @@ type
|
|||||||
procedure InternalAdd(Group: TGroupedMatrixGroup; Row: TGroupedMatrixRow);
|
procedure InternalAdd(Group: TGroupedMatrixGroup; Row: TGroupedMatrixRow);
|
||||||
procedure RebuildRows;
|
procedure RebuildRows;
|
||||||
public
|
public
|
||||||
|
procedure Assign(Source: TPersistent); override;
|
||||||
constructor Create(aControl: TGroupedMatrixControl);
|
constructor Create(aControl: TGroupedMatrixControl);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
@ -224,6 +230,19 @@ end;
|
|||||||
|
|
||||||
{ TGroupedMatrixMode }
|
{ TGroupedMatrixMode }
|
||||||
|
|
||||||
|
procedure TGroupedMatrixMode.Assign(Source: TPersistent);
|
||||||
|
var
|
||||||
|
aSource: TGroupedMatrixMode;
|
||||||
|
begin
|
||||||
|
if Source is TGroupedMatrixMode then
|
||||||
|
begin
|
||||||
|
aSource:=TGroupedMatrixMode(Source);
|
||||||
|
Color:=aSource.Color;
|
||||||
|
Caption:=aSource.Caption;
|
||||||
|
end else
|
||||||
|
inherited Assign(Source);
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TGroupedMatrixMode.Create;
|
constructor TGroupedMatrixMode.Create;
|
||||||
begin
|
begin
|
||||||
FColor:=clDefault;
|
FColor:=clDefault;
|
||||||
@ -236,6 +255,27 @@ begin
|
|||||||
Result:=TGroupedMatrixMode(fItems[Index]);
|
Result:=TGroupedMatrixMode(fItems[Index]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TGroupedMatrixModes.Assign(Source: TObject);
|
||||||
|
var
|
||||||
|
SrcModes: TGroupedMatrixModes;
|
||||||
|
i: Integer;
|
||||||
|
SrcMode: TGroupedMatrixMode;
|
||||||
|
NewMode: TGroupedMatrixMode;
|
||||||
|
begin
|
||||||
|
if Source is TGroupedMatrixModes then
|
||||||
|
begin
|
||||||
|
SrcModes:=TGroupedMatrixModes(Source);
|
||||||
|
Active:=SrcModes.Active;
|
||||||
|
Clear;
|
||||||
|
for i:=0 to SrcModes.Count-1 do begin
|
||||||
|
SrcMode:=SrcModes[i];
|
||||||
|
NewMode:=TGroupedMatrixMode(SrcMode.ClassType).Create;
|
||||||
|
fItems.Add(NewMode);
|
||||||
|
NewMode.Assign(SrcMode);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TGroupedMatrixModes.Create;
|
constructor TGroupedMatrixModes.Create;
|
||||||
begin
|
begin
|
||||||
fItems:=TFPList.Create;
|
fItems:=TFPList.Create;
|
||||||
@ -329,6 +369,29 @@ begin
|
|||||||
Traverse(TopLvlItems[i]);
|
Traverse(TopLvlItems[i]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TGroupedMatrix.Assign(Source: TPersistent);
|
||||||
|
var
|
||||||
|
SrcMatrix: TGroupedMatrix;
|
||||||
|
i: Integer;
|
||||||
|
SrcRow: TGroupedMatrixRow;
|
||||||
|
NewRow: TGroupedMatrixRow;
|
||||||
|
begin
|
||||||
|
if Source is TGroupedMatrix then
|
||||||
|
begin
|
||||||
|
SrcMatrix:=TGroupedMatrix(Source);
|
||||||
|
Clear;
|
||||||
|
Modes.Assign(SrcMatrix.Modes);
|
||||||
|
for i:=0 to SrcMatrix.TopLvlCount-1 do begin
|
||||||
|
SrcRow:=SrcMatrix.TopLvlItems[i];
|
||||||
|
NewRow:=TGroupedMatrixRow(SrcRow.ClassType).Create(Self);
|
||||||
|
FTopLvlRows.Add(NewRow);
|
||||||
|
NewRow.Assign(SrcRow);
|
||||||
|
end;
|
||||||
|
RebuildRows;
|
||||||
|
end else
|
||||||
|
inherited Assign(Source);
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TGroupedMatrix.Create(aControl: TGroupedMatrixControl);
|
constructor TGroupedMatrix.Create(aControl: TGroupedMatrixControl);
|
||||||
begin
|
begin
|
||||||
FControl:=aControl;
|
FControl:=aControl;
|
||||||
@ -426,7 +489,7 @@ end;
|
|||||||
procedure TGroupedMatrixValue.SetModes(AValue: TStrings);
|
procedure TGroupedMatrixValue.SetModes(AValue: TStrings);
|
||||||
begin
|
begin
|
||||||
if FModes=AValue then Exit;
|
if FModes=AValue then Exit;
|
||||||
FModes:=AValue;
|
FModes.Assign(AValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGroupedMatrixValue.SetTyp(AValue: string);
|
procedure TGroupedMatrixValue.SetTyp(AValue: string);
|
||||||
@ -441,6 +504,20 @@ begin
|
|||||||
FValue:=AValue;
|
FValue:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TGroupedMatrixValue.Assign(Source: TPersistent);
|
||||||
|
var
|
||||||
|
aSource: TGroupedMatrixValue;
|
||||||
|
begin
|
||||||
|
inherited Assign(Source);
|
||||||
|
if Source is TGroupedMatrixValue then
|
||||||
|
begin
|
||||||
|
aSource:=TGroupedMatrixValue(Source);
|
||||||
|
Value:=aSource.Value;
|
||||||
|
Typ:=aSource.Typ;
|
||||||
|
Modes:=aSource.Modes;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TGroupedMatrixValue.Create(aControl: TGroupedMatrix);
|
constructor TGroupedMatrixValue.Create(aControl: TGroupedMatrix);
|
||||||
begin
|
begin
|
||||||
inherited Create(aControl);
|
inherited Create(aControl);
|
||||||
@ -482,6 +559,30 @@ begin
|
|||||||
FColor:=AValue;
|
FColor:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TGroupedMatrixGroup.Assign(Source: TPersistent);
|
||||||
|
var
|
||||||
|
SrcGroup: TGroupedMatrixGroup;
|
||||||
|
i: Integer;
|
||||||
|
SrcItem: TGroupedMatrixRow;
|
||||||
|
Item: TGroupedMatrixRow;
|
||||||
|
begin
|
||||||
|
inherited Assign(Source);
|
||||||
|
if Source is TGroupedMatrixGroup then
|
||||||
|
begin
|
||||||
|
SrcGroup:=TGroupedMatrixGroup(Source);
|
||||||
|
FColor:=SrcGroup.FColor;
|
||||||
|
FCaption:=SrcGroup.FCaption;
|
||||||
|
Clear;
|
||||||
|
for i:=0 to SrcGroup.Count-1 do begin
|
||||||
|
SrcItem:=SrcGroup[i];
|
||||||
|
Item:=TGroupedMatrixRow(SrcItem.ClassType).Create(Matrix);
|
||||||
|
FItems.Add(Item);
|
||||||
|
Item.FGroup:=Self;
|
||||||
|
Item.Assign(SrcItem);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TGroupedMatrixGroup.Create(aControl: TGroupedMatrix);
|
constructor TGroupedMatrixGroup.Create(aControl: TGroupedMatrix);
|
||||||
begin
|
begin
|
||||||
inherited Create(aControl);
|
inherited Create(aControl);
|
||||||
@ -564,6 +665,18 @@ begin
|
|||||||
FGroup.FItems.Add(Self);
|
FGroup.FItems.Add(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TGroupedMatrixRow.Assign(Source: TPersistent);
|
||||||
|
var
|
||||||
|
aSource: TGroupedMatrixRow;
|
||||||
|
begin
|
||||||
|
if Source is TGroupedMatrixRow then
|
||||||
|
begin
|
||||||
|
aSource:=TGroupedMatrixRow(Source);
|
||||||
|
FRowInGrid:=aSource.FRowInGrid;
|
||||||
|
end else
|
||||||
|
inherited Assign(Source);
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TGroupedMatrixRow.Create(aMatrix: TGroupedMatrix);
|
constructor TGroupedMatrixRow.Create(aMatrix: TGroupedMatrix);
|
||||||
begin
|
begin
|
||||||
fMatrix:=aMatrix;
|
fMatrix:=aMatrix;
|
||||||
|
Loading…
Reference in New Issue
Block a user