summaryrefslogtreecommitdiff
path: root/extras/contributed/nicegrid/main3.pas
blob: 84853b4229f756f28ca6e305cbc4325cf83b105b (plain)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
unit main3;

{$mode objfpc}{$H+}

interface

uses
  SysUtils, Classes,  fpg_base, fpg_main, fpg_form, fpg_panel, fpg_splitter,
  fpg_nicegrid;

type
  TfrmMain = class(TfpgForm)
  private
    Panel1: TfpgPanel;
    Splitter1: TfpgSplitter;
    Grid1: TfpgNiceGrid;
    GridSync1: TfpgNiceGridSync;
  public
    procedure AfterCreate; override;
  end;



implementation

procedure TfrmMain.AfterCreate;
begin
  Name := 'frmMain';
  SetPosition(260, 99, 719, 570);
  WindowTitle := 'Tabel Budget';
  Hint := ''; 
  WindowAttributes := [waSizeable, waScreenCenterPos];
  
  Panel1:= TfpgPanel.Create(self);
  with Panel1 do
  begin	  
    Left:= 16;
    Top:= 16;
    Width:= 682;
    Height:= 504;
    Anchors:= [anLeft, anTop, anRight, anBottom];
    TabOrder:= 0;
  end;

  GridSync1:= TfpgNiceGridSync.Create(Panel1);
  with GridSync1 do
  begin
    BeginUpdate;
    Name := 'GridSync1';
    Left:= 1;
    Top:= 1;
    Width:= 329;
    Height:= 502;
    ColCount:= 3;
    RowCount:= 20;
    AutoAddRow:= True;
    GridColor:= clSilver;
    HeaderLine:= 2;
    FooterFontColor:= clBlack;
    FitToWidth:= True;

    with Columns.Items[0]do
    begin
      Title:= 'Unit Name';
      Width:= 135;
    end;
    with Columns.Items[1]do
    begin
      Title:= 'Unit Cost|Capital';
      Width:= 80;
      Color:= 15790335;
      CanResize:= False;
    end;
    with Columns.Items[2]do
    begin
      Title:= 'Unit Cost|Non Capital';
      Width:= 80;
      Color:= 14671871;
      CanResize:= False;
    end;
    GutterKind:= gkNumber;
    GutterWidth:= 30;
    ShowFooter:= False;
    GutterFont:='Arial-8';
    GutterFontColor:=clBlack;
    Align:= alLeft;
    TabOrder:= 1;
    EndUpdate;
  end;
  
  Splitter1:= TfpgSplitter.Create(Panel1);
  with Splitter1 do
  begin
    Name:='Splitter1';
    SetPosition(330,1,8,502);  
    Align := alLeft;
  end;
  
  Grid1:= TfpgNiceGrid.Create(Panel1);
  with Grid1 do
  begin
    BeginUpdate;
    Name := 'Grid1';
    Left:= 338;
    Top:= 1;
    Width:= 344;
    Height:= 502;
    ColCount:= 12;
    RowCount:= 20;
    GridColor:= clSilver;
    HeaderLine:= 2;
    HeaderColor := clButtonFace;
    HeaderLightColor := clHilite1;
    HeaderDarkColor := clShadow1;
    FooterFontColor:= clBlack;

    with Columns.Items[0]do
    begin
      Title:= '0|Capital';
      Width:= 80;
      Color:= 16775924;
    end;
    with Columns.Items[1]do
    begin
      Title:= '0|Non Capital';
      Width:= 80;
      Color:= 16773601;
    end;
    with Columns.Items[2]do
    begin
      Title:= '2000|Capital';
      Width:= 80;
      Color:= 16775924;
    end;
    with Columns.Items[3]do
    begin
      Title:= '2000|Non Capital';
      Width:= 80;
      Color:= 16773601;
    end;
    with Columns.Items[4]do
    begin
      Title:= '2001|Capital';
      Width:= 80;
      Color:= 16775924;
    end;
    with Columns.Items[5]do
    begin
      Title:= '2001|Non Capital';
      Width:= 80;
      Color:= 16773601;
    end;
    with Columns.Items[6]do
    begin
      Title:= '2002|Capital';
      Width:= 80;
      Color:= 16775924;
    end;
    with Columns.Items[7]do
    begin
      Title:= '2002|Non Capital';
      Width:= 80;
      Color:= 16773601;
    end;
    with Columns.Items[8]do
    begin
      Title:= '2003|Capital';
      Width:= 80;
      Color:= 16775924;
    end;
    with Columns.Items[9]do
    begin
      Title:= '2003|Non Capital';
      Width:= 80;
      Color:= 16773601;
    end;
    with Columns.Items[10]do
    begin
      Title:= '2004|Capital';
      Width:= 80;
      Color:= 16775924;
    end;
    with Columns.Items[11]do
    begin
      Title:= '2004|Non Capital';
      Width:= 80;
      Color:= 16773601;
    end;
    GutterKind:= gkNone;
    GutterWidth:= 40;
    Align:= alClient;

    GutterFont:='Arial-8';
    GutterFontColor:=clBlack;
    ShowFooter:=True;

    TabOrder:= 0;
    EndUpdate;
  end;
  
  GridSync1.MasterGrid:= Grid1;
end;

end.