forked from Noso-Project/NosoLite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
formnetwork.pas
70 lines (52 loc) · 1.72 KB
/
formnetwork.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
62
63
64
65
66
67
68
69
unit formnetwork;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Grids, nl_functions, nl_data;
type
{ TForm6 }
TForm6 = class(TForm)
LabelNodes: TLabel;
SGridNodes: TStringGrid;
procedure SGridNodesPrepareCanvas(Sender: TObject; aCol, aRow: Integer;
aState: TGridDrawState);
procedure SGridNodesResize(Sender: TObject);
private
public
end;
var
Form6: TForm6;
implementation
{$R *.lfm}
{ TForm6 }
procedure TForm6.SGridNodesResize(Sender: TObject);
var
GridWidth : integer;
Begin
GridWidth := form6.Width;
SGridNodes.ColWidths[0] := ThisPercent(17,GridWidth);
SGridNodes.ColWidths[1] := ThisPercent(10,GridWidth);
SGridNodes.ColWidths[2] := ThisPercent(10,GridWidth);
SGridNodes.ColWidths[3] := ThisPercent(15,GridWidth);
SGridNodes.ColWidths[4] := ThisPercent(15,GridWidth);
SGridNodes.ColWidths[5] := ThisPercent(8,GridWidth);
SGridNodes.ColWidths[6] := ThisPercent(8,GridWidth);
SGridNodes.ColWidths[7] := ThisPercent(17,GridWidth,true);
end;
procedure TForm6.SGridNodesPrepareCanvas(Sender: TObject; aCol, aRow: Integer;
aState: TGridDrawState);
var
ts: TTextStyle;
Begin
ts := (Sender as TStringGrid).Canvas.TextStyle;
if aRow > 0 then
begin
{
if ARRAY_Nodes[aRow-1].Updated=0 then (Sender as TStringGrid).Canvas.Brush.Color := clgreen;
if ((ARRAY_Nodes[aRow-1].Updated>0) and (ARRAY_Nodes[aRow-1].Updated<6)) then (Sender as TStringGrid).Canvas.Brush.Color := clyellow;
if ARRAY_Nodes[aRow-1].Updated>5 then (Sender as TStringGrid).Canvas.Brush.Color := clRed;
if ( (ARRAY_Nodes[aRow-1].Updated=0) and (not ARRAY_Nodes[aRow-1].Synced) ) then (Sender as TStringGrid).Canvas.Brush.Color := clAqua;
}
end;
end;
end.