forked from vladk1973/npp.connections
-
Notifications
You must be signed in to change notification settings - Fork 0
/
StringGridsUnit.pas
61 lines (49 loc) · 1.6 KB
/
StringGridsUnit.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
unit StringGridsUnit;
interface
uses
Winapi.Windows, System.SysUtils, System.Classes, System.Contnrs,
System.Win.ComObj, Vcl.Grids, Graphics, StringGridExUnit;
type
TObjectStrings = class(TObjectList)
private
FName: string;
FTag: integer;
FDescription: string;
FConnectionString: string;
function GetItem(Index: Integer): TStringGrid;
procedure SetItem(Index: Integer; const Value: TStringGrid);
procedure SetName(const Value: string);
procedure SetConnectionString(const Value: string);
public
function Add: TStringGridEx;overload;
property Items[Index: Integer]: TStringGrid read GetItem write SetItem; default;
property Name: string read FName write SetName;
property Tag: integer read FTag write FTag;
property Description: string read FDescription write FDescription;
property ConnectionString: string read FConnectionString write SetConnectionString;
end;
TStringGrids = class(TObjectStrings);
implementation
{ TObjectStrings }
function TObjectStrings.Add: TStringGridEx;
begin
Result := TStringGridEx.Create(nil);
inherited Add(Result);
end;
function TObjectStrings.GetItem(Index: Integer): TStringGrid;
begin
Result := TStringGrid(inherited Items[Index]);
end;
procedure TObjectStrings.SetConnectionString(const Value: string);
begin
FConnectionString := Value;
end;
procedure TObjectStrings.SetItem(Index: Integer; const Value: TStringGrid);
begin
inherited Items[Index] := Value;
end;
procedure TObjectStrings.SetName(const Value: string);
begin
FName := Value;
end;
end.