├── .gitignore
├── Demo
├── Basic
│ ├── BasicDemo.dpr
│ ├── BasicDemo.dproj
│ ├── BasicDemo.res
│ ├── Unit1.dfm
│ └── Unit1.pas
├── CheckBox
│ ├── CheckBoxDemo.dpr
│ ├── CheckBoxDemo.dproj
│ ├── CheckBoxDemo.res
│ ├── Unit1.dfm
│ └── Unit1.pas
├── ColumnClick
│ ├── ColumnClickDemo.dpr
│ ├── ColumnClickDemo.dproj
│ ├── ColumnClickDemo.res
│ ├── Unit1.dfm
│ └── Unit1.pas
├── CustomHeaderMenu
│ ├── CustomHeaderMenuDemo.dpr
│ ├── CustomHeaderMenuDemo.dproj
│ ├── CustomHeaderMenuDemo.res
│ ├── HeaderMenuDemo.res
│ ├── Unit1.dfm
│ ├── Unit1.pas
│ ├── Unit2.dfm
│ └── Unit2.pas
├── MyBase
│ ├── MyBaseDemo.dpr
│ ├── MyBaseDemo.dproj
│ ├── MyBaseDemo.res
│ ├── Unit1.dfm
│ ├── Unit1.pas
│ ├── customer.cds
│ └── customer.xml
└── OwnerDraw1
│ ├── OwnerDrawDemo1.dpr
│ ├── OwnerDrawDemo1.dproj
│ ├── OwnerDrawDemo1.res
│ ├── Unit1.dfm
│ └── Unit1.pas
├── LICENSE
├── Packages
└── Delphi
│ ├── GridViewDD.dpk
│ ├── GridViewDD.dproj
│ ├── GridViewDD.res
│ ├── GridViewDR.dpk
│ ├── GridViewDR.dproj
│ └── GridViewDR.res
├── README.md
└── Source
├── Ex_DBGrid.bmp
├── Ex_DBGrid.pas
├── Ex_DBGrid.rc
├── Ex_DBGrid.res
├── Ex_Grid.pas
├── Ex_GridC.dfm
├── Ex_GridC.pas
├── Ex_GridH.dfm
├── Ex_GridH.pas
├── Ex_RegGrid.dcr
└── Ex_RegGrid.pas
/.gitignore:
--------------------------------------------------------------------------------
1 | *.dcu
2 | *.local
3 | *.identcache
4 | *.dsk
5 | *.stat
6 | *.map
7 | *.~*
8 | /Debug
9 | /Release
10 | /Win32
11 | /Win64
12 | /__history
13 | /__recovery
14 |
--------------------------------------------------------------------------------
/Demo/Basic/BasicDemo.dpr:
--------------------------------------------------------------------------------
1 | program BasicDemo;
2 |
3 | uses
4 | Vcl.Forms,
5 | Unit1 in 'Unit1.pas' {Form1};
6 |
7 | {$R *.res}
8 |
9 | begin
10 | Application.Initialize;
11 | Application.MainFormOnTaskbar := True;
12 | Application.CreateForm(TForm1, Form1);
13 | Application.Run;
14 | end.
15 |
--------------------------------------------------------------------------------
/Demo/Basic/BasicDemo.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {A10DD545-2CF1-4504-A01A-EB05921E09A0}
4 | 18.6
5 | VCL
6 | BasicDemo.dpr
7 | True
8 | Debug
9 | Win32
10 | 1
11 | Application
12 |
13 |
14 | true
15 |
16 |
17 | true
18 | Base
19 | true
20 |
21 |
22 | true
23 | Base
24 | true
25 |
26 |
27 | true
28 | Cfg_1
29 | true
30 | true
31 |
32 |
33 | true
34 | Base
35 | true
36 |
37 |
38 | true
39 | Cfg_2
40 | true
41 | true
42 |
43 |
44 | $(BDS)\bin\delphi_PROJECTICON.ico
45 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=
46 | ..\..\Source;$(DCC_UnitSearchPath)
47 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png
48 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png
49 | BasicDemo
50 | 1049
51 | System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)
52 | .\$(Platform)\$(Config)
53 | .\$(Platform)\$(Config)
54 | false
55 | false
56 | false
57 | false
58 | false
59 |
60 |
61 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
62 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=
63 | true
64 | rtl;vclwinx;UIRibbonPackageDR;vcl;CustomIPTransport;vclactnband;IndyCore;vcldsnap;IndySystem;vclx;SynEditDR;bindcomp;appanalytics;svnui;tethering;dsnap;bindcompvcl;vclimg;vcltouch;VclSmp;vcldb;bindcompfmx;svn;GridViewDR;vclie;bindengine;dbrtl;IndyProtocols;fmx;fmxdae;xmlrtl;fmxobj;inet;fmxase;$(DCC_UsePackage)
65 | $(BDS)\bin\default_app.manifest
66 | 1033
67 |
68 |
69 | DEBUG;$(DCC_Define)
70 | true
71 | false
72 | true
73 | true
74 | true
75 |
76 |
77 | true
78 | true
79 | 1033
80 | false
81 | PerMonitor
82 | Debug
83 |
84 |
85 | false
86 | RELEASE;$(DCC_Define)
87 | 0
88 | 0
89 |
90 |
91 | true
92 | PerMonitor
93 |
94 |
95 |
96 | MainSource
97 |
98 |
99 |
100 | dfm
101 |
102 |
103 | Cfg_2
104 | Base
105 |
106 |
107 | Base
108 |
109 |
110 | Cfg_1
111 | Base
112 |
113 |
114 |
115 | Delphi.Personality.12
116 | Application
117 |
118 |
119 |
120 | BasicDemo.dpr
121 |
122 |
123 |
124 | True
125 |
126 |
127 | 12
128 |
129 |
130 |
131 |
132 |
--------------------------------------------------------------------------------
/Demo/Basic/BasicDemo.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/checker2/GridView/191ab645e7bda4e678da383b06f52cb1edbb637c/Demo/Basic/BasicDemo.res
--------------------------------------------------------------------------------
/Demo/Basic/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object Form1: TForm1
2 | Left = 0
3 | Top = 0
4 | Caption = 'TGridView Basic Demo'
5 | ClientHeight = 300
6 | ClientWidth = 635
7 | Color = clBtnFace
8 | Font.Charset = DEFAULT_CHARSET
9 | Font.Color = clWindowText
10 | Font.Height = -11
11 | Font.Name = 'Tahoma'
12 | Font.Style = []
13 | OldCreateOrder = False
14 | OnCreate = FormCreate
15 | PixelsPerInch = 96
16 | TextHeight = 13
17 | object GridView1: TGridView
18 | Left = 0
19 | Top = 0
20 | Width = 635
21 | Height = 300
22 | Align = alClient
23 | AllowEdit = True
24 | Columns = <
25 | item
26 | Caption = '#'
27 | FixedSize = True
28 | DefWidth = 32
29 | end
30 | item
31 | Caption = 'A'
32 | end
33 | item
34 | Caption = 'B'
35 | end
36 | item
37 | Caption = 'C'
38 | end
39 | item
40 | Caption = 'D'
41 | end
42 | item
43 | Caption = 'E'
44 | end
45 | item
46 | Caption = 'F'
47 | end
48 | item
49 | Caption = 'G'
50 | end
51 | item
52 | Caption = 'H'
53 | end
54 | item
55 | Caption = 'I'
56 | end
57 | item
58 | Caption = 'J'
59 | end
60 | item
61 | Caption = 'K'
62 | end
63 | item
64 | Caption = 'L'
65 | end
66 | item
67 | Caption = 'M'
68 | end
69 | item
70 | Caption = 'N'
71 | end
72 | item
73 | Caption = 'O'
74 | end
75 | item
76 | Caption = 'P'
77 | end
78 | item
79 | Caption = 'Q'
80 | end
81 | item
82 | Caption = 'R'
83 | end
84 | item
85 | Caption = 'S'
86 | end
87 | item
88 | Caption = 'T'
89 | end
90 | item
91 | Caption = 'U'
92 | end
93 | item
94 | Caption = 'V'
95 | end
96 | item
97 | Caption = 'W'
98 | end
99 | item
100 | Caption = 'X'
101 | end
102 | item
103 | Caption = 'Y'
104 | end
105 | item
106 | Caption = 'Z'
107 | end>
108 | ColumnsFullDrag = True
109 | DefaultEditMenu = True
110 | DefaultHeaderMenu = True
111 | DoubleBuffered = True
112 | Fixed.Count = 1
113 | Fixed.Flat = False
114 | Header.Flat = False
115 | HighlightFocusCol = True
116 | HighlightFocusRow = True
117 | ParentShowHint = False
118 | Rows.Count = 10
119 | ShowCellTips = True
120 | ShowHint = True
121 | TabOrder = 0
122 | OnGetCellText = GridView1GetCellText
123 | OnSetEditText = GridView1SetEditText
124 | end
125 | end
126 |
--------------------------------------------------------------------------------
/Demo/Basic/Unit1.pas:
--------------------------------------------------------------------------------
1 | unit Unit1;
2 |
3 | interface
4 |
5 | uses
6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Ex_Grid;
8 |
9 | type
10 | TForm1 = class(TForm)
11 | GridView1: TGridView;
12 | procedure GridView1GetCellText(Sender: TObject; Cell: TGridCell;
13 | var Value: string);
14 | procedure FormCreate(Sender: TObject);
15 | procedure GridView1SetEditText(Sender: TObject; Cell: TGridCell;
16 | var Value: string);
17 | private
18 | FStrings: array of string;
19 | public
20 | { Public declarations }
21 | end;
22 |
23 | var
24 | Form1: TForm1;
25 |
26 | implementation
27 |
28 | {$R *.dfm}
29 |
30 | procedure TForm1.FormCreate(Sender: TObject);
31 | begin
32 | SetLength(FStrings, GridView1.Rows.Count * GridView1.Columns.Count);
33 | end;
34 |
35 | procedure TForm1.GridView1GetCellText(Sender: TObject; Cell: TGridCell;
36 | var Value: string);
37 | begin
38 | if Cell.Col = 0 then
39 | Value := IntToStr(Cell.Row)
40 | else
41 | Value := FStrings[Cell.Row * GridView1.Columns.Count + Cell.Col];
42 | end;
43 |
44 | procedure TForm1.GridView1SetEditText(Sender: TObject; Cell: TGridCell;
45 | var Value: string);
46 | begin
47 | FStrings[Cell.Row * GridView1.Columns.Count + Cell.Col] := Value;
48 | end;
49 |
50 | end.
51 |
--------------------------------------------------------------------------------
/Demo/CheckBox/CheckBoxDemo.dpr:
--------------------------------------------------------------------------------
1 | program CheckBoxDemo;
2 |
3 | uses
4 | Vcl.Forms,
5 | Unit1 in 'Unit1.pas' {Form1};
6 |
7 | {$R *.res}
8 |
9 | begin
10 | Application.Initialize;
11 | Application.MainFormOnTaskbar := True;
12 | Application.CreateForm(TForm1, Form1);
13 | Application.Run;
14 | end.
15 |
--------------------------------------------------------------------------------
/Demo/CheckBox/CheckBoxDemo.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {1D82C487-DEBF-4BF3-BA76-D612253DE909}
4 | 18.6
5 | VCL
6 | CheckBoxDemo.dpr
7 | True
8 | Debug
9 | Win32
10 | 1
11 | Application
12 |
13 |
14 | true
15 |
16 |
17 | true
18 | Base
19 | true
20 |
21 |
22 | true
23 | Base
24 | true
25 |
26 |
27 | true
28 | Base
29 | true
30 |
31 |
32 | true
33 | Cfg_1
34 | true
35 | true
36 |
37 |
38 | true
39 | Base
40 | true
41 |
42 |
43 | true
44 | Cfg_2
45 | true
46 | true
47 |
48 |
49 | .\$(Platform)\$(Config)
50 | .\$(Platform)\$(Config)
51 | false
52 | false
53 | false
54 | false
55 | false
56 | System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)
57 | $(BDS)\bin\delphi_PROJECTICON.ico
58 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png
59 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png
60 | CheckBoxDemo
61 | ..\..\Source;$(DCC_UnitSearchPath)
62 | 1049
63 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=
64 |
65 |
66 | DBXSqliteDriver;IndyIPCommon;RESTComponents;bindcompdbx;DBXInterBaseDriver;vcl;IndyIPServer;vclactnband;vclFireDAC;IndySystem;tethering;svnui;dsnapcon;FireDACADSDriver;FireDACMSAccDriver;fmxFireDAC;vclimg;FireDAC;vcltouch;vcldb;bindcompfmx;svn;FireDACSqliteDriver;FireDACPgDriver;inetdb;soaprtl;DbxCommonDriver;fmx;FireDACIBDriver;fmxdae;xmlrtl;soapmidas;fmxobj;vclwinx;rtl;DbxClientDriver;CustomIPTransport;vcldsnap;dbexpress;IndyCore;vclx;bindcomp;appanalytics;dsnap;FireDACCommon;IndyIPClient;bindcompvcl;RESTBackendComponents;VCLRESTComponents;soapserver;dbxcds;VclSmp;adortl;GridViewDR;vclie;bindengine;DBXMySQLDriver;CloudService;dsnapxml;FireDACMySQLDriver;dbrtl;IndyProtocols;inetdbxpress;FireDACCommonODBC;FireDACCommonDriver;inet;fmxase;$(DCC_UsePackage)
67 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
68 | Debug
69 | true
70 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=
71 | 1033
72 | $(BDS)\bin\default_app.manifest
73 |
74 |
75 | DBXSqliteDriver;IndyIPCommon;RESTComponents;bindcompdbx;DBXInterBaseDriver;vcl;IndyIPServer;vclactnband;vclFireDAC;IndySystem;tethering;dsnapcon;FireDACADSDriver;FireDACMSAccDriver;fmxFireDAC;vclimg;FireDAC;vcltouch;vcldb;bindcompfmx;FireDACSqliteDriver;FireDACPgDriver;inetdb;soaprtl;DbxCommonDriver;fmx;FireDACIBDriver;fmxdae;xmlrtl;soapmidas;fmxobj;vclwinx;rtl;DbxClientDriver;CustomIPTransport;vcldsnap;dbexpress;IndyCore;vclx;bindcomp;appanalytics;dsnap;FireDACCommon;IndyIPClient;bindcompvcl;RESTBackendComponents;VCLRESTComponents;soapserver;dbxcds;VclSmp;adortl;vclie;bindengine;DBXMySQLDriver;CloudService;dsnapxml;FireDACMySQLDriver;dbrtl;IndyProtocols;inetdbxpress;FireDACCommonODBC;FireDACCommonDriver;inet;fmxase;$(DCC_UsePackage)
76 |
77 |
78 | DEBUG;$(DCC_Define)
79 | true
80 | false
81 | true
82 | true
83 | true
84 |
85 |
86 | false
87 | true
88 | PerMonitorV2
89 | true
90 | 1033
91 |
92 |
93 | false
94 | RELEASE;$(DCC_Define)
95 | 0
96 | 0
97 |
98 |
99 | true
100 | PerMonitorV2
101 |
102 |
103 |
104 | MainSource
105 |
106 |
107 |
108 | dfm
109 |
110 |
111 | Cfg_2
112 | Base
113 |
114 |
115 | Base
116 |
117 |
118 | Cfg_1
119 | Base
120 |
121 |
122 |
123 | Delphi.Personality.12
124 | Application
125 |
126 |
127 |
128 | CheckBoxDemo.dpr
129 |
130 |
131 | Microsoft Office 2000 Sample Automation Server Wrapper Components
132 | Microsoft Office XP Sample Automation Server Wrapper Components
133 |
134 |
135 |
136 |
137 |
138 | CheckBoxDemo.exe
139 | true
140 |
141 |
142 |
143 |
144 | 1
145 |
146 |
147 | Contents\MacOS
148 | 1
149 |
150 |
151 | 0
152 |
153 |
154 |
155 |
156 | classes
157 | 1
158 |
159 |
160 |
161 |
162 | res\xml
163 | 1
164 |
165 |
166 |
167 |
168 | library\lib\armeabi-v7a
169 | 1
170 |
171 |
172 |
173 |
174 | library\lib\armeabi
175 | 1
176 |
177 |
178 |
179 |
180 | library\lib\mips
181 | 1
182 |
183 |
184 |
185 |
186 | library\lib\armeabi-v7a
187 | 1
188 |
189 |
190 |
191 |
192 | res\drawable
193 | 1
194 |
195 |
196 |
197 |
198 | res\values
199 | 1
200 |
201 |
202 |
203 |
204 | res\values-v21
205 | 1
206 |
207 |
208 |
209 |
210 | res\drawable
211 | 1
212 |
213 |
214 |
215 |
216 | res\drawable-xxhdpi
217 | 1
218 |
219 |
220 |
221 |
222 | res\drawable-ldpi
223 | 1
224 |
225 |
226 |
227 |
228 | res\drawable-mdpi
229 | 1
230 |
231 |
232 |
233 |
234 | res\drawable-hdpi
235 | 1
236 |
237 |
238 |
239 |
240 | res\drawable-xhdpi
241 | 1
242 |
243 |
244 |
245 |
246 | res\drawable-small
247 | 1
248 |
249 |
250 |
251 |
252 | res\drawable-normal
253 | 1
254 |
255 |
256 |
257 |
258 | res\drawable-large
259 | 1
260 |
261 |
262 |
263 |
264 | res\drawable-xlarge
265 | 1
266 |
267 |
268 |
269 |
270 | 1
271 |
272 |
273 | Contents\MacOS
274 | 1
275 |
276 |
277 | 0
278 |
279 |
280 |
281 |
282 | Contents\MacOS
283 | 1
284 | .framework
285 |
286 |
287 | Contents\MacOS
288 | 1
289 | .framework
290 |
291 |
292 | 0
293 |
294 |
295 |
296 |
297 | 1
298 | .dylib
299 |
300 |
301 | 1
302 | .dylib
303 |
304 |
305 | 1
306 | .dylib
307 |
308 |
309 | Contents\MacOS
310 | 1
311 | .dylib
312 |
313 |
314 | Contents\MacOS
315 | 1
316 | .dylib
317 |
318 |
319 | 0
320 | .dll;.bpl
321 |
322 |
323 |
324 |
325 | 1
326 | .dylib
327 |
328 |
329 | 1
330 | .dylib
331 |
332 |
333 | 1
334 | .dylib
335 |
336 |
337 | Contents\MacOS
338 | 1
339 | .dylib
340 |
341 |
342 | Contents\MacOS
343 | 1
344 | .dylib
345 |
346 |
347 | 0
348 | .bpl
349 |
350 |
351 |
352 |
353 | 0
354 |
355 |
356 | 0
357 |
358 |
359 | 0
360 |
361 |
362 | 0
363 |
364 |
365 | Contents\Resources\StartUp\
366 | 0
367 |
368 |
369 | Contents\Resources\StartUp\
370 | 0
371 |
372 |
373 | 0
374 |
375 |
376 |
377 |
378 | 1
379 |
380 |
381 | 1
382 |
383 |
384 | 1
385 |
386 |
387 |
388 |
389 | 1
390 |
391 |
392 | 1
393 |
394 |
395 | 1
396 |
397 |
398 |
399 |
400 | 1
401 |
402 |
403 | 1
404 |
405 |
406 | 1
407 |
408 |
409 |
410 |
411 | 1
412 |
413 |
414 | 1
415 |
416 |
417 | 1
418 |
419 |
420 |
421 |
422 | 1
423 |
424 |
425 | 1
426 |
427 |
428 | 1
429 |
430 |
431 |
432 |
433 | 1
434 |
435 |
436 | 1
437 |
438 |
439 | 1
440 |
441 |
442 |
443 |
444 | 1
445 |
446 |
447 | 1
448 |
449 |
450 | 1
451 |
452 |
453 |
454 |
455 | 1
456 |
457 |
458 |
459 |
460 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
461 | 1
462 |
463 |
464 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
465 | 1
466 |
467 |
468 |
469 |
470 | 1
471 |
472 |
473 | 1
474 |
475 |
476 |
477 |
478 | ..\
479 | 1
480 |
481 |
482 | ..\
483 | 1
484 |
485 |
486 |
487 |
488 | 1
489 |
490 |
491 | 1
492 |
493 |
494 | 1
495 |
496 |
497 |
498 |
499 | 1
500 |
501 |
502 | 1
503 |
504 |
505 | 1
506 |
507 |
508 |
509 |
510 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
511 | 1
512 |
513 |
514 |
515 |
516 | ..\
517 | 1
518 |
519 |
520 | ..\
521 | 1
522 |
523 |
524 |
525 |
526 | Contents
527 | 1
528 |
529 |
530 | Contents
531 | 1
532 |
533 |
534 |
535 |
536 | Contents\Resources
537 | 1
538 |
539 |
540 | Contents\Resources
541 | 1
542 |
543 |
544 |
545 |
546 | library\lib\armeabi-v7a
547 | 1
548 |
549 |
550 | 1
551 |
552 |
553 | 1
554 |
555 |
556 | 1
557 |
558 |
559 | 1
560 |
561 |
562 | Contents\MacOS
563 | 1
564 |
565 |
566 | Contents\MacOS
567 | 1
568 |
569 |
570 | 0
571 |
572 |
573 |
574 |
575 | 1
576 |
577 |
578 | 1
579 |
580 |
581 |
582 |
583 | Assets
584 | 1
585 |
586 |
587 | Assets
588 | 1
589 |
590 |
591 |
592 |
593 | Assets
594 | 1
595 |
596 |
597 | Assets
598 | 1
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 | True
613 | False
614 |
615 |
616 | 12
617 |
618 |
619 |
620 |
621 |
622 |
--------------------------------------------------------------------------------
/Demo/CheckBox/CheckBoxDemo.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/checker2/GridView/191ab645e7bda4e678da383b06f52cb1edbb637c/Demo/CheckBox/CheckBoxDemo.res
--------------------------------------------------------------------------------
/Demo/CheckBox/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object Form1: TForm1
2 | Left = 0
3 | Top = 0
4 | Caption = 'TGridView CheckBox Demo'
5 | ClientHeight = 300
6 | ClientWidth = 635
7 | Color = clBtnFace
8 | Font.Charset = DEFAULT_CHARSET
9 | Font.Color = clWindowText
10 | Font.Height = -11
11 | Font.Name = 'Tahoma'
12 | Font.Style = []
13 | OldCreateOrder = False
14 | OnCreate = FormCreate
15 | PixelsPerInch = 96
16 | TextHeight = 13
17 | object GridView1: TGridView
18 | Left = 0
19 | Top = 0
20 | Width = 635
21 | Height = 300
22 | Align = alClient
23 | CheckBoxes = True
24 | Columns = <
25 | item
26 | Caption = 'Share Name'
27 | DefWidth = 100
28 | end
29 | item
30 | Caption = 'Folder Path'
31 | DefWidth = 150
32 | end
33 | item
34 | Caption = 'Description'
35 | DefWidth = 250
36 | end
37 | item
38 | Caption = 'Enabled'
39 | CheckAlignment = taCenter
40 | CheckKind = gcCheckBox
41 | ReadOnly = True
42 | DefWidth = 100
43 | end>
44 | ColumnsFullDrag = True
45 | ImageIndexDef = 1
46 | Images = ImageList1
47 | ReadOnly = True
48 | Rows.Count = 7
49 | ShowCellTips = False
50 | TabOrder = 0
51 | OnCheckClick = GridView1CheckClick
52 | OnGetCellImageEx = GridView1GetCellImageEx
53 | OnGetCellText = GridView1GetCellText
54 | OnGetCheckState = GridView1GetCheckState
55 | end
56 | object ImageList1: TImageList
57 | Left = 40
58 | Top = 200
59 | Bitmap = {
60 | 494C010103000800040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
61 | 0000000000003600000028000000400000001000000001002000000000000010
62 | 0000000000000000000000000000000000000000000000000000000000000000
63 | 000000000000000000000000000000000000000000006A65E3002720D7002720
64 | D7002720D7006A65E30000000000000000000000000000000000000000000000
65 | 0000000000000000000000000000000000000000000000000000000000000000
66 | 0000000000000000000000000000000000000000000000000000000000000000
67 | 0000000000000000000000000000000000000000000000000000000000000000
68 | 0000000000000000000000000000000000000000000000000000000000000000
69 | 0000000000000000000000000000000000000000000000000000000000000000
70 | 0000000000000000000000000000000000000000000000000000000000000000
71 | 000000000000000000000000000000000000342ED900342ED9002720D7002720
72 | D7002720D700342ED900342DD9000000000000000000E6E1DC00C2BFBA00C1BD
73 | B800BFBBB700BDBAB500BCB8B400BBB7B300BAB6B100B9B5B000B8B4B000B7B4
74 | AF00B7B3AF00B6B2AE00D9D4D0000000000000000000E6E1DC00C2BFBA00C1BD
75 | B800BFBBB700BDBAB500BCB8B400BBB7B300BAB6B100B9B5B000B8B4B000B7B4
76 | AF00B7B3AF00B6B2AE00D9D4D000000000000000000000000000000000000000
77 | 0000000000000000000000000000000000000000000000000000000000000000
78 | 0000000000000000000000000000000000000000000000000000000000000000
79 | 00000000000000000000000000006A65E300342ED900F1F0FC007873E6002720
80 | D7007873E600F1F0FC00342ED9006A65E30000000000C4C0BB005A5A5A005353
81 | 53004D4D4D0047474700414141003C3C3C003838380034343400313131002962
82 | 29002C2C2C002B2B2B00A39F9B000000000000000000C4C0BB005A5A5A005353
83 | 53004D4D4D0047474700414141003C3C3C003838380034343400313131002962
84 | 29002C2C2C002B2B2B00A39F9B00000000000000000000000000000000000000
85 | 0000000000000000000000000000000000000000000000000000000000000000
86 | 0000000000000000000000000000000000000000000000000000000000000000
87 | 00000000000000000000000000002720D7002720D7007873E600FEFEFE00ADAB
88 | EF00FEFEFE007873E6002720D7002720D70000000000C4C0BB005A5A5A005353
89 | 53004D4D4D0047474700414141003C3C3C003838380034343400336433005BFE
90 | 5B00216121002B2B2B00A39F9B000000000000000000C4C0BB005A5A5A005353
91 | 53004D4D4D0047474700414141003C3C3C003838380034343400336433005BFE
92 | 5B00216121002B2B2B00A39F9B00000000000000000000000000000000000000
93 | 0000000000000000000000000000000000000000000000000000000000000000
94 | 0000000000000000000000000000000000000000000000000000000000000000
95 | 00000000000000000000000000002720D7002720D7002720D700ADABEF00FEFE
96 | FE00ADABEF002720D7002720D7002720D70000000000C4C0BB005A5A5A005353
97 | 53004D4D4D0047474700414141003C3C3C003838380034343400313131002662
98 | 26002C2C2C002B2B2B00A39F9B000000000000000000C4C0BB005A5A5A005353
99 | 53004D4D4D0047474700414141003C3C3C003838380034343400313131002662
100 | 26002C2C2C002B2B2B00A39F9B00000000000000000000000000000000000000
101 | 0000000000000000000000000000000000000000000000000000000000000000
102 | 0000000000000000000000000000000000000000000000000000000000000000
103 | 00000000000000000000000000002720D7002720D7007873E600FEFEFE00ADAB
104 | EF00FEFEFE007873E6002720D7002720D70000000000DAD5D100AFABA800ADA9
105 | A600ABA8A400AAA6A200A8A5A100A7A4A000A6A29F00A5A19E00A4A19D00A4A0
106 | 9C00A3A09C00A39F9C00CEC9C4000000000000000000DAD5D100AFABA800ADA9
107 | A600ABA8A400AAA6A200A8A5A100A7A4A000A6A29F00A5A19E00A4A19D00A4A0
108 | 9C00A3A09C00A39F9C00CEC9C400000000000000000000000000000000000000
109 | 0000000000000000000000000000000000000000000000000000000000000000
110 | 0000000000000000000000000000000000000000000000000000000000000000
111 | 00000000000000000000000000006A65E300342ED900F1F0FC007873E6002720
112 | D7007873E600F1F0FC00342ED9006A65E3000000000000000000E3E0DE00E1DE
113 | DC00E0DCDA00DEDBD800DCD9D600DBD7D400D9D5D300D7D3D100D6D1CF00D4D0
114 | CD00D2CECB00D1CCC90000000000000000000000000000000000E3E0DE00E1DE
115 | DC00E0DCDA00DEDBD800DCD9D600DBD7D400D9D5D300D7D3D100D6D1CF00D4D0
116 | CD00D2CECB00D1CCC90000000000000000000000000000000000000000000000
117 | 0000000000000000000000000000000000000000000000000000000000000000
118 | 0000000000000000000000000000000000000000000000000000000000000000
119 | 000000000000000000000000000000000000342DD900342ED9002720D7002720
120 | D7002720D700342ED900342DD900000000000000000000000000E9E7E500E1DE
121 | DC00E0DCDA00DEDBD800DCD9D600DBD7D400D9D5D300D7D3D100D6D1CF00D4D0
122 | CD00D2CECB00DCD8D60000000000000000000000000000000000E9E7E500E5D5
123 | A500E8CC6D00E8CB6C00DCD9D600DBD7D400D9D5D300D7D3D100D6D1CF00D4D0
124 | CD00D2CECB00DCD8D60000000000000000000000000000000000000000000000
125 | 0000000000000000000000000000000000000000000000000000000000000000
126 | 0000000000000000000000000000000000000000000000000000000000000000
127 | 000000000000000000000000000000000000000000006A65E3002720D7002720
128 | D7002720D7006A65E3000000000000000000000000000000000000000000E2E0
129 | DE00E0DCDA00DEDBD800DCD9D600DBD7D400D9D5D300D7D3D100D6D1CF00D4D0
130 | CD00D2CECB00000000000000000000000000F2C31F00F1BB000000000000F1BB
131 | 0000F1BB0000F1BB0000DCD9D600DBD7D400D9D5D300D7D3D100D6D1CF00D4D0
132 | CD00D2CECB000000000000000000000000000000000000000000000000000000
133 | 0000000000000000000000000000000000000000000000000000000000000000
134 | 0000000000000000000000000000000000000000000000000000000000000000
135 | 0000000000000000000000000000000000000000000000000000000000000000
136 | 0000000000000000000000000000000000000000000000000000000000000000
137 | 0000000000000000000000000000000000000000000000000000000000000000
138 | 000000000000000000000000000000000000F1BB0000F1BB000000000000F1BB
139 | 0000F1BB0000F1BB000000000000000000000000000000000000000000000000
140 | 0000000000000000000000000000000000000000000000000000000000000000
141 | 0000000000000000000000000000000000000000000000000000000000000000
142 | 0000000000000000000000000000000000000000000000000000000000000000
143 | 0000000000000000000000000000000000000000000000000000000000000000
144 | 0000000000000000000000000000000000000000000000000000000000000000
145 | 0000000000000000000000000000000000000000000000000000000000000000
146 | 0000000000000000000000000000000000000000000000000000000000000000
147 | 0000000000000000000000000000000000000000000000000000000000000000
148 | 0000000000000000000000000000000000000000000000000000000000000000
149 | 0000000000000000000000000000000000000000000000000000000000000000
150 | 0000000000000000000000000000000000000000000000000000000000000000
151 | 0000000000000000000000000000000000000000000000000000000000000000
152 | 0000000000000000000000000000000000000000000000000000000000000000
153 | 0000000000000000000000000000000000000000000000000000000000000000
154 | 000000000000000000000000000000000000F1BB0000F1BB000000000000F1BB
155 | 0000F1BB0000F1BB000000000000000000000000000000000000000000000000
156 | 0000000000000000000000000000000000000000000000000000000000000000
157 | 0000000000000000000000000000000000000000000000000000000000000000
158 | 0000000000000000000000000000000000000000000000000000000000000000
159 | 0000000000000000000000000000000000000000000000000000000000000000
160 | 0000000000000000000000000000000000000000000000000000000000000000
161 | 0000000000000000000000000000000000000000000000000000000000000000
162 | 000000000000000000000000000000000000F2C31F00F1BB000000000000F1BB
163 | 0000F1BB0000F1BB000000000000000000000000000000000000000000000000
164 | 0000000000000000000000000000000000000000000000000000000000000000
165 | 0000000000000000000000000000000000000000000000000000000000000000
166 | 0000000000000000000000000000000000000000000000000000000000000000
167 | 0000000000000000000000000000000000000000000000000000000000000000
168 | 0000000000000000000000000000000000000000000000000000000000000000
169 | 0000000000000000000000000000000000000000000000000000000000000000
170 | 0000000000000000000000000000000000000000000000000000000000000000
171 | 0000F7DC7E00F7DC7E0000000000000000000000000000000000000000000000
172 | 0000000000000000000000000000000000000000000000000000000000000000
173 | 0000000000000000000000000000000000000000000000000000000000000000
174 | 0000000000000000000000000000000000000000000000000000000000000000
175 | 0000000000000000000000000000000000000000000000000000000000000000
176 | 0000000000000000000000000000000000000000000000000000000000000000
177 | 0000000000000000000000000000000000000000000000000000000000000000
178 | 0000000000000000000000000000000000000000000000000000000000000000
179 | 0000000000000000000000000000000000000000000000000000000000000000
180 | 0000000000000000000000000000000000000000000000000000000000000000
181 | 0000000000000000000000000000000000000000000000000000000000000000
182 | 0000000000000000000000000000000000000000000000000000000000000000
183 | 0000000000000000000000000000000000000000000000000000000000000000
184 | 0000000000000000000000000000000000000000000000000000000000000000
185 | 0000000000000000000000000000000000000000000000000000000000000000
186 | 0000000000000000000000000000000000000000000000000000000000000000
187 | 0000000000000000000000000000000000000000000000000000000000000000
188 | 0000000000000000000000000000000000000000000000000000000000000000
189 | 0000000000000000000000000000000000000000000000000000000000000000
190 | 000000000000000000000000000000000000424D3E000000000000003E000000
191 | 2800000040000000100000000100010000000000800000000000000000000000
192 | 000000000000000000000000FFFFFF00FF83FFFFFFFF0000FF01800180010000
193 | FE00800180010000FE00800180010000FE00800180010000FE00800180010000
194 | FE00C003C0030000FF01C003C0030000FF83E00720070000FFFFFFFF23FF0000
195 | FFFFFFFFFFFF0000FFFFFFFF23FF0000FFFFFFFF23FF0000FFFFFFFFF3FF0000
196 | FFFFFFFFFFFF0000FFFFFFFFFFFF000000000000000000000000000000000000
197 | 000000000000}
198 | end
199 | end
200 |
--------------------------------------------------------------------------------
/Demo/CheckBox/Unit1.pas:
--------------------------------------------------------------------------------
1 | unit Unit1;
2 |
3 | interface
4 |
5 | uses
6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Ex_Grid, System.ImageList, Vcl.ImgList,
8 | Vcl.StdCtrls;
9 |
10 | type
11 | TForm1 = class(TForm)
12 | GridView1: TGridView;
13 | ImageList1: TImageList;
14 | procedure FormCreate(Sender: TObject);
15 | procedure GridView1GetCellText(Sender: TObject; Cell: TGridCell;
16 | var Value: string);
17 | procedure GridView1GetCellImageEx(Sender: TObject; Cell: TGridCell;
18 | var ImageIndex, OverlayIndex: Integer);
19 | procedure GridView1GetCheckState(Sender: TObject; Cell: TGridCell;
20 | var CheckState: TCheckBoxState);
21 | procedure GridView1CheckClick(Sender: TObject; Cell: TGridCell);
22 | private
23 | FShareState: Integer;
24 | public
25 | { Public declarations }
26 | end;
27 |
28 | var
29 | Form1: TForm1;
30 |
31 | implementation
32 |
33 | {$R *.dfm}
34 |
35 | { TForm1 }
36 |
37 | procedure TForm1.FormCreate(Sender: TObject);
38 | begin
39 | FShareState := 3;
40 | { assign an overlay index to the first image }
41 | ImageList1.Overlay(0, TOverlay(0));
42 | end;
43 |
44 | procedure TForm1.GridView1CheckClick(Sender: TObject; Cell: TGridCell);
45 | begin
46 | if Cell.Col = 3 then
47 | begin
48 | FShareState := FShareState xor (1 shl Cell.Row);
49 | GridView1.InvalidateCell(GridCell(0, Cell.Row));
50 | end;
51 | end;
52 |
53 | procedure TForm1.GridView1GetCellImageEx(Sender: TObject; Cell: TGridCell;
54 | var ImageIndex, OverlayIndex: Integer);
55 | begin
56 | if Cell.Col = 0 then
57 | begin
58 | if Cell.Row = 0 then ImageIndex := 2;
59 | if FShareState and (1 shl Cell.Row) = 0 then OverlayIndex := 0;
60 | end;
61 | end;
62 |
63 | procedure TForm1.GridView1GetCellText(Sender: TObject; Cell: TGridCell;
64 | var Value: string);
65 | begin
66 | case Cell.Col of
67 | 0: Value := Char(Ord('C') + Cell.Row) + '$';
68 | 1: Value := Char(Ord('C') + Cell.Row) + ':\';
69 | 2: Value := 'Default share';
70 | end;
71 | end;
72 |
73 | procedure TForm1.GridView1GetCheckState(Sender: TObject; Cell: TGridCell;
74 | var CheckState: TCheckBoxState);
75 | begin
76 | if Cell.Col = 3 then
77 | begin
78 | if FShareState and (1 shl Cell.Row) <> 0 then CheckState := cbChecked;
79 | end;
80 | end;
81 |
82 | end.
83 |
--------------------------------------------------------------------------------
/Demo/ColumnClick/ColumnClickDemo.dpr:
--------------------------------------------------------------------------------
1 | program ColumnClickDemo;
2 |
3 | uses
4 | Vcl.Forms,
5 | Unit1 in 'Unit1.pas' {Form1};
6 |
7 | {$R *.res}
8 |
9 | begin
10 | Application.Initialize;
11 | Application.MainFormOnTaskbar := True;
12 | Application.CreateForm(TForm1, Form1);
13 | Application.Run;
14 | end.
15 |
--------------------------------------------------------------------------------
/Demo/ColumnClick/ColumnClickDemo.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/checker2/GridView/191ab645e7bda4e678da383b06f52cb1edbb637c/Demo/ColumnClick/ColumnClickDemo.res
--------------------------------------------------------------------------------
/Demo/ColumnClick/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object Form1: TForm1
2 | Left = 0
3 | Top = 0
4 | Caption = 'TGridView ColumnClick Demo'
5 | ClientHeight = 300
6 | ClientWidth = 635
7 | Color = clBtnFace
8 | Font.Charset = DEFAULT_CHARSET
9 | Font.Color = clWindowText
10 | Font.Height = -11
11 | Font.Name = 'Tahoma'
12 | Font.Style = []
13 | OldCreateOrder = False
14 | OnCreate = FormCreate
15 | OnDestroy = FormDestroy
16 | PixelsPerInch = 96
17 | TextHeight = 13
18 | object GridView1: TGridView
19 | Left = 0
20 | Top = 0
21 | Width = 635
22 | Height = 300
23 | Align = alClient
24 | Columns = <
25 | item
26 | Caption = 'Variable'
27 | DefWidth = 200
28 | end
29 | item
30 | Caption = 'Value'
31 | DefWidth = 400
32 | end>
33 | Header.Flat = False
34 | ReadOnly = True
35 | ShowCellTips = False
36 | TabOrder = 0
37 | OnGetCellText = GridView1GetCellText
38 | OnGetSortDirection = GridView1GetSortDirection
39 | OnHeaderClick = GridView1HeaderClick
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/Demo/ColumnClick/Unit1.pas:
--------------------------------------------------------------------------------
1 | unit Unit1;
2 |
3 | interface
4 |
5 | uses
6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Ex_Grid;
8 |
9 | type
10 | TForm1 = class(TForm)
11 | GridView1: TGridView;
12 | procedure FormCreate(Sender: TObject);
13 | procedure FormDestroy(Sender: TObject);
14 | procedure GridView1GetCellText(Sender: TObject; Cell: TGridCell;
15 | var Value: string);
16 | procedure GridView1GetSortDirection(Sender: TObject;
17 | Section: TGridHeaderSection; var SortDirection: TGridSortDirection);
18 | procedure GridView1HeaderClick(Sender: TObject;
19 | Section: TGridHeaderSection);
20 | private
21 | FEnvironment: TStringList;
22 | FSortColumn: Integer;
23 | FSortDirection: TGridSortDirection;
24 | public
25 | { Public declarations }
26 | end;
27 |
28 | var
29 | Form1: TForm1;
30 |
31 | implementation
32 |
33 | {$R *.dfm}
34 |
35 | procedure GetEnvironmentStrings(Strings: TStrings);
36 | var
37 | Env, EnvVar: PChar;
38 | begin
39 | Env := Winapi.Windows.GetEnvironmentStrings();
40 | if Env <> nil then
41 | try
42 | EnvVar := Env;
43 | while EnvVar^ <> #0 do
44 | begin
45 | Strings.Add(EnvVar);
46 | Inc(EnvVar, StrLen(EnvVar) + 1);
47 | end;
48 | finally
49 | FreeEnvironmentStrings(Env);
50 | end;
51 | end;
52 |
53 | function CompareEnvironment(List: TStringList; Index1, Index2: Integer): Integer;
54 | var
55 | S1, S2: string;
56 | begin
57 | if Form1.FSortColumn = 0 then
58 | begin
59 | S1 := List.Names[Index1];
60 | S2 := List.Names[Index2];
61 | end
62 | else
63 | begin
64 | S1 := List.ValueFromIndex[Index1];
65 | S2 := List.ValueFromIndex[Index2];
66 | end;
67 | Result := CompareText(S1, S2);
68 | if Form1.FSortDirection = gsDescending then Result := Result * -1;
69 | end;
70 |
71 | procedure TForm1.FormCreate(Sender: TObject);
72 | begin
73 | FEnvironment := TStringList.Create;
74 | GetEnvironmentStrings(FEnvironment);
75 | FEnvironment.CustomSort(CompareEnvironment);
76 | GridView1.Rows.Count := FEnvironment.Count;
77 | FSortColumn := 0;
78 | FSortDirection := gsAscending;
79 | end;
80 |
81 | procedure TForm1.FormDestroy(Sender: TObject);
82 | begin
83 | FEnvironment.Free;
84 | end;
85 |
86 | procedure TForm1.GridView1GetCellText(Sender: TObject; Cell: TGridCell;
87 | var Value: string);
88 | begin
89 | case Cell.Col of
90 | 0: Value := FEnvironment.Names[Cell.Row];
91 | 1: Value := FEnvironment.ValueFromIndex[Cell.Row];
92 | end;
93 | end;
94 |
95 | procedure TForm1.GridView1GetSortDirection(Sender: TObject;
96 | Section: TGridHeaderSection; var SortDirection: TGridSortDirection);
97 | begin
98 | if Section.ColumnIndex <> FSortColumn then
99 | SortDirection := gsNone
100 | else
101 | SortDirection := FSortDirection;
102 | end;
103 |
104 | procedure TForm1.GridView1HeaderClick(Sender: TObject;
105 | Section: TGridHeaderSection);
106 | begin
107 | if Section.ColumnIndex <> FSortColumn then FSortColumn := Section.ColumnIndex
108 | else if FSortDirection = gsAscending then FSortDirection := gsDescending
109 | else FSortDirection := gsAscending;
110 | GridView1.InvalidateHeader;
111 | FEnvironment.CustomSort(CompareEnvironment);
112 | GridView1.InvalidateGrid;
113 | end;
114 |
115 | end.
116 |
--------------------------------------------------------------------------------
/Demo/CustomHeaderMenu/CustomHeaderMenuDemo.dpr:
--------------------------------------------------------------------------------
1 | program CustomHeaderMenuDemo;
2 |
3 | uses
4 | Vcl.Forms,
5 | Unit1 in 'Unit1.pas' {Form1},
6 | Unit2 in 'Unit2.pas' {GridColumnsDlg};
7 |
8 | {$R *.res}
9 |
10 | begin
11 | Application.Initialize;
12 | Application.MainFormOnTaskbar := True;
13 | Application.CreateForm(TForm1, Form1);
14 | Application.Run;
15 | end.
16 |
--------------------------------------------------------------------------------
/Demo/CustomHeaderMenu/CustomHeaderMenuDemo.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/checker2/GridView/191ab645e7bda4e678da383b06f52cb1edbb637c/Demo/CustomHeaderMenu/CustomHeaderMenuDemo.res
--------------------------------------------------------------------------------
/Demo/CustomHeaderMenu/HeaderMenuDemo.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/checker2/GridView/191ab645e7bda4e678da383b06f52cb1edbb637c/Demo/CustomHeaderMenu/HeaderMenuDemo.res
--------------------------------------------------------------------------------
/Demo/CustomHeaderMenu/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object Form1: TForm1
2 | Left = 0
3 | Top = 0
4 | Caption = 'TGridView Custom Header Menu Demo'
5 | ClientHeight = 325
6 | ClientWidth = 735
7 | Color = clBtnFace
8 | Font.Charset = DEFAULT_CHARSET
9 | Font.Color = clWindowText
10 | Font.Height = -11
11 | Font.Name = 'Tahoma'
12 | Font.Style = []
13 | OldCreateOrder = False
14 | OnCreate = FormCreate
15 | PixelsPerInch = 96
16 | TextHeight = 13
17 | object GridView1: TGridView
18 | Left = 0
19 | Top = 0
20 | Width = 735
21 | Height = 325
22 | Align = alClient
23 | Columns = <
24 | item
25 | Caption = 'Name'
26 | DefaultPopup = False
27 | DefWidth = 250
28 | end
29 | item
30 | Caption = 'Date modified'
31 | DefWidth = 140
32 | end
33 | item
34 | Caption = 'Type'
35 | DefWidth = 120
36 | end
37 | item
38 | Caption = 'Size'
39 | DefWidth = 80
40 | end
41 | item
42 | Caption = 'Attributes'
43 | DefWidth = 100
44 | end>
45 | ColumnsFullDrag = True
46 | DefaultHeaderMenu = True
47 | DoubleBuffered = True
48 | GridLines = False
49 | Header.PopupMenu = PopupMenu1
50 | Images = ImageList1
51 | RowSelect = True
52 | ShowCellTips = False
53 | TabOrder = 0
54 | OnGetCellImage = GridView1GetCellImage
55 | OnGetCellText = GridView1GetCellText
56 | OnHeaderDetailsClick = GridView1HeaderDetailsClick
57 | end
58 | object PopupMenu1: TPopupMenu
59 | Left = 48
60 | Top = 56
61 | object SizeColumnToFit1: TMenuItem
62 | Caption = 'Size &Column To Fit'
63 | OnClick = SizeColumnToFit1Click
64 | end
65 | object SizeAllColumnsToFit1: TMenuItem
66 | Caption = 'Size &All Columns To Fit'
67 | OnClick = SizeAllColumnsToFit1Click
68 | end
69 | end
70 | object ImageList1: TImageList
71 | Left = 48
72 | Top = 112
73 | Bitmap = {
74 | 494C010104000800040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
75 | 0000000000003600000028000000400000002000000001002000000000000020
76 | 0000000000000000000000000000000000000000000000000000000000000000
77 | 0000000000000000000000000000000000000000000000000000000000000000
78 | 0000000000000000000000000000000000000000000000000000000000000000
79 | 0000000000000000000000000000000000000000000000000000000000000000
80 | 0000000000000000000000000000000000000000000000000000000000000000
81 | 0000000000000000000000000000000000000000000000000000000000000000
82 | 0000000000000000000000000000000000000000000000000000000000000000
83 | 0000000000000000000000000000000000000000000000000000000000000000
84 | 0000000000000000000000000000000000000000000000000000000000000000
85 | 0000000000000000000000000000000000000000000000000000000000000000
86 | 0000000000000000000000000000000000000000000000000000000000000000
87 | 0000000000000000000000000000000000000000000000000000000000000000
88 | 0000000000000000000000000000000000000000000000000000000000000000
89 | 0000000000000000000000000000000000000000000000000000000000000000
90 | 0000000000000000000000000000000000000000000000000000000000000000
91 | 0000000000000000000000000000000000000000000000000000000000000000
92 | 0000000000000000000000000000000000000000000000000000000000000000
93 | 0000000000000000000000000000000000000000000000000000000000000000
94 | 0000000000000000000000000000000000000000000000000000000000000000
95 | 0000000000000000000000000000000000000000000000000000000000000000
96 | 0000000000000000000000000000000000000000000000000000000000000000
97 | 0000000000000000000000000000000000000000000000000000000000000000
98 | 0000000000000000000000000000000000000000000000000000000000000000
99 | 0000000000000000000000000000000000000000000000000000000000000000
100 | 0000000000000000000000000000000000000000000000000000000000000000
101 | 0000000000000000000000000000000000000000000000000000000000000000
102 | 0000000000000000000000000000000000000000000000000000000000000000
103 | 0000000000000000000000000000000000000000000000000000000000000000
104 | 0000000000000000000000000000000000000000000000000000000000000000
105 | 0000000000000000000000000000000000000000000000000000000000000000
106 | 0000000000000000000000000000000000000000000000000000000000000000
107 | 0000000000000000000000000000000000000000000000000000000000000000
108 | 0000000000000000000000000000000000000000000000000000000000000000
109 | 0000000000000000000000000000000000000000000000000000000000000000
110 | 0000000000000000000000000000000000000000000000000000000000000000
111 | 0000000000000000000000000000000000000000000000000000000000000000
112 | 0000000000000000000000000000000000000000000000000000000000000000
113 | 0000000000000000000000000000000000000000000000000000000000000000
114 | 0000000000000000000000000000000000000000000000000000000000000000
115 | 0000000000000000000000000000000000000000000000000000000000000000
116 | 0000000000000000000000000000000000000000000000000000000000000000
117 | 0000000000000000000000000000000000000000000000000000000000000000
118 | 0000000000000000000000000000000000000000000000000000000000000000
119 | 0000000000000000000000000000000000000000000000000000000000000000
120 | 0000000000000000000000000000000000000000000000000000000000000000
121 | 0000000000000000000000000000000000000000000000000000000000000000
122 | 0000000000000000000000000000000000000000000000000000000000000000
123 | 0000000000000000000000000000000000000000000000000000000000000000
124 | 0000000000000000000000000000000000000000000000000000000000000000
125 | 0000000000000000000000000000000000000000000000000000000000000000
126 | 0000000000000000000000000000000000000000000000000000000000000000
127 | 0000000000000000000000000000000000000000000000000000000000000000
128 | 0000000000000000000000000000000000000000000000000000000000000000
129 | 0000000000000000000000000000000000000000000000000000000000000000
130 | 0000000000000000000000000000000000000000000000000000000000000000
131 | 0000000000000000000000000000000000000000000000000000000000000000
132 | 0000000000000000000000000000000000000000000000000000000000000000
133 | 0000000000000000000000000000000000000000000000000000000000000000
134 | 0000000000000000000000000000000000000000000000000000000000000000
135 | 0000000000000000000000000000000000000000000000000000000000000000
136 | 0000000000000000000000000000000000000000000000000000000000000000
137 | 0000000000000000000000000000000000000000000000000000000000000000
138 | 0000000000000000000000000000000000000000000000000000000000000000
139 | 0000000000000000000000000000000000000000000000000000000000000000
140 | 0000000000000000000000000000000000000000000000000000000000000000
141 | 0000000000000000000000000000000000000000000000000000000000000000
142 | 0000000000000000000000000000000000000000000000000000000000000000
143 | 0000000000000000000000000000000000000000000000000000000000000000
144 | 0000000000000000000000000000000000000000000000000000000000000000
145 | 0000000000000000000000000000000000000000000000000000000000000000
146 | 0000000000000000000000000000000000000000000000000000000000000000
147 | 0000000000000000000000000000000000000000000000000000000000000000
148 | 0000000000000000000000000000000000000000000000000000000000000000
149 | 0000000000000000000000000000000000000000000000000000000000000000
150 | 0000000000000000000000000000000000000000000000000000000000000000
151 | 0000000000000000000000000000000000000000000000000000000000000000
152 | 0000000000000000000000000000000000000000000000000000000000000000
153 | 0000000000000000000000000000000000000000000000000000000000000000
154 | 0000000000000000000000000000000000000000000000000000000000000000
155 | 0000000000000000000000000000000000000000000000000000000000000000
156 | 0000000000000000000000000000000000000000000000000000000000000000
157 | 0000000000000000000000000000000000000000000000000000000000000000
158 | 0000000000000000000000000000000000000000000000000000000000000000
159 | 0000000000000000000000000000000000000000000000000000000000000000
160 | 0000000000000000000000000000000000000000000000000000000000000000
161 | 0000000000000000000000000000000000000000000000000000000000000000
162 | 0000000000000000000000000000000000000000000000000000000000000000
163 | 0000000000000000000000000000000000000000000000000000000000000000
164 | 0000000000000000000000000000000000000000000000000000000000000000
165 | 0000000000000000000000000000000000000000000000000000000000000000
166 | 0000000000000000000000000000000000000000000000000000000000000000
167 | 0000000000000000000000000000000000000000000000000000000000000000
168 | 0000000000000000000000000000000000000000000000000000000000000000
169 | 0000000000000000000000000000000000000000000000000000000000000000
170 | 0000000000000000000000000000000000000000000000000000000000000000
171 | 0000000000000000000000000000000000000000000000000000000000000000
172 | 0000000000000000000000000000000000000000000000000000000000000000
173 | 0000000000000000000000000000000000000000000000000000000000000000
174 | 0000000000000000000000000000000000000000000000000000000000000000
175 | 0000000000000000000000000000000000000000000000000000000000000000
176 | 0000000000000000000000000000000000000000000000000000000000000000
177 | 0000000000000000000000000000000000000000000000000000000000000000
178 | 0000000000000000000000000000000000000000000000000000000000000000
179 | 0000000000000000000000000000000000000000000000000000000000000000
180 | 0000000000000000000000000000000000000000000000000000000000000000
181 | 0000000000000000000000000000000000000000000000000000000000000000
182 | 0000000000000000000000000000000000000000000000000000000000000000
183 | 0000000000000000000000000000000000000000000000000000000000000000
184 | 0000000000000000000000000000000000000000000000000000000000000000
185 | 0000000000000000000000000000000000000000000000000000000000000000
186 | 0000000000000000000000000000000000000000000000000000000000000000
187 | 0000000000000000000000000000000000000000000000000000000000000000
188 | 0000000000000000000000000000000000000000000000000000000000000000
189 | 0000000000000000000000000000000000000000000000000000000000000000
190 | 0000000000000000000000000000000000000000000000000000000000000000
191 | 0000000000000000000000000000000000000000000000000000000000000000
192 | 0000000000000000000000000000000000000000000000000000000000000000
193 | 0000000000000000000000000000000000000000000000000000000000000000
194 | 0000000000000000000000000000000000000000000000000000000000000000
195 | 0000000000000000000000000000000000000000000000000000000000000000
196 | 0000000000000000000000000000000000000000000000000000000000000000
197 | 0000000000000000000000000000000000000000000000000000000000000000
198 | 0000000000000000000000000000000000000000000000000000000000000000
199 | 0000000000000000000000000000000000000000000000000000000000000000
200 | 0000000000000000000000000000000000000000000000000000000000000000
201 | 0000000000000000000000000000000000000000000000000000000000000000
202 | 0000000000000000000000000000000000000000000000000000000000000000
203 | 0000000000000000000000000000000000000000000000000000000000000000
204 | 0000000000000000000000000000000000000000000000000000797979007979
205 | 7900797979007979790079797900797979007979790079797900797979007979
206 | 7900797979007979790079797900000000000000000000000000EDF8FA00BAE3
207 | EC007EC8DA004CB2CC0064B0C400AED1DC00E8F4F80000000000000000000000
208 | 00000000000000000000000000000000000000000000BBBBBB00BBBBBB00BBBB
209 | BB00BBBBBB00BBBBBB00BBBBBB00BBBBBB00BBBBBB00BBBBBB00BBBBBB00BBBB
210 | BB00BBBBBB00BBBBBB0000000000000000000000000000000000F3F8FA00DAEF
211 | F400BDE2EB00A4D7E300B0D6E000D5E6EC00F0F7F90000000000000000000000
212 | 000000000000000000000000000000000000000000000000000086868600F0F0
213 | F200F1F1F300F1F2F300F2F2F400F3F3F400F3F4F500F4F5F600F5F5F700F6F6
214 | F700F7F7F800F7F8F9008686860000000000000000008ED7E7005FC3D9005DC0
215 | D6005EBFD60060BFD60044AFCA004BA6C10056B8D4005EC0D7005DBFD7005CBE
216 | D60072C7DB00B5E1EC00000000000000000000000000C1C1C100F6F6F700F7F7
217 | F800F7F7F800F7F7F800F8F8F800F8F8F900F8F9F900F9F9FA00F9F9FA00FAFA
218 | FA00FAFAFB00C1C1C100000000000000000000000000C5E9F100AEE0EB00ADDE
219 | E900ADDEE900AEDEE900A0D6E300A4D1DF00A9DAE800ADDEEA00ADDEEA00ACDD
220 | E900B6E1EB00D9EFF4000000000000000000000000000000000090909000F1F1
221 | F300F1F2F300F2F2F400F3F3F500F3F4F500F4F5F600F5F5F700F6F6F700F7F7
222 | F800F7F8F900F8F9FA009090900000000000000000006CCEE10080D4E40077CE
223 | E0006FC9DD0067C4DA0044AFCA0043A6C3004EB8D7004EC1DE004EC1DE004EC1
224 | DE0050C1DD0073C7DB00000000000000000000000000C6C6C600F7F7F800F7F7
225 | F800F7F7F800F8F8F900F8F8F900F8F9F900F9F9FA00F9F9FA00FAFAFA00FAFA
226 | FB00FAFBFB00C6C6C600000000000000000000000000B4E5EF00BEE8F000BAE5
227 | EE00B6E3ED00B2E0EB00A0D6E300A0D1E000A5DAEA00A5DFED00A5DFED00A5DF
228 | ED00A6DFED00B7E1EB00000000000000000000000000000000009D9D9D00F2F2
229 | F300F2F2F400F3F3F500F4F4F500F4F5F600F5F5F700F6F6F700F7F7F800F8F8
230 | F900F8F9FA00F9FAFA009D9D9D00000000000000000070D1E40089DBE80080D4
231 | E40077CEE0006FC9DD0044AFCA0045A8C4004EB8D7004EC1DE004EC1DE004EC1
232 | DE00D3A549005DBFD700000000000000000000000000CDCDCD00F7F7F800F7F7
233 | F800F8F8F900F8F8F900F8F9F900F9F9FA00F9F9FA00FAFAFA00FAFAFB00FAFB
234 | FB00FBFBFB00CDCDCD00000000000000000000000000B6E7F000C3ECF200BEE8
235 | F000BAE5EE00B6E3ED00A0D6E300A1D2E000A5DAEA00A5DFED00A5DFED00A5DF
236 | ED00E8D1A300ADDEEA0000000000000000000000000000000000ACACAC00F2F2
237 | F400F3F3F500F4F4F500F4F5F600F5F6F700F6F6F800F7F7F800F8F8F900F8F9
238 | FA00F9FAFA00FAFBFB00ACACAC00000000000000000075D4E70092E1EC0089DB
239 | E80080D4E40077CEE00045B0CA0049A9C40052BAD80052C3DF004EC1DE004EC1
240 | DE00DDB95D005EC0D800000000000000000000000000D4D4D400F7F7F800F8F8
241 | F900F8F8F900F8F9F900F9F9FA00F9F9FA00FAFAFA00FAFAFB00FAFBFB00FBFB
242 | FB00FBFCFC00D4D4D400000000000000000000000000B9E8F200C7EFF400C3EC
243 | F200BEE8F000BAE5EE00A1D6E300A3D3E000A7DBEA00A7E0EE00A5DFED00A5DF
244 | ED00EDDBAD00ADDEEA0000000000000000000000000000000000ADADAD00F3F3
245 | F500F4F4F500F4F5F600F5F6F700F6F7F800F7F7F800F8F8F900F9F9FA00F9FA
246 | FB00FAFBFB00FBFBFC00ADADAD00000000000000000079D8E9009BE7F00092E1
247 | EC0089DBE80080D4E40047B2CC004EACC60056BCD9005BC7E10056C5E00052C3
248 | DF00ECECEC0060C1D900000000000000000000000000D5D5D500F8F8F900F8F8
249 | F900F8F9F900F9F9FA00F9FAFA00FAFAFA00FAFAFB00FBFBFB00FBFBFC00FBFC
250 | FC00FCFCFC00D5D5D500000000000000000000000000BBEAF300CCF2F600C7EF
251 | F400C3ECF200BEE8F000A2D7E400A5D4E100A9DCEB00ACE2EF00A9E1EE00A7E0
252 | EE00F4F4F400AEDFEB0000000000000000000000000000000000B1B1B100F4F4
253 | F600F5F5F600F5F6F700F6F7F800F7F8F800F8F8F900F9F9FA00F9FAFB00FAFB
254 | FB00FBFCFC00FBFCFC00B1B1B10000000000000000007DDBEC00A3ECF4009BE7
255 | F00092E1EC0089DBE8004AB4CE0054AFC8005CBFDA0066CDE40060CAE3005BC7
256 | E100ECECEC0062C2DA00000000000000000000000000D7D7D700F8F8F900F9F9
257 | F900F9F9FA00F9FAFA00FAFAFA00FAFAFB00FBFBFB00FBFBFC00FBFCFC00FCFC
258 | FC00FCFCFC00D7D7D700000000000000000000000000BDECF400D0F4F800CCF2
259 | F600C7EFF400C3ECF200A3D8E500A8D6E200ACDEEB00B1E5F000AEE3F000ACE2
260 | EF00F4F4F400AFDFEB0000000000000000000000000000000000B3B3B300F5F5
261 | F600F5F6F700F6F7F800F7F8F900F8F9F900F9F9FA00F9FAFB00FAFBFB00FBFC
262 | FC00FBFCFD00FCFDFD00B3B3B300000000000000000081DEEE00AAF1F700A3EC
263 | F4009BE7F00092E1EC004EB7D0005BB2C90063C2DC0073D3E8006DD0E60066CD
264 | E400ECECEC0063C3DB00000000000000000000000000D8D8D800F9F9F900F9F9
265 | FA00F9FAFA00FAFAFB00FAFBFB00FBFBFB00FBFBFC00FBFCFC00FCFCFC00FCFC
266 | FD00FCFDFD00D8D8D800000000000000000000000000BFEDF500D3F7FA00D0F4
267 | F800CCF2F600C7EFF400A5DAE600ACD7E300B0DFEC00B8E8F200B5E6F100B1E5
268 | F000F4F4F400B0E0EC0000000000000000000000000000000000B5B5B500F6F6
269 | F700F6F7F800F7F8F900F8F9F900F9F9FA00FAFAFB00FAFBFB00FBFCFC00FCFC
270 | FD00FCFDFD00FDFEFE00B5B5B500000000000000000084E0F000B0F5F900AAF1
271 | F700A3ECF400C6F1F60052BAD20061B6CB0069C6DE0082DAEC007AD7EA0073D3
272 | E8006DD0E60065C5DC00000000000000000000000000D9D9D900F9F9FA00F9FA
273 | FA00FAFAFB00FAFBFB00FBFBFB00FBFBFC00FBFCFC00FCFCFC00FCFCFD00FCFD
274 | FD00FDFDFD00D9D9D900000000000000000000000000C0EEF600D6F9FB00D3F7
275 | FA00D0F4F800E1F7F900A7DBE700AFD9E400B3E1ED00BFEBF400BBEAF300B8E8
276 | F200B5E6F100B1E1EC0000000000000000000000000000000000B8B8B800F6F7
277 | F800F7F8F900F8F9F900F9F9FA00FAFAFB00FAFBFC00FBFCFC00FCFCFD00FCFD
278 | FD00FDFEFE00FDFEFE00B8B8B800000000000000000088E3F200B4F7FB00B0F5
279 | F900AAF1F700E8FAFC0056BDD40068B9CD0070C9E00090E2F00089DEEE0082DA
280 | EC006FCCE200A6DDEB00000000000000000000000000DADADA00F9FAFA00FAFA
281 | FB00FAFBFB00FBFBFB00FBFBFC00FBFCFC00FCFCFC00FCFCFD00FCFDFD00FDFD
282 | FD00FDFDFD00DADADA00000000000000000000000000C2F0F700D8FAFC00D6F9
283 | FB00D3F7FA00F2FBFC00A9DDE800B2DBE500B6E3EE00C6EFF600C3EDF500BFEB
284 | F400B6E4EF00D1ECF30000000000000000000000000000000000BABABA00F7F8
285 | F900F8F9FA00F9FAFA00FAFAFB00FAFBFC00FBFCFC00FCFDFD00FCFDFD00FCFD
286 | FD00FDFEFE00FDFEFE00B8B8B80000000000000000008AE5F300B4F7FB00B4F7
287 | FB00B0F5F900F4FDFE005AC0D7006EBCCE0076CCE1009EE9F30097E5F20090E2
288 | F0006BC9DF0000000000000000000000000000000000DBDBDB00FAFAFB00FAFB
289 | FB00FBFBFB00FBFBFC00FBFCFC00FCFCFC00FCFDFD00FCFDFD00FCFDFD00FDFD
290 | FD00FDFDFD00DADADA00000000000000000000000000C3F1F800D8FAFC00D8FA
291 | FC00D6F9FB00F8FDFD00ABDEEA00B5DCE500B9E4EF00CDF3F800CAF1F700C6EF
292 | F600B4E3EE000000000000000000000000000000000000000000BCBCBC00F8F9
293 | FA00F9FAFA00FAFAFB00FAFBFC00FBFCFC00FCFDFD00FCFDFD00FDFEFE00FDFE
294 | FE00E5E5E600DFDFE000BABABA0000000000000000008DE6F500B4F7FB00B4F7
295 | FB00B4F7FB00FCFFFF005FC4DA0074BED0007DCFE300ACEFF700A5ECF5009EE9
296 | F3006ECAE10000000000000000000000000000000000DCDCDC00FAFBFB00FBFB
297 | FB00FBFBFC00FBFCFC00FCFCFC00FCFDFD00FCFDFD00FDFDFD00FDFDFD00F1F1
298 | F100EEEEEE00DBDBDB00000000000000000000000000C5F1F900D8FAFC00D8FA
299 | FC00D8FAFC00FCFEFE00AEE0EB00B8DDE600BDE6F000D4F6FA00D1F4F900CDF3
300 | F800B5E3EF000000000000000000000000000000000000000000BDBDBD00F9FA
301 | FA00FAFBFB00FBFBFC00FBFCFC00FCFDFD00FCFDFD00FDFEFE00FDFEFE00BABA
302 | BA00B8B8B800B8B8B800BABABA0000000000000000008DE7F500B4F7FB00B4F7
303 | FB00B4F7FB00FFFFFF0064C8DD0078C0D10081D2E500B7F4FA00B1F2F900ACEF
304 | F70070CCE20000000000000000000000000000000000DDDDDD00FBFBFB00FBFC
305 | FC00FCFCFC00FCFCFC00FCFDFD00FCFDFD00FDFDFD00FDFDFD00DBDBDB00DADA
306 | DA00DADADA00DBDBDB00000000000000000000000000C5F2F900D8FAFC00D8FA
307 | FC00D8FAFC00FEFEFE00B0E2ED00BADEE700BFE7F100DAF8FB00D7F7FB00D4F6
308 | FA00B6E4EF000000000000000000000000000000000000000000BFBFBF00FAFB
309 | FB00FBFBFC00FBFCFC00FCFDFD00FCFDFD00FDFEFE00FDFEFE00FDFEFE00C5C5
310 | C500F6F6F600BBBBBB000000000000000000000000008DE7F500B4F7FB00B4F7
311 | FB00FCFFFF00FCFFFF0069CBE0007FC6D500AEEEF600BFF9FC00BBF7FB00B7F4
312 | FA0072CDE40000000000000000000000000000000000DEDEDE00FBFCFC00FCFC
313 | FC00FCFCFC00FCFDFD00FCFDFD00FDFDFD00FDFDFD00FDFDFD00E1E1E100F9F9
314 | F900DBDBDB00F6F6F600000000000000000000000000C5F2F900D8FAFC00D8FA
315 | FC00FCFEFE00FCFEFE00B3E4EE00BEE1E900D5F5F900DEFBFC00DCFAFC00DAF8
316 | FB00B7E5F0000000000000000000000000000000000000000000C0C0C000FBFB
317 | FC00FBFCFC00FCFDFD00FCFDFD00FDFEFE00FDFEFE00FBFCFC00FDFEFE00CACA
318 | CA00BABABA00000000000000000000000000000000008DE7F500B1F6FB00E9FB
319 | FD0099EAF40087DFED0079CDDC00BCF5FA00C2FAFD00C2FAFD00C2FAFD00B6F4
320 | F90086D5E80000000000000000000000000000000000DEDEDE00FCFCFC00FCFC
321 | FC00FCFDFD00FCFDFD00FDFDFD00FDFDFD00FCFCFC00FDFDFD00E3E3E300DBDB
322 | DB00F7F7F70000000000000000000000000000000000C5F2F900D7F9FC00F3FC
323 | FD00CBF3F800C2EEF500BBE5EC00DCF9FB00DFFBFD00DFFBFD00DFFBFD00D9F8
324 | FB00C1E8F2000000000000000000000000000000000000000000C0C0C000C0C0
325 | C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0
326 | C0000000000000000000000000000000000000000000AFEDF8008EE7F5008DE4
327 | F40089E0F20088DEF10089DDF10086DBEF0083D9EE0080D7EC007DD5EA008BD8
328 | EA00C0E9F30000000000000000000000000000000000DEDEDE00DEDEDE00DEDE
329 | DE00DEDEDE00DEDEDE00DEDEDE00DEDEDE00DEDEDE00DEDEDE00DEDEDE00FAFA
330 | FA000000000000000000000000000000000000000000D5F4FA00C5F1F800C5F0
331 | F800C3EEF700C2EDF700C3EDF700C1ECF600C0EBF500BEEAF400BDE9F300C3EA
332 | F300DEF2F700000000000000000000000000424D3E000000000000003E000000
333 | 2800000040000000200000000100010000000000000100000000000000000000
334 | 000000000000000000000000FFFFFF0000000000000000000000000000000000
335 | 0000000000000000000000000000000000000000000000000000000000000000
336 | 0000000000000000000000000000000000000000000000000000000000000000
337 | 0000000000000000000000000000000000000000000000000000000000000000
338 | 00000000000000000000000000000000C001C07F8003C07FC001800380038003
339 | C001800380038003C001800380038003C001800380038003C001800380038003
340 | C001800380038003C001800380038003C001800380038003C001800380038003
341 | C001800780038007C001800780038007C001800780038007C003800780038007
342 | C007800780078007C00F8007800F800700000000000000000000000000000000
343 | 000000000000}
344 | end
345 | end
346 |
--------------------------------------------------------------------------------
/Demo/CustomHeaderMenu/Unit1.pas:
--------------------------------------------------------------------------------
1 | unit Unit1;
2 |
3 | interface
4 |
5 | uses
6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Ex_Grid, Vcl.Menus, Vcl.ExtCtrls,
8 | System.ImageList, Vcl.ImgList;
9 |
10 | type
11 | TForm1 = class(TForm)
12 | GridView1: TGridView;
13 | PopupMenu1: TPopupMenu;
14 | SizeColumnToFit1: TMenuItem;
15 | SizeAllColumnsToFit1: TMenuItem;
16 | ImageList1: TImageList;
17 | procedure FormCreate(Sender: TObject);
18 | procedure SizeColumnToFit1Click(Sender: TObject);
19 | procedure SizeAllColumnsToFit1Click(Sender: TObject);
20 | procedure GridView1HeaderDetailsClick(Sender: TObject);
21 | procedure GridView1GetCellText(Sender: TObject; Cell: TGridCell;
22 | var Value: string);
23 | procedure GridView1GetCellImage(Sender: TObject; Cell: TGridCell;
24 | var ImageIndex: Integer);
25 | private
26 | FFileList: array of TSearchRec;
27 | FFileCount: Integer;
28 | public
29 | { Public declarations }
30 | end;
31 |
32 | var
33 | Form1: TForm1;
34 |
35 | implementation
36 |
37 | uses
38 | Unit2;
39 |
40 | {$R *.dfm}
41 |
42 | procedure TForm1.FormCreate(Sender: TObject);
43 | var
44 | SearchRec: TSearchRec;
45 | Status: Integer;
46 | begin
47 | SetLength(FFileList, 256);
48 | Status := FindFirst('C:\*', faAnyFile, SearchRec);
49 | while (Status = 0) and (FFileCount < 256) do
50 | begin
51 | if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then
52 | begin
53 | FFileList[FFileCount] := SearchRec;
54 | Inc(FFileCount);
55 | end;
56 | Status := FindNext(SearchRec);
57 | end;
58 | FindClose(SearchRec);
59 | GridView1.Rows.Count := FFileCount;
60 | end;
61 |
62 | procedure TForm1.GridView1GetCellImage(Sender: TObject; Cell: TGridCell;
63 | var ImageIndex: Integer);
64 | begin
65 | if Cell.Col = 0 then
66 | begin
67 | ImageIndex := Ord(FFileList[Cell.Row].Attr and faDirectory <> 0);
68 | if FFileList[Cell.Row].Attr and faHidden <> 0 then Inc(ImageIndex, 2);
69 | end
70 | else
71 | ImageIndex := -1;
72 | end;
73 |
74 | procedure TForm1.GridView1GetCellText(Sender: TObject; Cell: TGridCell;
75 | var Value: string);
76 |
77 | function AttrToStr(Attr: Integer): string;
78 | begin
79 | Result := '';
80 | //if Attr and faHidden <> 0 then Result := Result + 'Hidden ';
81 | if Attr and faReadOnly <> 0 then Result := Result + 'ReadOnly ';
82 | Result := Trim(Result);
83 | end;
84 |
85 | begin
86 | case Cell.Col of
87 | 0: Value := FFileList[Cell.Row].Name;
88 | 1: Value := DateTimeToStr(FFileList[Cell.Row].TimeStamp);
89 | 2: Value := ExtractFileExt(FFileList[Cell.Row].Name);
90 | 3: if FFileList[Cell.Row].Attr and faDirectory = 0 then Value := IntToStr(FFileList[Cell.Row].Size);
91 | 4: Value := AttrToStr(FFileList[Cell.Row].Attr);
92 | end;
93 | end;
94 |
95 | procedure TForm1.GridView1HeaderDetailsClick(Sender: TObject);
96 | begin
97 | ShowGridColumnsDlg(GridView1);
98 | end;
99 |
100 | procedure TForm1.SizeAllColumnsToFit1Click(Sender: TObject);
101 | begin
102 | GridView1.SizeAllColumnsToFit;
103 | end;
104 |
105 | procedure TForm1.SizeColumnToFit1Click(Sender: TObject);
106 | begin
107 | GridView1.SizeColumnToFit(GridView1.ContextPopupCol);
108 | end;
109 |
110 | end.
111 |
--------------------------------------------------------------------------------
/Demo/CustomHeaderMenu/Unit2.dfm:
--------------------------------------------------------------------------------
1 | object GridColumnsDlg: TGridColumnsDlg
2 | Left = 0
3 | Top = 0
4 | BorderStyle = bsDialog
5 | Caption = 'Choose Columns'
6 | ClientHeight = 418
7 | ClientWidth = 339
8 | Color = clBtnFace
9 | Font.Charset = DEFAULT_CHARSET
10 | Font.Color = clWindowText
11 | Font.Height = -11
12 | Font.Name = 'Tahoma'
13 | Font.Style = []
14 | OldCreateOrder = False
15 | Position = poScreenCenter
16 | OnShow = FormShow
17 | PixelsPerInch = 96
18 | TextHeight = 13
19 | object Label1: TLabel
20 | Left = 11
21 | Top = 11
22 | Width = 316
23 | Height = 33
24 | AutoSize = False
25 | Caption = 'Select the columns you want to display.'
26 | Transparent = True
27 | WordWrap = True
28 | end
29 | object Label2: TLabel
30 | Left = 11
31 | Top = 44
32 | Width = 44
33 | Height = 13
34 | Caption = 'Columns:'
35 | end
36 | object Bevel1: TBevel
37 | Left = 11
38 | Top = 372
39 | Width = 316
40 | Height = 4
41 | Shape = bsTopLine
42 | Visible = False
43 | end
44 | object ColumnsGrid: TGridView
45 | Left = 11
46 | Top = 63
47 | Width = 233
48 | Height = 290
49 | CheckBoxes = True
50 | Columns = <
51 | item
52 | CheckKind = gcCheckBox
53 | end>
54 | GridLines = False
55 | ShowCellTips = False
56 | ShowHeader = False
57 | TabOrder = 0
58 | OnCheckClick = ColumnsGridCheckClick
59 | OnGetCellText = ColumnsGridGetCellText
60 | OnGetCheckStateEx = ColumnsGridGetCheckStateEx
61 | OnResize = ColumnsGridResize
62 | end
63 | object ShowButton: TButton
64 | Left = 254
65 | Top = 63
66 | Width = 75
67 | Height = 23
68 | Caption = '&Show'
69 | TabOrder = 1
70 | OnClick = ShowButtonClick
71 | end
72 | object HideButton: TButton
73 | Left = 254
74 | Top = 91
75 | Width = 75
76 | Height = 23
77 | Caption = '&Hide'
78 | TabOrder = 2
79 | OnClick = ShowButtonClick
80 | end
81 | object OKButton: TButton
82 | Left = 174
83 | Top = 384
84 | Width = 75
85 | Height = 23
86 | Caption = 'OK'
87 | TabOrder = 3
88 | OnClick = OKButtonClick
89 | end
90 | object CancelButton: TButton
91 | Left = 254
92 | Top = 384
93 | Width = 75
94 | Height = 23
95 | Cancel = True
96 | Caption = 'Cancel'
97 | ModalResult = 2
98 | TabOrder = 4
99 | end
100 | end
101 |
--------------------------------------------------------------------------------
/Demo/CustomHeaderMenu/Unit2.pas:
--------------------------------------------------------------------------------
1 | unit Unit2;
2 |
3 | interface
4 |
5 | uses
6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Ex_Grid, Vcl.ExtCtrls, Vcl.StdCtrls;
8 |
9 | type
10 | TGridColumnsDlg = class(TForm)
11 | Label1: TLabel;
12 | ColumnsGrid: TGridView;
13 | Label2: TLabel;
14 | ShowButton: TButton;
15 | HideButton: TButton;
16 | Bevel1: TBevel;
17 | OKButton: TButton;
18 | CancelButton: TButton;
19 | procedure FormShow(Sender: TObject);
20 | procedure ColumnsGridCheckClick(Sender: TObject; Cell: TGridCell);
21 | procedure ColumnsGridGetCellText(Sender: TObject; Cell: TGridCell;
22 | var Value: string);
23 | procedure ColumnsGridResize(Sender: TObject);
24 | procedure ColumnsGridGetCheckStateEx(Sender: TObject; Cell: TGridCell;
25 | var CheckState: TCheckBoxState; var CheckEnabled: Boolean);
26 | procedure ShowButtonClick(Sender: TObject);
27 | procedure OKButtonClick(Sender: TObject);
28 | private
29 | FColumns: TGridColumns;
30 | FCheckList: array of Boolean;
31 | protected
32 | procedure UpdateActions; override;
33 | public
34 | { Public declarations }
35 | end;
36 |
37 | function ShowGridColumnsDlg(AGrid: TCustomGridView): Boolean;
38 |
39 | implementation
40 |
41 | {$R *.dfm}
42 |
43 | function ShowGridColumnsDlg(AGrid: TCustomGridView): Boolean;
44 | begin
45 | with TGridColumnsDlg.Create(Application) do
46 | try
47 | FColumns := AGrid.Columns;
48 | Result := (AGrid <> nil) and (ShowModal = mrOK);
49 | finally
50 | Free;
51 | end;
52 | end;
53 |
54 | procedure TGridColumnsDlg.ColumnsGridCheckClick(Sender: TObject;
55 | Cell: TGridCell);
56 | begin
57 | if FColumns[Cell.Row].DefaultPopup then
58 | begin
59 | FCheckList[Cell.Row] := not FCheckList[Cell.Row];
60 | ColumnsGrid.InvalidateCell(Cell);
61 | end;
62 | end;
63 |
64 | procedure TGridColumnsDlg.ColumnsGridGetCellText(Sender: TObject;
65 | Cell: TGridCell; var Value: string);
66 | begin
67 | Value := FColumns[Cell.Row].Caption2;
68 | end;
69 |
70 | procedure TGridColumnsDlg.ColumnsGridGetCheckStateEx(Sender: TObject;
71 | Cell: TGridCell; var CheckState: TCheckBoxState; var CheckEnabled: Boolean);
72 | begin
73 | CheckState := TCheckBoxState(Ord(FCheckList[Cell.Row]));
74 | CheckEnabled := FColumns[Cell.Row].DefaultPopup;
75 | end;
76 |
77 | procedure TGridColumnsDlg.ColumnsGridResize(Sender: TObject);
78 | begin
79 | ColumnsGrid.Columns[0].Width := ColumnsGrid.ClientWidth - 1;
80 | end;
81 |
82 | procedure TGridColumnsDlg.FormShow(Sender: TObject);
83 | var
84 | I: Integer;
85 | begin
86 | SetLength(FCheckList, FColumns.Count);
87 | for I := 0 to FColumns.Count - 1 do FCheckList[I] := FColumns[I].Visible;
88 | ColumnsGrid.Rows.Count := FColumns.Count;
89 | ColumnsGrid.CellFocused := GridCell(0, 0);
90 | ColumnsGrid.CellSelected := True;
91 | SelectFirst;
92 | end;
93 |
94 | procedure TGridColumnsDlg.OKButtonClick(Sender: TObject);
95 | var
96 | I: Integer;
97 | begin
98 | FColumns.BeginUpdate;
99 | try
100 | for I := 0 to FColumns.Count - 1 do
101 | FColumns[I].Visible := FCheckList[I];
102 | finally
103 | FColumns.EndUpdate;
104 | end;
105 | ModalResult := mrOK;
106 | end;
107 |
108 | procedure TGridColumnsDlg.ShowButtonClick(Sender: TObject);
109 | begin
110 | ColumnsGridCheckClick(nil, ColumnsGrid.CellFocused);
111 | end;
112 |
113 | procedure TGridColumnsDlg.UpdateActions;
114 | begin
115 | inherited;
116 | with ColumnsGrid do
117 | begin
118 | ShowButton.Enabled := CellSelected and FColumns[Row].DefaultPopup and (not FCheckList[Row]);
119 | HideButton.Enabled := CellSelected and FColumns[Row].DefaultPopup and FCheckList[Row];
120 | end;
121 | ShowButton.Default := ShowButton.Enabled;
122 | HideButton.Default := HideButton.Enabled;
123 | OKButton.Default := (not ShowButton.Default) and (not HideButton.Default);
124 | end;
125 |
126 | end.
127 |
128 |
--------------------------------------------------------------------------------
/Demo/MyBase/MyBaseDemo.dpr:
--------------------------------------------------------------------------------
1 | program MyBaseDemo;
2 |
3 | uses
4 | Vcl.Forms,
5 | Unit1 in 'Unit1.pas' {Form1};
6 |
7 | {$R *.res}
8 |
9 | begin
10 | Application.Initialize;
11 | Application.MainFormOnTaskbar := True;
12 | Application.Title := '';
13 | Application.CreateForm(TForm1, Form1);
14 | Application.Run;
15 | end.
16 |
--------------------------------------------------------------------------------
/Demo/MyBase/MyBaseDemo.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {C92BD2B8-C923-4832-B1E7-FAD4EC7AFEE1}
4 | 18.6
5 | VCL
6 | MyBaseDemo.dpr
7 | True
8 | Debug
9 | Win32
10 | 1
11 | Application
12 |
13 |
14 | true
15 |
16 |
17 | true
18 | Base
19 | true
20 |
21 |
22 | true
23 | Base
24 | true
25 |
26 |
27 | true
28 | Cfg_1
29 | true
30 | true
31 |
32 |
33 | true
34 | Base
35 | true
36 |
37 |
38 | true
39 | Cfg_2
40 | true
41 | true
42 |
43 |
44 | ..\..\Source;$(DCC_UnitSearchPath)
45 | 1049
46 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=
47 | MyBaseDemo
48 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png
49 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png
50 | System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)
51 | $(BDS)\bin\delphi_PROJECTICON.ico
52 | .\$(Platform)\$(Config)
53 | .\$(Platform)\$(Config)
54 | false
55 | false
56 | false
57 | false
58 | false
59 |
60 |
61 | $(BDS)\bin\default_app.manifest
62 | 1033
63 | true
64 | UIRibbonPackageDR;libevents;fmxase;libsynpdf;vcl;libsocket;vclactnband;IndySystem;tethering;svnui;libmselements;libvt;vclimg;libtrends;vcltouch;libcascade4;vcldb;bindcompfmx;svn;libtbx;libdatatree;fmx;fmxdae;libprjserv;xmlrtl;fmxobj;vclwinx;rtl;libproject;libgridview;CustomIPTransport;IndyCore;libprint;vclx;SynEditDR;bindcomp;appanalytics;libprjedit;libiec;bindcompvcl;libopc;libibx;VclSmp;libex;libmidas;libdesign;libtb2k;vclie;bindengine;dbrtl;IndyProtocols;libgridreport;inet;libutils;$(DCC_UsePackage)
65 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=
66 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
67 |
68 |
69 | DEBUG;$(DCC_Define)
70 | true
71 | false
72 | true
73 | true
74 | true
75 |
76 |
77 | true
78 | 1033
79 | true
80 | false
81 | PerMonitor
82 | Debug
83 |
84 |
85 | false
86 | RELEASE;$(DCC_Define)
87 | 0
88 | 0
89 |
90 |
91 | true
92 | PerMonitor
93 |
94 |
95 |
96 | MainSource
97 |
98 |
99 |
100 | dfm
101 |
102 |
103 | Cfg_2
104 | Base
105 |
106 |
107 | Base
108 |
109 |
110 | Cfg_1
111 | Base
112 |
113 |
114 |
115 | Delphi.Personality.12
116 | Application
117 |
118 |
119 |
120 | MyBaseDemo.dpr
121 |
122 |
123 |
124 | True
125 |
126 |
127 | 12
128 |
129 |
130 |
131 |
132 |
--------------------------------------------------------------------------------
/Demo/MyBase/MyBaseDemo.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/checker2/GridView/191ab645e7bda4e678da383b06f52cb1edbb637c/Demo/MyBase/MyBaseDemo.res
--------------------------------------------------------------------------------
/Demo/MyBase/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object Form1: TForm1
2 | Left = 0
3 | Top = 0
4 | Caption = 'TDBGridView MyBase Demo'
5 | ClientHeight = 499
6 | ClientWidth = 689
7 | Color = clBtnFace
8 | Font.Charset = DEFAULT_CHARSET
9 | Font.Color = clWindowText
10 | Font.Height = -11
11 | Font.Name = 'Tahoma'
12 | Font.Style = []
13 | OldCreateOrder = False
14 | PixelsPerInch = 96
15 | TextHeight = 13
16 | object DBGridView1: TDBGridView
17 | Left = 0
18 | Top = 0
19 | Width = 689
20 | Height = 499
21 | Align = alClient
22 | ColumnClick = True
23 | ColumnsFullDrag = True
24 | DataSource = DataSource1
25 | GridHint = 'Double click on a grid to load data'
26 | Header.Flat = False
27 | MultiSelect = True
28 | ParentShowHint = False
29 | ShowCellTips = True
30 | ShowGridHint = True
31 | ShowHint = True
32 | TabOrder = 0
33 | OnDblClick = DBGridView1DblClick
34 | end
35 | object DataSource1: TDataSource
36 | DataSet = ClientDataSet1
37 | Left = 32
38 | Top = 48
39 | end
40 | object ClientDataSet1: TClientDataSet
41 | Aggregates = <>
42 | Params = <>
43 | Left = 32
44 | Top = 100
45 | end
46 | object OpenDialog1: TOpenDialog
47 | DefaultExt = 'xml'
48 | Filter =
49 | 'MyBase XML Table (*.xml)|*.xml|Client DataSet (*.cds)|*.cds|All ' +
50 | 'Files (*.*)|*.*'
51 | Left = 32
52 | Top = 152
53 | end
54 | end
55 |
--------------------------------------------------------------------------------
/Demo/MyBase/Unit1.pas:
--------------------------------------------------------------------------------
1 | unit Unit1;
2 |
3 | interface
4 |
5 | uses
6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
7 | Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, Datasnap.DBClient,
8 | Ex_Grid, Ex_DBGrid;
9 |
10 | type
11 | TForm1 = class(TForm)
12 | DBGridView1: TDBGridView;
13 | DataSource1: TDataSource;
14 | ClientDataSet1: TClientDataSet;
15 | OpenDialog1: TOpenDialog;
16 | procedure DBGridView1DblClick(Sender: TObject);
17 | private
18 | { Private declarations }
19 | public
20 | { Public declarations }
21 | end;
22 |
23 | var
24 | Form1: TForm1;
25 |
26 | implementation
27 |
28 | {$R *.dfm}
29 |
30 | procedure TForm1.DBGridView1DblClick(Sender: TObject);
31 | begin
32 | if OpenDialog1.Execute then
33 | begin
34 | ClientDataSet1.LoadFromFile(OpenDialog1.FileName);
35 | ClientDataSet1.Active := True;
36 | end;
37 | end;
38 |
39 | end.
40 |
--------------------------------------------------------------------------------
/Demo/MyBase/customer.cds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/checker2/GridView/191ab645e7bda4e678da383b06f52cb1edbb637c/Demo/MyBase/customer.cds
--------------------------------------------------------------------------------
/Demo/MyBase/customer.xml:
--------------------------------------------------------------------------------
1 | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
/Demo/OwnerDraw1/OwnerDrawDemo1.dpr:
--------------------------------------------------------------------------------
1 | program OwnerDrawDemo1;
2 |
3 | uses
4 | Vcl.Forms,
5 | Unit1 in 'Unit1.pas' {Form1};
6 |
7 | {$R *.res}
8 |
9 | begin
10 | Application.Initialize;
11 | Application.MainFormOnTaskbar := True;
12 | Application.CreateForm(TForm1, Form1);
13 | Application.Run;
14 | end.
15 |
--------------------------------------------------------------------------------
/Demo/OwnerDraw1/OwnerDrawDemo1.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {FF51E3A5-1976-4E27-9049-9ACB8D4E112E}
4 | 18.6
5 | VCL
6 | OwnerDrawDemo1.dpr
7 | True
8 | Debug
9 | Win32
10 | 1
11 | Application
12 |
13 |
14 | true
15 |
16 |
17 | true
18 | Base
19 | true
20 |
21 |
22 | true
23 | Base
24 | true
25 |
26 |
27 | true
28 | Base
29 | true
30 |
31 |
32 | true
33 | Cfg_1
34 | true
35 | true
36 |
37 |
38 | true
39 | Base
40 | true
41 |
42 |
43 | true
44 | Cfg_2
45 | true
46 | true
47 |
48 |
49 | .\$(Platform)\$(Config)
50 | .\$(Platform)\$(Config)
51 | false
52 | false
53 | false
54 | false
55 | false
56 | System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)
57 | $(BDS)\bin\delphi_PROJECTICON.ico
58 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png
59 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png
60 | OwnerDrawDemo1
61 | ..\..\Source;$(DCC_UnitSearchPath)
62 | 1049
63 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=
64 |
65 |
66 | DBXSqliteDriver;IndyIPCommon;RESTComponents;bindcompdbx;DBXInterBaseDriver;vcl;IndyIPServer;vclactnband;vclFireDAC;IndySystem;tethering;svnui;dsnapcon;FireDACADSDriver;FireDACMSAccDriver;fmxFireDAC;vclimg;FireDAC;vcltouch;vcldb;bindcompfmx;svn;FireDACSqliteDriver;FireDACPgDriver;inetdb;soaprtl;DbxCommonDriver;fmx;FireDACIBDriver;fmxdae;xmlrtl;soapmidas;fmxobj;vclwinx;rtl;DbxClientDriver;CustomIPTransport;vcldsnap;dbexpress;IndyCore;vclx;bindcomp;appanalytics;dsnap;FireDACCommon;IndyIPClient;bindcompvcl;RESTBackendComponents;VCLRESTComponents;soapserver;dbxcds;VclSmp;adortl;GridViewDR;vclie;bindengine;DBXMySQLDriver;CloudService;dsnapxml;FireDACMySQLDriver;dbrtl;IndyProtocols;inetdbxpress;FireDACCommonODBC;FireDACCommonDriver;inet;fmxase;$(DCC_UsePackage)
67 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
68 | Debug
69 | true
70 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=
71 | 1033
72 | $(BDS)\bin\default_app.manifest
73 |
74 |
75 | DBXSqliteDriver;IndyIPCommon;RESTComponents;bindcompdbx;DBXInterBaseDriver;vcl;IndyIPServer;vclactnband;vclFireDAC;IndySystem;tethering;dsnapcon;FireDACADSDriver;FireDACMSAccDriver;fmxFireDAC;vclimg;FireDAC;vcltouch;vcldb;bindcompfmx;FireDACSqliteDriver;FireDACPgDriver;inetdb;soaprtl;DbxCommonDriver;fmx;FireDACIBDriver;fmxdae;xmlrtl;soapmidas;fmxobj;vclwinx;rtl;DbxClientDriver;CustomIPTransport;vcldsnap;dbexpress;IndyCore;vclx;bindcomp;appanalytics;dsnap;FireDACCommon;IndyIPClient;bindcompvcl;RESTBackendComponents;VCLRESTComponents;soapserver;dbxcds;VclSmp;adortl;vclie;bindengine;DBXMySQLDriver;CloudService;dsnapxml;FireDACMySQLDriver;dbrtl;IndyProtocols;inetdbxpress;FireDACCommonODBC;FireDACCommonDriver;inet;fmxase;$(DCC_UsePackage)
76 |
77 |
78 | DEBUG;$(DCC_Define)
79 | true
80 | false
81 | true
82 | true
83 | true
84 |
85 |
86 | false
87 | true
88 | PerMonitorV2
89 | true
90 | 1033
91 |
92 |
93 | false
94 | RELEASE;$(DCC_Define)
95 | 0
96 | 0
97 |
98 |
99 | true
100 | PerMonitorV2
101 |
102 |
103 |
104 | MainSource
105 |
106 |
107 |
108 | dfm
109 |
110 |
111 | Cfg_2
112 | Base
113 |
114 |
115 | Base
116 |
117 |
118 | Cfg_1
119 | Base
120 |
121 |
122 |
123 | Delphi.Personality.12
124 | Application
125 |
126 |
127 |
128 | OwnerDrawDemo1.dpr
129 |
130 |
131 | Microsoft Office 2000 Sample Automation Server Wrapper Components
132 | Microsoft Office XP Sample Automation Server Wrapper Components
133 |
134 |
135 |
136 |
137 |
138 | OwnerDrawDemo1.exe
139 | true
140 |
141 |
142 |
143 |
144 | 1
145 |
146 |
147 | Contents\MacOS
148 | 1
149 |
150 |
151 | 0
152 |
153 |
154 |
155 |
156 | classes
157 | 1
158 |
159 |
160 |
161 |
162 | res\xml
163 | 1
164 |
165 |
166 |
167 |
168 | library\lib\armeabi-v7a
169 | 1
170 |
171 |
172 |
173 |
174 | library\lib\armeabi
175 | 1
176 |
177 |
178 |
179 |
180 | library\lib\mips
181 | 1
182 |
183 |
184 |
185 |
186 | library\lib\armeabi-v7a
187 | 1
188 |
189 |
190 |
191 |
192 | res\drawable
193 | 1
194 |
195 |
196 |
197 |
198 | res\values
199 | 1
200 |
201 |
202 |
203 |
204 | res\values-v21
205 | 1
206 |
207 |
208 |
209 |
210 | res\drawable
211 | 1
212 |
213 |
214 |
215 |
216 | res\drawable-xxhdpi
217 | 1
218 |
219 |
220 |
221 |
222 | res\drawable-ldpi
223 | 1
224 |
225 |
226 |
227 |
228 | res\drawable-mdpi
229 | 1
230 |
231 |
232 |
233 |
234 | res\drawable-hdpi
235 | 1
236 |
237 |
238 |
239 |
240 | res\drawable-xhdpi
241 | 1
242 |
243 |
244 |
245 |
246 | res\drawable-small
247 | 1
248 |
249 |
250 |
251 |
252 | res\drawable-normal
253 | 1
254 |
255 |
256 |
257 |
258 | res\drawable-large
259 | 1
260 |
261 |
262 |
263 |
264 | res\drawable-xlarge
265 | 1
266 |
267 |
268 |
269 |
270 | 1
271 |
272 |
273 | Contents\MacOS
274 | 1
275 |
276 |
277 | 0
278 |
279 |
280 |
281 |
282 | Contents\MacOS
283 | 1
284 | .framework
285 |
286 |
287 | Contents\MacOS
288 | 1
289 | .framework
290 |
291 |
292 | 0
293 |
294 |
295 |
296 |
297 | 1
298 | .dylib
299 |
300 |
301 | 1
302 | .dylib
303 |
304 |
305 | 1
306 | .dylib
307 |
308 |
309 | Contents\MacOS
310 | 1
311 | .dylib
312 |
313 |
314 | Contents\MacOS
315 | 1
316 | .dylib
317 |
318 |
319 | 0
320 | .dll;.bpl
321 |
322 |
323 |
324 |
325 | 1
326 | .dylib
327 |
328 |
329 | 1
330 | .dylib
331 |
332 |
333 | 1
334 | .dylib
335 |
336 |
337 | Contents\MacOS
338 | 1
339 | .dylib
340 |
341 |
342 | Contents\MacOS
343 | 1
344 | .dylib
345 |
346 |
347 | 0
348 | .bpl
349 |
350 |
351 |
352 |
353 | 0
354 |
355 |
356 | 0
357 |
358 |
359 | 0
360 |
361 |
362 | 0
363 |
364 |
365 | Contents\Resources\StartUp\
366 | 0
367 |
368 |
369 | Contents\Resources\StartUp\
370 | 0
371 |
372 |
373 | 0
374 |
375 |
376 |
377 |
378 | 1
379 |
380 |
381 | 1
382 |
383 |
384 | 1
385 |
386 |
387 |
388 |
389 | 1
390 |
391 |
392 | 1
393 |
394 |
395 | 1
396 |
397 |
398 |
399 |
400 | 1
401 |
402 |
403 | 1
404 |
405 |
406 | 1
407 |
408 |
409 |
410 |
411 | 1
412 |
413 |
414 | 1
415 |
416 |
417 | 1
418 |
419 |
420 |
421 |
422 | 1
423 |
424 |
425 | 1
426 |
427 |
428 | 1
429 |
430 |
431 |
432 |
433 | 1
434 |
435 |
436 | 1
437 |
438 |
439 | 1
440 |
441 |
442 |
443 |
444 | 1
445 |
446 |
447 | 1
448 |
449 |
450 | 1
451 |
452 |
453 |
454 |
455 | 1
456 |
457 |
458 |
459 |
460 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
461 | 1
462 |
463 |
464 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
465 | 1
466 |
467 |
468 |
469 |
470 | 1
471 |
472 |
473 | 1
474 |
475 |
476 |
477 |
478 | ..\
479 | 1
480 |
481 |
482 | ..\
483 | 1
484 |
485 |
486 |
487 |
488 | 1
489 |
490 |
491 | 1
492 |
493 |
494 | 1
495 |
496 |
497 |
498 |
499 | 1
500 |
501 |
502 | 1
503 |
504 |
505 | 1
506 |
507 |
508 |
509 |
510 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
511 | 1
512 |
513 |
514 |
515 |
516 | ..\
517 | 1
518 |
519 |
520 | ..\
521 | 1
522 |
523 |
524 |
525 |
526 | Contents
527 | 1
528 |
529 |
530 | Contents
531 | 1
532 |
533 |
534 |
535 |
536 | Contents\Resources
537 | 1
538 |
539 |
540 | Contents\Resources
541 | 1
542 |
543 |
544 |
545 |
546 | library\lib\armeabi-v7a
547 | 1
548 |
549 |
550 | 1
551 |
552 |
553 | 1
554 |
555 |
556 | 1
557 |
558 |
559 | 1
560 |
561 |
562 | Contents\MacOS
563 | 1
564 |
565 |
566 | Contents\MacOS
567 | 1
568 |
569 |
570 | 0
571 |
572 |
573 |
574 |
575 | 1
576 |
577 |
578 | 1
579 |
580 |
581 |
582 |
583 | Assets
584 | 1
585 |
586 |
587 | Assets
588 | 1
589 |
590 |
591 |
592 |
593 | Assets
594 | 1
595 |
596 |
597 | Assets
598 | 1
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 | True
613 | False
614 |
615 |
616 | 12
617 |
618 |
619 |
620 |
621 |
622 |
--------------------------------------------------------------------------------
/Demo/OwnerDraw1/OwnerDrawDemo1.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/checker2/GridView/191ab645e7bda4e678da383b06f52cb1edbb637c/Demo/OwnerDraw1/OwnerDrawDemo1.res
--------------------------------------------------------------------------------
/Demo/OwnerDraw1/Unit1.dfm:
--------------------------------------------------------------------------------
1 | object Form1: TForm1
2 | Left = 0
3 | Top = 0
4 | Caption = 'TGridView OwnerDraw Demo'
5 | ClientHeight = 300
6 | ClientWidth = 635
7 | Color = clBtnFace
8 | Font.Charset = DEFAULT_CHARSET
9 | Font.Color = clWindowText
10 | Font.Height = -11
11 | Font.Name = 'Tahoma'
12 | Font.Style = []
13 | OldCreateOrder = False
14 | OnCreate = FormCreate
15 | PixelsPerInch = 96
16 | TextHeight = 13
17 | object GridView1: TGridView
18 | Left = 0
19 | Top = 0
20 | Width = 635
21 | Height = 300
22 | Align = alClient
23 | Columns = <
24 | item
25 | Caption = 'ID'
26 | end
27 | item
28 | Caption = 'Summary'
29 | DefWidth = 230
30 | end
31 | item
32 | Caption = 'Assign To'
33 | DefWidth = 80
34 | end
35 | item
36 | Caption = 'Executed On'
37 | DefWidth = 120
38 | end
39 | item
40 | Caption = 'Status'
41 | DefWidth = 100
42 | end>
43 | ColumnsFullDrag = True
44 | DefaultHeaderMenu = True
45 | GridStyle = [gsHorzLine]
46 | HighlightEvenRows = True
47 | ParentShowHint = False
48 | Rows.Count = 10
49 | RowSelect = True
50 | ShowCellTips = True
51 | ShowHint = True
52 | TabOrder = 0
53 | OnGetCellColors = GridView1GetCellColors
54 | OnGetCellText = GridView1GetCellText
55 | OnMouseMove = GridView1MouseMove
56 | end
57 | end
58 |
--------------------------------------------------------------------------------
/Demo/OwnerDraw1/Unit1.pas:
--------------------------------------------------------------------------------
1 | unit Unit1;
2 |
3 | interface
4 |
5 | uses
6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Ex_Grid;
8 |
9 | type
10 | TForm1 = class(TForm)
11 | GridView1: TGridView;
12 | procedure FormCreate(Sender: TObject);
13 | procedure GridView1GetCellText(Sender: TObject; Cell: TGridCell;
14 | var Value: string);
15 | procedure GridView1GetCellColors(Sender: TObject; Cell: TGridCell;
16 | Canvas: TCanvas);
17 | procedure GridView1MouseMove(Sender: TObject; Shift: TShiftState; X,
18 | Y: Integer);
19 | private
20 | { Private declarations }
21 | public
22 | { Public declarations }
23 | end;
24 |
25 | var
26 | Form1: TForm1;
27 |
28 | implementation
29 |
30 | {$R *.dfm}
31 |
32 | type
33 | TTestRec = record
34 | ID: Integer;
35 | Summary: string;
36 | AssignTo: string;
37 | Executed: string;
38 | Status: Boolean;
39 | end;
40 |
41 | const
42 | TestList: array[0..5] of TTestRec = (
43 | (ID: 415071; Summary: 'Verify the app can be installed'; AssignTo: 'Admin'; Executed: '24.02.2019 18:04'; Status: True),
44 | (ID: 415072; Summary: 'Verify the app can be launched'; AssignTo: 'Admin'; Executed: '24.02.2019 18:10'; Status: True),
45 | (ID: 415073; Summary: 'Verify the app can be closed'; AssignTo: 'Admin'; Executed: '24.02.2019 18:11'; Status: False),
46 | (ID: 415074; Summary: 'Verify the app can be upgraded'; AssignTo: 'Admin'; Executed: '24.02.2019 18:12'; Status: False),
47 | (ID: 415074; Summary: 'Verify the app can be repaired'; AssignTo: 'Admin'; Executed: '24.02.2019 18:14'; Status: False),
48 | (ID: 415075; Summary: 'Verify the app can be uninstalled'; AssignTo: 'Admin'; Executed: '24.02.2019 18:15'; Status: True));
49 |
50 | procedure TForm1.FormCreate(Sender: TObject);
51 | begin
52 | GridView1.Rows.Count := Length(TestList);
53 | end;
54 |
55 | procedure TForm1.GridView1GetCellColors(Sender: TObject; Cell: TGridCell;
56 | Canvas: TCanvas);
57 | const
58 | StatusColor: array[Boolean] of TColor = (clRed, clGreen);
59 | begin
60 | case Cell.Col of
61 | 0, 2:
62 | begin
63 | Canvas.Font.Color := clHighlight;
64 | Canvas.Font.Style := [fsUnderline];
65 | end;
66 | 4: Canvas.Font.Color := StatusColor[TestList[Cell.Row].Status];
67 | end;
68 | end;
69 |
70 | procedure TForm1.GridView1GetCellText(Sender: TObject; Cell: TGridCell;
71 | var Value: string);
72 | const
73 | SStatusStr: array[Boolean] of string = ('Failed', 'Passed');
74 | begin
75 | case Cell.Col of
76 | 0: Value := 'T' + IntToStr(TestList[Cell.Row].ID);
77 | 1: Value := TestList[Cell.Row].Summary;
78 | 2: Value := TestList[Cell.Row].AssignTo;
79 | 3: Value := TestList[Cell.Row].Executed;
80 | 4: Value := SStatusStr[TestList[Cell.Row].Status];
81 | end;
82 | end;
83 |
84 | procedure TForm1.GridView1MouseMove(Sender: TObject; Shift: TShiftState; X,
85 | Y: Integer);
86 | var
87 | Cell: TGridCell;
88 | begin
89 | Cell := GridView1.GetCellAt(X, Y);
90 | if Cell.Col in [0, 2] then GridView1.Cursor := crHandPoint
91 | else GridView1.Cursor := crDefault;
92 | end;
93 |
94 | end.
95 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 1997-2019 Roman M. Mochalov
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/Packages/Delphi/GridViewDD.dpk:
--------------------------------------------------------------------------------
1 | package GridViewDD;
2 |
3 | {$R *.res}
4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO OFF}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION OFF}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES ON}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DEFINE DEBUG}
27 | {$ENDIF IMPLICITBUILDING}
28 | {$DESCRIPTION 'GridView Component (Roman M. Mochalov)'}
29 | {$DESIGNONLY}
30 | {$IMPLICITBUILD OFF}
31 |
32 | requires
33 | rtl,
34 | designide,
35 | GridViewDR;
36 |
37 | contains
38 | Ex_RegGrid in '..\..\Source\Ex_RegGrid.pas',
39 | Ex_GridC in '..\..\Source\Ex_GridC.pas' {ColumnsEditorForm},
40 | Ex_GridH in '..\..\Source\Ex_GridH.pas' {HeaderEditorForm};
41 |
42 | end.
43 |
--------------------------------------------------------------------------------
/Packages/Delphi/GridViewDD.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {CE4032C9-AFE4-42D2-9B04-5A49B2DECB47}
4 | GridViewDD.dpk
5 | 18.6
6 | VCL
7 | True
8 | Debug
9 | Win32
10 | 1
11 | Package
12 |
13 |
14 | true
15 |
16 |
17 | true
18 | Base
19 | true
20 |
21 |
22 | true
23 | Base
24 | true
25 |
26 |
27 | true
28 | Cfg_1
29 | true
30 | true
31 |
32 |
33 | true
34 | Base
35 | true
36 |
37 |
38 | All
39 | true
40 | true
41 | System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)
42 | true
43 | GridViewDD
44 | true
45 | .\$(Platform)\$(Config)
46 | .\$(Platform)\$(Config)
47 | false
48 | false
49 | false
50 | false
51 | false
52 |
53 |
54 | rtl;GridViewDR;$(DCC_UsePackage)
55 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
56 | true
57 | 1033
58 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=
59 |
60 |
61 | DEBUG;$(DCC_Define)
62 | true
63 | false
64 | true
65 | true
66 | true
67 |
68 |
69 | GridView Component (Roman M. Mochalov)
70 | true
71 | 1033
72 | false
73 |
74 |
75 | false
76 | RELEASE;$(DCC_Define)
77 | 0
78 | 0
79 |
80 |
81 |
82 | MainSource
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 | dfm
91 |
92 |
93 |
94 | dfm
95 |
96 |
97 | Cfg_2
98 | Base
99 |
100 |
101 | Base
102 |
103 |
104 | Cfg_1
105 | Base
106 |
107 |
108 |
109 | Delphi.Personality.12
110 | Package
111 |
112 |
113 |
114 | GridViewDD.dpk
115 |
116 |
117 |
118 | True
119 |
120 |
121 | 12
122 |
123 |
124 |
125 |
126 |
--------------------------------------------------------------------------------
/Packages/Delphi/GridViewDD.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/checker2/GridView/191ab645e7bda4e678da383b06f52cb1edbb637c/Packages/Delphi/GridViewDD.res
--------------------------------------------------------------------------------
/Packages/Delphi/GridViewDR.dpk:
--------------------------------------------------------------------------------
1 | package GridViewDR;
2 |
3 | {$R *.res}
4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO OFF}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS ON}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION OFF}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO ON}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES ON}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DEFINE DEBUG}
27 | {$ENDIF IMPLICITBUILDING}
28 | {$DESCRIPTION 'GridView Component (Roman M. Mochalov)'}
29 | {$RUNONLY}
30 | {$IMPLICITBUILD OFF}
31 |
32 | requires
33 | rtl,
34 | vcl,
35 | dbrtl,
36 | vcldb;
37 |
38 | contains
39 | Ex_Grid in '..\..\Source\Ex_Grid.pas',
40 | Ex_DBGrid in '..\..\Source\Ex_DBGrid.pas';
41 |
42 | end.
43 |
--------------------------------------------------------------------------------
/Packages/Delphi/GridViewDR.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {84A0C0EC-839D-4ABC-8107-5B11E313E777}
4 | GridViewDR.dpk
5 | 18.6
6 | VCL
7 | True
8 | Debug
9 | Win32
10 | 1
11 | Package
12 |
13 |
14 | true
15 |
16 |
17 | true
18 | Base
19 | true
20 |
21 |
22 | true
23 | Base
24 | true
25 |
26 |
27 | true
28 | Cfg_1
29 | true
30 | true
31 |
32 |
33 | true
34 | Base
35 | true
36 |
37 |
38 | All
39 | true
40 | true
41 | System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)
42 | true
43 | true
44 | GridViewDR
45 | .\$(Platform)\$(Config)
46 | .\$(Platform)\$(Config)
47 | false
48 | false
49 | false
50 | false
51 | false
52 |
53 |
54 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
55 | true
56 | 1033
57 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=
58 |
59 |
60 | DEBUG;$(DCC_Define)
61 | true
62 | false
63 | true
64 | true
65 | true
66 |
67 |
68 | GridView Component (Roman M. Mochalov)
69 | true
70 | 1033
71 | false
72 |
73 |
74 | false
75 | RELEASE;$(DCC_Define)
76 | 0
77 | 0
78 |
79 |
80 |
81 | MainSource
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 | Cfg_2
94 | Base
95 |
96 |
97 | Base
98 |
99 |
100 | Cfg_1
101 | Base
102 |
103 |
104 |
105 | Delphi.Personality.12
106 | Package
107 |
108 |
109 |
110 | GridViewDR.dpk
111 |
112 |
113 |
114 | True
115 |
116 |
117 | 12
118 |
119 |
120 |
121 |
122 |
--------------------------------------------------------------------------------
/Packages/Delphi/GridViewDR.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/checker2/GridView/191ab645e7bda4e678da383b06f52cb1edbb637c/Packages/Delphi/GridViewDR.res
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GridView
2 |
3 | GridView is a Delphi VCL grid component for displaying records, arrays, collections, and any other data in the form of tables. It is a native and fast virtual grid without internal data storage designed to display external data using event handlers.
4 |
5 |
6 | ## Feautres
7 |
8 | - Event-driven architecture.
9 | - Up to 2147483647 rows.
10 | - Multi-level header with column click support.
11 | - Windows themes support.
12 | - Unicode support.
13 | - DB version included with multiselecting.
14 |
15 |
16 | ## How to install
17 |
18 | 1. Compile "Packages\Delphi\GridViewDR.dproj" package.
19 | 2. Compile "Packages\Delphi\GridViewDD.dproj" package.
20 | 3. Install "GridViewDD.dproj" package.
21 | 4. Add "Source\\" library path.
22 |
23 |
24 | ## How to use
25 |
26 | 1. Place TGridView component on form.
27 | 2. Define columns using "Columns" property.
28 | 3. Set row count using "Rows.Count" property.
29 | 4. Use OnGetCellText event to define cell text using your data.
30 | 5. Use OnSetEditText to get text into your data.
31 |
32 |
33 | ## Author
34 |
35 | Roman M. Mochalov ()
36 |
37 |
38 | ## License
39 |
40 | [MIT](https://github.com/checker2/GridView/blob/master/LICENSE)
41 |
--------------------------------------------------------------------------------
/Source/Ex_DBGrid.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/checker2/GridView/191ab645e7bda4e678da383b06f52cb1edbb637c/Source/Ex_DBGrid.bmp
--------------------------------------------------------------------------------
/Source/Ex_DBGrid.rc:
--------------------------------------------------------------------------------
1 | BM_GRIDVIEW_DB BITMAP "Ex_DBGrid.bmp"
2 |
3 |
--------------------------------------------------------------------------------
/Source/Ex_DBGrid.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/checker2/GridView/191ab645e7bda4e678da383b06f52cb1edbb637c/Source/Ex_DBGrid.res
--------------------------------------------------------------------------------
/Source/Ex_GridC.dfm:
--------------------------------------------------------------------------------
1 | object ColumnsEditorForm: TColumnsEditorForm
2 | Left = 202
3 | Top = 65
4 | BorderIcons = [biSystemMenu]
5 | BorderStyle = bsDialog
6 | Caption = 'Columns Editor'
7 | ClientHeight = 436
8 | ClientWidth = 542
9 | Color = clBtnFace
10 | Font.Charset = DEFAULT_CHARSET
11 | Font.Color = clWindowText
12 | Font.Height = -11
13 | Font.Name = 'Tahoma'
14 | Font.Style = []
15 | OldCreateOrder = True
16 | Position = poScreenCenter
17 | OnCreate = FormCreate
18 | OnDestroy = FormDestroy
19 | PixelsPerInch = 96
20 | TextHeight = 13
21 | object ColumnsGroup: TGroupBox
22 | Left = 8
23 | Top = 8
24 | Width = 260
25 | Height = 384
26 | Caption = ' Columns '
27 | TabOrder = 0
28 | object ColumnsList: TListView
29 | Left = 12
30 | Top = 18
31 | Width = 235
32 | Height = 320
33 | Columns = <
34 | item
35 | Caption = 'Index'
36 | Width = 30
37 | end
38 | item
39 | Caption = 'Name'
40 | Width = 180
41 | end>
42 | ColumnClick = False
43 | HideSelection = False
44 | TabOrder = 0
45 | ViewStyle = vsReport
46 | OnChanging = ColumnsListChanging
47 | OnEnter = ColumnsListEnter
48 | OnKeyDown = ColumnsListKeyDown
49 | end
50 | object AddButton: TButton
51 | Left = 12
52 | Top = 346
53 | Width = 115
54 | Height = 25
55 | Caption = 'Add'
56 | TabOrder = 1
57 | OnClick = AddButtonClick
58 | end
59 | object DeleteButton: TButton
60 | Left = 132
61 | Top = 346
62 | Width = 115
63 | Height = 25
64 | Caption = 'Delete'
65 | Enabled = False
66 | TabOrder = 2
67 | OnClick = DeleteButtonClick
68 | end
69 | end
70 | object PropertiesGroup: TGroupBox
71 | Left = 279
72 | Top = 8
73 | Width = 255
74 | Height = 384
75 | Caption = ' Column Properties '
76 | TabOrder = 1
77 | object IndexLabel: TLabel
78 | Left = 12
79 | Top = 24
80 | Width = 32
81 | Height = 13
82 | Caption = 'Index:'
83 | FocusControl = IndexEdit
84 | end
85 | object CaptionLabel: TLabel
86 | Left = 12
87 | Top = 50
88 | Width = 41
89 | Height = 13
90 | Caption = 'Caption:'
91 | FocusControl = CaptionEdit
92 | end
93 | object WidthLabel: TLabel
94 | Left = 12
95 | Top = 76
96 | Width = 32
97 | Height = 13
98 | Caption = 'Width:'
99 | FocusControl = WidthEdit
100 | end
101 | object MinWidthLabel: TLabel
102 | Left = 12
103 | Top = 102
104 | Width = 55
105 | Height = 13
106 | Caption = 'Min. Width:'
107 | FocusControl = MinWidthEdit
108 | end
109 | object MaxWidthLabel: TLabel
110 | Left = 12
111 | Top = 128
112 | Width = 59
113 | Height = 13
114 | Caption = 'Max. Width:'
115 | FocusControl = MaxWidthEdit
116 | end
117 | object AlignmentLabel: TLabel
118 | Left = 12
119 | Top = 154
120 | Width = 51
121 | Height = 13
122 | Caption = 'Alignment:'
123 | FocusControl = AlignmentCombo
124 | end
125 | object MaxLengthLabel: TLabel
126 | Left = 12
127 | Top = 180
128 | Width = 64
129 | Height = 13
130 | Caption = 'Max. Length:'
131 | FocusControl = MaxLengthEdit
132 | end
133 | object EditStyleLabel: TLabel
134 | Left = 12
135 | Top = 206
136 | Width = 49
137 | Height = 13
138 | Caption = 'Edit Style:'
139 | FocusControl = EditStyleCombo
140 | end
141 | object CheckKindLabel: TLabel
142 | Left = 12
143 | Top = 232
144 | Width = 56
145 | Height = 13
146 | Caption = 'Check Kind:'
147 | FocusControl = CheckKindCombo
148 | end
149 | object IndexEdit: TEdit
150 | Left = 98
151 | Top = 24
152 | Width = 142
153 | Height = 21
154 | MaxLength = 10
155 | TabOrder = 0
156 | OnChange = EnableApply
157 | OnKeyPress = IndexEditKeyPress
158 | end
159 | object CaptionEdit: TEdit
160 | Left = 98
161 | Top = 50
162 | Width = 142
163 | Height = 21
164 | TabOrder = 1
165 | OnChange = EnableApply
166 | end
167 | object WidthEdit: TEdit
168 | Left = 98
169 | Top = 76
170 | Width = 142
171 | Height = 21
172 | MaxLength = 10
173 | TabOrder = 2
174 | OnChange = EnableApply
175 | OnKeyPress = IndexEditKeyPress
176 | end
177 | object MinWidthEdit: TEdit
178 | Left = 98
179 | Top = 102
180 | Width = 142
181 | Height = 21
182 | MaxLength = 10
183 | TabOrder = 3
184 | OnChange = EnableApply
185 | OnKeyPress = IndexEditKeyPress
186 | end
187 | object MaxWidthEdit: TEdit
188 | Left = 98
189 | Top = 128
190 | Width = 142
191 | Height = 21
192 | MaxLength = 10
193 | TabOrder = 4
194 | OnChange = EnableApply
195 | OnKeyPress = IndexEditKeyPress
196 | end
197 | object AlignmentCombo: TComboBox
198 | Left = 98
199 | Top = 154
200 | Width = 142
201 | Height = 21
202 | Style = csDropDownList
203 | TabOrder = 5
204 | OnChange = EnableApply
205 | Items.Strings = (
206 | 'Left'
207 | 'Right'
208 | 'Center')
209 | end
210 | object MaxLengthEdit: TEdit
211 | Left = 98
212 | Top = 180
213 | Width = 142
214 | Height = 21
215 | MaxLength = 10
216 | TabOrder = 6
217 | OnChange = EnableApply
218 | OnKeyPress = IndexEditKeyPress
219 | end
220 | object EditStyleCombo: TComboBox
221 | Left = 98
222 | Top = 206
223 | Width = 142
224 | Height = 21
225 | Style = csDropDownList
226 | TabOrder = 7
227 | OnChange = EnableApply
228 | Items.Strings = (
229 | 'Simple'
230 | 'Ellipsis'
231 | 'PickList'
232 | 'DataList'
233 | 'UserDefine')
234 | end
235 | object FixedSizeCheck: TCheckBox
236 | Left = 98
237 | Top = 264
238 | Width = 142
239 | Height = 17
240 | Caption = 'Fixed Size'
241 | TabOrder = 9
242 | OnClick = EnableApply
243 | end
244 | object ReadOnlyCheck: TCheckBox
245 | Left = 98
246 | Top = 282
247 | Width = 142
248 | Height = 17
249 | Caption = 'ReadOnly'
250 | TabOrder = 10
251 | OnClick = EnableApply
252 | end
253 | object WantReturnsCheck: TCheckBox
254 | Left = 98
255 | Top = 300
256 | Width = 142
257 | Height = 17
258 | Caption = 'Want Returns'
259 | TabOrder = 11
260 | OnClick = EnableApply
261 | end
262 | object WordWrapCheck: TCheckBox
263 | Left = 98
264 | Top = 318
265 | Width = 142
266 | Height = 17
267 | Caption = 'Word Wrap'
268 | TabOrder = 12
269 | OnClick = EnableApply
270 | end
271 | object TabStopCheck: TCheckBox
272 | Left = 98
273 | Top = 336
274 | Width = 142
275 | Height = 17
276 | Caption = 'Tab Stop'
277 | TabOrder = 13
278 | OnClick = EnableApply
279 | end
280 | object VisibleCheck: TCheckBox
281 | Left = 98
282 | Top = 354
283 | Width = 142
284 | Height = 17
285 | Caption = 'Visible'
286 | TabOrder = 14
287 | OnClick = EnableApply
288 | end
289 | object CheckKindCombo: TComboBox
290 | Left = 98
291 | Top = 232
292 | Width = 142
293 | Height = 21
294 | Style = csDropDownList
295 | TabOrder = 8
296 | OnChange = EnableApply
297 | Items.Strings = (
298 | 'None'
299 | 'CheckBox'
300 | 'RadioButton'
301 | 'UserDefine')
302 | end
303 | end
304 | object OKButton: TButton
305 | Left = 299
306 | Top = 402
307 | Width = 75
308 | Height = 25
309 | Caption = 'OK'
310 | Default = True
311 | TabOrder = 2
312 | OnClick = OKButtonClick
313 | end
314 | object CancelButton: TButton
315 | Left = 379
316 | Top = 402
317 | Width = 75
318 | Height = 25
319 | Cancel = True
320 | Caption = 'Cancel'
321 | ModalResult = 2
322 | TabOrder = 3
323 | end
324 | object ApplyButton: TButton
325 | Left = 459
326 | Top = 402
327 | Width = 75
328 | Height = 25
329 | Cancel = True
330 | Caption = 'Apply'
331 | Enabled = False
332 | TabOrder = 4
333 | OnClick = ApplyButtonClick
334 | end
335 | end
336 |
--------------------------------------------------------------------------------
/Source/Ex_GridC.pas:
--------------------------------------------------------------------------------
1 | {
2 | TGridView component (grid)
3 |
4 | (C) Roman M. Mochalov, 1997-2019
5 | E-mail: checker@mail.ru
6 |
7 | License: MIT
8 | }
9 |
10 | unit Ex_GridC;
11 |
12 | interface
13 |
14 | uses
15 | Windows, SysUtils, Classes, Controls, Forms, Graphics, StdCtrls, ComCtrls,
16 | Ex_Grid;
17 |
18 | type
19 | TColumnsEditorForm = class(TForm)
20 | ColumnsGroup: TGroupBox;
21 | ColumnsList: TListView;
22 | AddButton: TButton;
23 | DeleteButton: TButton;
24 | PropertiesGroup: TGroupBox;
25 | IndexLabel: TLabel;
26 | IndexEdit: TEdit;
27 | CaptionLabel: TLabel;
28 | CaptionEdit: TEdit;
29 | WidthLabel: TLabel;
30 | WidthEdit: TEdit;
31 | MinWidthLabel: TLabel;
32 | MinWidthEdit: TEdit;
33 | MaxWidthLabel: TLabel;
34 | MaxWidthEdit: TEdit;
35 | AlignmentLabel: TLabel;
36 | AlignmentCombo: TComboBox;
37 | MaxLengthLabel: TLabel;
38 | MaxLengthEdit: TEdit;
39 | EditStyleLabel: TLabel;
40 | EditStyleCombo: TComboBox;
41 | CheckKindLabel: TLabel;
42 | CheckKindCombo: TComboBox;
43 | FixedSizeCheck: TCheckBox;
44 | ReadOnlyCheck: TCheckBox;
45 | WantReturnsCheck: TCheckBox;
46 | WordWrapCheck: TCheckBox;
47 | TabStopCheck: TCheckBox;
48 | VisibleCheck: TCheckBox;
49 | OKButton: TButton;
50 | CancelButton: TButton;
51 | ApplyButton: TButton;
52 | procedure EnableApply(Sender: TObject);
53 | procedure DisableApply(Sender: TObject);
54 | procedure FormCreate(Sender: TObject);
55 | procedure FormDestroy(Sender: TObject);
56 | procedure ColumnsListChange(Sender: TObject; Item: TListItem; Change: TItemChange);
57 | procedure ColumnsListChanging(Sender: TObject; Item: TListItem; Change: TItemChange; var AllowChange: Boolean);
58 | procedure ColumnsListEnter(Sender: TObject);
59 | procedure ColumnsListKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
60 | procedure OKButtonClick(Sender: TObject);
61 | procedure ApplyButtonClick(Sender: TObject);
62 | procedure AddButtonClick(Sender: TObject);
63 | procedure DeleteButtonClick(Sender: TObject);
64 | procedure IndexEditKeyPress(Sender: TObject; var Key: Char);
65 | private
66 | FGrid: TCustomGridView;
67 | FColumns: TGridColumns;
68 | FExceptCount: Integer;
69 | FChangeCount: Integer;
70 | procedure AddColumn;
71 | procedure DeleteAllColumns;
72 | procedure DeleteColumn;
73 | procedure CheckColumn;
74 | procedure GetColumn;
75 | procedure GetParams;
76 | procedure MoveColumnDown;
77 | procedure MoveColumnUp;
78 | procedure PutColumn;
79 | procedure PutParams;
80 | procedure RefreshView;
81 | public
82 | function Execute(Grid: TCustomGridView): Boolean;
83 | end;
84 |
85 | function EditGridColumns(Grid: TCustomGridView): Boolean;
86 |
87 | implementation
88 |
89 | {$R *.DFM}
90 |
91 | function EditGridColumns(Grid: TCustomGridView): Boolean;
92 | begin
93 | with TColumnsEditorForm.Create(nil) do
94 | try
95 | Execute(Grid);
96 | Result := FChangeCount > 0;
97 | finally
98 | Free;
99 | end;
100 | end;
101 |
102 | type
103 | EColumnError = class(Exception);
104 |
105 | { TColumnsEditorForm }
106 |
107 | procedure TColumnsEditorForm.AddColumn;
108 | begin
109 | FColumns.Add;
110 | RefreshView;
111 | CaptionEdit.SetFocus;
112 | EnableApply(nil);
113 | end;
114 |
115 | procedure TColumnsEditorForm.DeleteAllColumns;
116 | const
117 | Message = 'Delete all columns?';
118 | Flags = MB_YESNO or MB_ICONQUESTION;
119 | begin
120 | if ColumnsList.Items.Count > 0 then
121 | if Application.MessageBox(Message, PChar(Caption), Flags) = IDYES then
122 | begin
123 | FColumns.Clear;
124 | RefreshView;
125 | EnableApply(nil);
126 | end;
127 | end;
128 |
129 | procedure TColumnsEditorForm.DeleteColumn;
130 | var
131 | I: Integer;
132 | begin
133 | with ColumnsList do
134 | begin
135 | I := Items.IndexOf(ItemFocused);
136 | if I <> -1 then
137 | begin
138 | FColumns[I].Free;
139 | RefreshView;
140 | ColumnsList.SetFocus;
141 | EnableApply(nil);
142 | end;
143 | end;
144 | end;
145 |
146 | procedure TColumnsEditorForm.CheckColumn;
147 | var
148 | I: Integer;
149 | begin
150 | if PropertiesGroup.Enabled then
151 | begin
152 | with IndexEdit do
153 | try
154 | I := StrToIntDef(Text, -1);
155 | if (I < 0) or (I > FColumns.Count - 1) then
156 | raise EColumnError.CreateFmt('Invalid index (%s)', [Text]);
157 | except
158 | SetFocus;
159 | raise;
160 | end;
161 | with WidthEdit do
162 | try
163 | StrToInt(Text);
164 | except
165 | SetFocus;
166 | raise;
167 | end;
168 | with MinWidthEdit do
169 | try
170 | StrToInt(Text);
171 | except
172 | SetFocus;
173 | raise;
174 | end;
175 | with MaxWidthEdit do
176 | try
177 | StrToInt(Text);
178 | except
179 | SetFocus;
180 | raise;
181 | end;
182 | with MaxLengthEdit do
183 | try
184 | StrToInt(Text);
185 | except
186 | SetFocus;
187 | raise;
188 | end;
189 | end;
190 | end;
191 |
192 | procedure TColumnsEditorForm.GetColumn;
193 | var
194 | I: Integer;
195 | begin
196 | with ColumnsList do
197 | begin
198 | I := Items.IndexOf(ItemFocused);
199 | if I <> -1 then
200 | begin
201 | IndexEdit.Text := IntToStr(I);
202 | CaptionEdit.Text := FColumns[I].Caption;
203 | WidthEdit.Text := IntToStr(FColumns[I].DefWidth);
204 | MinWidthEdit.Text := IntToStr(FColumns[I].MinWidth);
205 | MaxWidthEdit.Text := IntToStr(FColumns[I].MaxWidth);
206 | AlignmentCombo.ItemIndex := Ord(FColumns[I].Alignment);
207 | MaxLengthEdit.Text := IntToStr(FColumns[I].MaxLength);
208 | EditStyleCombo.ItemIndex := Ord(FColumns[I].EditStyle);
209 | CheckKindCombo.ItemIndex := Ord(FColumns[I].CheckKind);
210 | FixedSizeCheck.Checked := FColumns[I].FixedSize;
211 | ReadOnlyCheck.Checked := FColumns[I].ReadOnly;
212 | WantReturnsCheck.Checked := FColumns[I].WantReturns;
213 | WordWrapCheck.Checked := FColumns[I].WordWrap;
214 | TabStopCheck.Checked := not FColumns[I].TabStop;
215 | VisibleCheck.Checked := not FColumns[I].Visible;
216 | end;
217 | end;
218 | end;
219 |
220 | procedure TColumnsEditorForm.GetParams;
221 | begin
222 | FColumns.Assign(FGrid.Columns);
223 | RefreshView
224 | end;
225 |
226 | procedure TColumnsEditorForm.MoveColumnDown;
227 | var
228 | I: Integer;
229 | begin
230 | with ColumnsList do
231 | begin
232 | I := Items.IndexOf(ItemFocused);
233 | if I < Items.Count - 1 then
234 | begin
235 | FColumns[I].Index := I + 1;
236 | RefreshView;
237 | ItemFocused.Selected := False;
238 | ItemFocused := Items[I + 1];
239 | ItemFocused.Selected := True;
240 | ItemFocused.MakeVisible(True);
241 | EnableApply(nil);
242 | end;
243 | end;
244 | end;
245 |
246 | procedure TColumnsEditorForm.MoveColumnUp;
247 | var
248 | I: Integer;
249 | begin
250 | with ColumnsList do
251 | begin
252 | I := Items.IndexOf(ItemFocused);
253 | if I > 0 then
254 | begin
255 | FColumns[I].Index := I - 1;
256 | RefreshView;
257 | ItemFocused.Selected := False;
258 | ItemFocused := Items[I - 1];
259 | ItemFocused.Selected := True;
260 | ItemFocused.MakeVisible(True);
261 | EnableApply(nil);
262 | end;
263 | end;
264 | end;
265 |
266 | procedure TColumnsEditorForm.PutColumn;
267 | var
268 | I: Integer;
269 | begin
270 | with ColumnsList do
271 | begin
272 | I := Items.IndexOf(ItemFocused);
273 | if I <> -1 then
274 | with FColumns[I] do
275 | begin
276 | Index := StrToInt(IndexEdit.Text);
277 | Caption := CaptionEdit.Text;
278 | DefWidth := StrToInt(WidthEdit.Text);
279 | MinWidth := StrToInt(MinWidthEdit.Text);
280 | MaxWidth := StrToInt(MaxWidthEdit.Text);
281 | Alignment := TAlignment(AlignmentCombo.ItemIndex);
282 | MaxLength := StrToInt(MaxLengthEdit.Text);
283 | FColumns[I].EditStyle := TGridEditStyle(EditStyleCombo.ItemIndex);
284 | CheckKind := TGridCheckKind(CheckKindCombo.ItemIndex);
285 | FixedSize := FixedSizeCheck.Checked;
286 | ReadOnly := ReadOnlyCheck.Checked;
287 | WantReturns := WantReturnsCheck.Checked;
288 | WordWrap := WordWrapCheck.Checked;
289 | TabStop := not TabStopCheck.Checked;
290 | Visible := not VisibleCheck.Checked;
291 | RefreshView;
292 | end;
293 | end;
294 | end;
295 |
296 | procedure TColumnsEditorForm.PutParams;
297 | begin
298 | FGrid.Columns := FColumns;
299 | end;
300 |
301 | procedure TColumnsEditorForm.RefreshView;
302 |
303 | procedure BeginRefresh;
304 | begin
305 | ColumnsList.OnChange := nil;
306 | ColumnsList.OnChanging := nil;
307 | IndexEdit.OnChange := nil;
308 | CaptionEdit.OnChange := nil;
309 | WidthEdit.OnChange := nil;
310 | MinWidthEdit.OnChange := nil;
311 | MaxWidthEdit.OnChange := nil;
312 | AlignmentCombo.OnChange := nil;
313 | MaxLengthEdit.OnChange := nil;
314 | EditStyleCombo.OnChange := nil;
315 | CheckKindCombo.OnChange := nil;
316 | FixedSizeCheck.OnClick := nil;
317 | ReadOnlyCheck.OnClick := nil;
318 | WantReturnsCheck.OnClick := nil;
319 | WordWrapCheck.OnClick := nil;
320 | TabStopCheck.OnClick := nil;
321 | VisibleCheck.OnClick := nil;
322 | end;
323 |
324 | procedure EndRefresh;
325 | begin
326 | ColumnsList.OnChange := ColumnsListChange;
327 | ColumnsList.OnChanging := ColumnsListChanging;
328 | IndexEdit.OnChange := EnableApply;
329 | CaptionEdit.OnChange := EnableApply;
330 | WidthEdit.OnChange := EnableApply;
331 | MinWidthEdit.OnChange := EnableApply;
332 | MaxWidthEdit.OnChange := EnableApply;
333 | AlignmentCombo.OnChange := EnableApply;
334 | MaxLengthEdit.OnChange := EnableApply;
335 | EditStyleCombo.OnChange := EnableApply;
336 | CheckKindCombo.OnChange := EnableApply;
337 | FixedSizeCheck.OnClick := EnableApply;
338 | ReadOnlyCheck.OnClick := EnableApply;
339 | WantReturnsCheck.OnClick := EnableApply;
340 | WordWrapCheck.OnClick := EnableApply;
341 | TabStopCheck.OnClick := EnableApply;
342 | VisibleCheck.OnClick := EnableApply;
343 | end;
344 |
345 | procedure RefreshListView;
346 | var
347 | I, C: Integer;
348 |
349 | procedure SetCaption(Item: Integer; const Value: string);
350 | begin
351 | with ColumnsList.Items[Item] do
352 | if Caption <> Value then
353 | begin
354 | Caption := Value;
355 | Inc(C);
356 | end;
357 | end;
358 |
359 | procedure SetSubItem(Item, Index: Integer; const Value: string);
360 | begin
361 | with ColumnsList.Items[Item].SubItems do
362 | if Strings[Index] <> Value then
363 | begin
364 | Strings[Index] := Value;
365 | Inc(C);
366 | end;
367 | end;
368 |
369 | procedure UpdateItem(Item: Integer);
370 | var
371 | R: TRect;
372 | begin
373 | with ColumnsList do
374 | begin
375 | R := Items[Item].DisplayRect(drBounds);
376 | InvalidateRect(Handle, @R, False);
377 | end;
378 | end;
379 |
380 | begin
381 | with ColumnsList do
382 | begin
383 | if Items.Count > FColumns.Count then
384 | begin
385 | I := Items.Count;
386 | while I > FColumns.Count do
387 | begin
388 | Dec(I);
389 | Items.Delete(I);
390 | end;
391 | end
392 | else if Items.Count < FColumns.Count then
393 | begin
394 | I := Items.Count;
395 | while I < FColumns.Count do
396 | begin
397 | Inc(I);
398 | with Items.Add do
399 | begin
400 | SubItems.Add('');
401 | end;
402 | end;
403 | if Items.Count > 0 then
404 | begin
405 | ItemFocused := Items[Items.Count - 1];
406 | Selected := Items[Items.Count - 1];
407 | Selected.MakeVisible(True);
408 | end;
409 | end;
410 | end;
411 | with FColumns do
412 | begin
413 | for I := 0 to Count - 1 do
414 | begin
415 | C := 0;
416 | with Columns[I] do
417 | begin
418 | SetCaption(I, IntToStr(I));
419 | SetSubItem(I, 0, Caption);
420 | end;
421 | if C <> 0 then UpdateItem(I);
422 | end;
423 | end;
424 | end;
425 |
426 | procedure RefreshControls;
427 | begin
428 | with ColumnsList do
429 | begin
430 | if Items.IndexOf(ItemFocused) <> -1 then
431 | begin
432 | PropertiesGroup.Enabled := True;
433 | DeleteButton.Enabled := True;
434 | GetColumn;
435 | end
436 | else
437 | begin
438 | VisibleCheck.Checked := False;
439 | TabStopCheck.Checked := False;
440 | WantReturnsCheck.Checked := False;
441 | WordWrapCheck.Checked := False;
442 | ReadOnlyCheck.Checked := False;
443 | FixedSizeCheck.Checked := False;
444 | EditStyleCombo.ItemIndex := -1;
445 | CheckKindCombo.ItemIndex := -1;
446 | MaxLengthEdit.Text := '';
447 | AlignmentCombo.ItemIndex := -1;
448 | MaxWidthEdit.Text := '';
449 | MinWidthEdit.Text := '';
450 | WidthEdit.Text := '';
451 | CaptionEdit.Text := '';
452 | IndexEdit.Text := '';
453 | DeleteButton.Enabled := False;
454 | PropertiesGroup.Enabled := False;
455 | end;
456 | end;
457 | end;
458 |
459 | begin
460 | BeginRefresh;
461 | try
462 | RefreshListView;
463 | RefreshControls;
464 | finally
465 | Endrefresh;
466 | end;
467 | end;
468 |
469 | function TColumnsEditorForm.Execute(Grid: TCustomGridView): Boolean;
470 | begin
471 | FGrid := Grid;
472 | GetParams;
473 | Result := ShowModal = mrOK;
474 | end;
475 |
476 | procedure TColumnsEditorForm.EnableApply(Sender: TObject);
477 | begin
478 | OKButton.Default := False;
479 | ApplyButton.Enabled := True;
480 | ApplyButton.Default := True;
481 | end;
482 |
483 | procedure TColumnsEditorForm.DisableApply(Sender: TObject);
484 | begin
485 | ApplyButton.Default := False;
486 | ApplyButton.Enabled := False;
487 | OKButton.Default := True;
488 | end;
489 |
490 | procedure TColumnsEditorForm.FormCreate(Sender: TObject);
491 | const
492 | LVM_SETEXTSTYLE = $1000 + 54;
493 | LVS_EX_FULLROWSELECT = $00000020;
494 | begin
495 | SendMessage(ColumnsList.Handle, LVM_SETEXTSTYLE, 0, LVS_EX_FULLROWSELECT);
496 | FColumns := TGridColumns.Create(nil);
497 | end;
498 |
499 | procedure TColumnsEditorForm.FormDestroy(Sender: TObject);
500 | begin
501 | FColumns.Free;
502 | end;
503 |
504 | procedure TColumnsEditorForm.ColumnsListChange(Sender: TObject; Item: TListItem; Change: TItemChange);
505 | begin
506 | if not (csDestroying in ComponentState) then RefreshView;
507 | end;
508 |
509 | procedure TColumnsEditorForm.ColumnsListChanging(Sender: TObject; Item: TListItem; Change: TItemChange; var AllowChange: Boolean);
510 | begin
511 | if not (csDestroying in ComponentState) then
512 | begin
513 | try
514 | CheckColumn;
515 | PutColumn;
516 | RefreshView;
517 | except
518 | if FExceptCount = 0 then Application.HandleException(Self);
519 | Inc(FExceptCount);
520 | end;
521 | AllowChange := FExceptCount = 0;
522 | end;
523 | end;
524 |
525 | procedure TColumnsEditorForm.ColumnsListEnter(Sender: TObject);
526 | begin
527 | FExceptCount := 0;
528 | end;
529 |
530 | procedure TColumnsEditorForm.ColumnsListKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
531 | begin
532 | if Shift = [] then
533 | case Key of
534 | VK_INSERT:
535 | begin
536 | with AddButton do if Enabled then Click;
537 | Key := 0;
538 | end;
539 | VK_DELETE:
540 | begin
541 | with DeleteButton do if Enabled then Click;
542 | Key := 0;
543 | end;
544 | end;
545 | if Shift = [ssCtrl] then
546 | case Key of
547 | VK_DELETE:
548 | begin
549 | DeleteAllColumns;
550 | Key := 0;
551 | end;
552 | VK_UP:
553 | begin
554 | CheckColumn;
555 | PutColumn;
556 | MoveColumnUp;
557 | Key := 0;
558 | end;
559 | VK_DOWN:
560 | begin
561 | CheckColumn;
562 | PutColumn;
563 | MoveColumnDown;
564 | Key := 0;
565 | end;
566 | end;
567 | end;
568 |
569 | procedure TColumnsEditorForm.IndexEditKeyPress(Sender: TObject; var Key: Char);
570 | begin
571 | if not CharInSet(Key, [#8, '0'..'9']) then
572 | begin
573 | MessageBeep(0);
574 | Key := #0;
575 | end;
576 | end;
577 |
578 | procedure TColumnsEditorForm.OKButtonClick(Sender: TObject);
579 | begin
580 | ApplyButtonClick(ApplyButton);
581 | ModalResult := mrOK;
582 | end;
583 |
584 | procedure TColumnsEditorForm.ApplyButtonClick(Sender: TObject);
585 | begin
586 | CheckColumn;
587 | PutColumn;
588 | PutParams;
589 | GetParams;
590 | DisableApply(nil);
591 | Inc(FChangeCount);
592 | end;
593 |
594 | procedure TColumnsEditorForm.AddButtonClick(Sender: TObject);
595 | begin
596 | CheckColumn;
597 | PutColumn;
598 | AddColumn;
599 | end;
600 |
601 | procedure TColumnsEditorForm.DeleteButtonClick(Sender: TObject);
602 | begin
603 | CheckColumn;
604 | PutColumn;
605 | DeleteColumn;
606 | end;
607 |
608 | end.
609 |
610 |
611 |
--------------------------------------------------------------------------------
/Source/Ex_GridH.dfm:
--------------------------------------------------------------------------------
1 | object HeaderEditorForm: THeaderEditorForm
2 | Left = 216
3 | Top = 87
4 | BorderIcons = [biSystemMenu]
5 | BorderStyle = bsDialog
6 | Caption = 'Header Editor'
7 | ClientHeight = 322
8 | ClientWidth = 522
9 | Color = clBtnFace
10 | Font.Charset = DEFAULT_CHARSET
11 | Font.Color = clWindowText
12 | Font.Height = -11
13 | Font.Name = 'Tahoma'
14 | Font.Style = []
15 | OldCreateOrder = True
16 | Position = poScreenCenter
17 | OnCreate = FormCreate
18 | OnDestroy = FormDestroy
19 | PixelsPerInch = 96
20 | TextHeight = 13
21 | object SectionssGroup: TGroupBox
22 | Left = 8
23 | Top = 8
24 | Width = 260
25 | Height = 271
26 | Caption = ' Header '
27 | TabOrder = 0
28 | object SectionsTree: TTreeView
29 | Left = 12
30 | Top = 18
31 | Width = 235
32 | Height = 205
33 | HideSelection = False
34 | Indent = 19
35 | ReadOnly = True
36 | TabOrder = 0
37 | OnChange = SectionsTreeChange
38 | OnChanging = SectionsTreeChanging
39 | OnEnter = SectionsTreeEnter
40 | OnKeyDown = SectionsTreeKeyDown
41 | end
42 | object AddButton: TButton
43 | Left = 12
44 | Top = 234
45 | Width = 115
46 | Height = 25
47 | Caption = 'Add'
48 | TabOrder = 1
49 | OnClick = AddButtonClick
50 | end
51 | object DeleteButton: TButton
52 | Left = 132
53 | Top = 234
54 | Width = 115
55 | Height = 25
56 | Caption = 'Delete'
57 | Enabled = False
58 | TabOrder = 2
59 | OnClick = DeleteButtonClick
60 | end
61 | end
62 | object PropertiesGroup: TGroupBox
63 | Left = 279
64 | Top = 8
65 | Width = 235
66 | Height = 271
67 | Caption = ' Section Properties '
68 | TabOrder = 1
69 | object IndexLabel: TLabel
70 | Left = 12
71 | Top = 24
72 | Width = 32
73 | Height = 13
74 | Caption = 'Index:'
75 | FocusControl = IndexEdit
76 | end
77 | object CaptionLabel: TLabel
78 | Left = 12
79 | Top = 50
80 | Width = 41
81 | Height = 13
82 | Caption = 'Caption:'
83 | FocusControl = CaptionEdit
84 | end
85 | object AlignmentLabel: TLabel
86 | Left = 12
87 | Top = 76
88 | Width = 51
89 | Height = 13
90 | Caption = 'Alignment:'
91 | FocusControl = AlignmentCombo
92 | end
93 | object IndexEdit: TEdit
94 | Left = 98
95 | Top = 24
96 | Width = 123
97 | Height = 21
98 | MaxLength = 10
99 | TabOrder = 0
100 | OnChange = EnableApply
101 | OnKeyPress = IndexEditKeyPress
102 | end
103 | object CaptionEdit: TEdit
104 | Left = 98
105 | Top = 50
106 | Width = 123
107 | Height = 21
108 | TabOrder = 1
109 | OnChange = EnableApply
110 | end
111 | object AlignmentCombo: TComboBox
112 | Left = 98
113 | Top = 76
114 | Width = 123
115 | Height = 21
116 | Style = csDropDownList
117 | TabOrder = 2
118 | OnChange = EnableApply
119 | Items.Strings = (
120 | 'Left'
121 | 'Right'
122 | 'Center')
123 | end
124 | object WordWrapCheck: TCheckBox
125 | Left = 98
126 | Top = 108
127 | Width = 123
128 | Height = 17
129 | Caption = 'Word Wrap'
130 | TabOrder = 3
131 | OnClick = EnableApply
132 | end
133 | end
134 | object OKButton: TButton
135 | Left = 279
136 | Top = 288
137 | Width = 75
138 | Height = 25
139 | Caption = 'OK'
140 | Default = True
141 | TabOrder = 2
142 | OnClick = OKButtonClick
143 | end
144 | object CancelButton: TButton
145 | Left = 359
146 | Top = 288
147 | Width = 75
148 | Height = 25
149 | Cancel = True
150 | Caption = 'Cancel'
151 | ModalResult = 2
152 | TabOrder = 3
153 | end
154 | object ApplyButton: TButton
155 | Left = 439
156 | Top = 288
157 | Width = 75
158 | Height = 25
159 | Cancel = True
160 | Caption = 'Apply'
161 | Enabled = False
162 | TabOrder = 4
163 | OnClick = ApplyButtonClick
164 | end
165 | end
166 |
--------------------------------------------------------------------------------
/Source/Ex_GridH.pas:
--------------------------------------------------------------------------------
1 | {
2 | TGridView component (grid)
3 |
4 | (C) Roman M. Mochalov, 1997-2019
5 | E-mail: checker@mail.ru
6 |
7 | License: MIT
8 | }
9 |
10 | unit Ex_GridH;
11 |
12 | interface
13 |
14 | uses
15 | Windows, SysUtils, Classes, Controls, Forms, Graphics, StdCtrls, ComCtrls,
16 | Ex_Grid;
17 |
18 | type
19 | THeaderEditorForm = class(TForm)
20 | SectionssGroup: TGroupBox;
21 | SectionsTree: TTreeView;
22 | AddButton: TButton;
23 | DeleteButton: TButton;
24 | PropertiesGroup: TGroupBox;
25 | IndexLabel: TLabel;
26 | IndexEdit: TEdit;
27 | CaptionLabel: TLabel;
28 | CaptionEdit: TEdit;
29 | AlignmentLabel: TLabel;
30 | AlignmentCombo: TComboBox;
31 | WordWrapCheck: TCheckBox;
32 | OKButton: TButton;
33 | CancelButton: TButton;
34 | ApplyButton: TButton;
35 | procedure EnableApply(Sender: TObject);
36 | procedure DisableApply(Sender: TObject);
37 | procedure FormCreate(Sender: TObject);
38 | procedure FormDestroy(Sender: TObject);
39 | procedure SectionsTreeChange(Sender: TObject; Node: TTreeNode);
40 | procedure SectionsTreeChanging(Sender: TObject; Node: TTreeNode; var AllowChange: Boolean);
41 | procedure SectionsTreeEnter(Sender: TObject);
42 | procedure SectionsTreeKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
43 | procedure AddButtonClick(Sender: TObject);
44 | procedure DeleteButtonClick(Sender: TObject);
45 | procedure IndexEditKeyPress(Sender: TObject; var Key: Char);
46 | procedure OKButtonClick(Sender: TObject);
47 | procedure ApplyButtonClick(Sender: TObject);
48 | private
49 | FGrid: TCustomGridView;
50 | FSections: TGridHeaderSections;
51 | FExceptCount: Integer;
52 | FChangeCount: Integer;
53 | procedure AddSection;
54 | procedure DeleteAllSections;
55 | procedure DeleteSection;
56 | procedure CheckSection;
57 | procedure GetSection;
58 | procedure GetParams;
59 | procedure MoveSectionDown;
60 | procedure MoveSectionLeft;
61 | procedure MoveSectionRight;
62 | procedure MoveSectionUp;
63 | procedure PutSection;
64 | procedure PutParams;
65 | procedure RefreshView;
66 | procedure SelectSection(Section: TGridHeaderSection);
67 | public
68 | function Execute(Grid: TCustomGridView): Boolean;
69 | end;
70 |
71 | function EditGridHeader(Grid: TCustomGridView): Boolean;
72 |
73 | implementation
74 |
75 | {$R *.DFM}
76 |
77 | function EditGridHeader(Grid: TCustomGridView): Boolean;
78 | begin
79 | with THeaderEditorForm.Create(nil) do
80 | try
81 | Execute(Grid);
82 | Result := FChangeCount > 0;
83 | finally
84 | Free;
85 | end;
86 | end;
87 |
88 | type
89 | EHeaderError = class(Exception);
90 |
91 | { THeadersEditorForm }
92 |
93 | procedure THeaderEditorForm.AddSection;
94 | var
95 | S: TGridHeaderSection;
96 | SS: TGridHeaderSections;
97 | begin
98 | with SectionsTree do
99 | if Selected <> nil then
100 | begin
101 | S := TGridHeaderSection(Selected.Data);
102 | if S <> nil then SS := S.Sections else SS := FSections;
103 | SS.Add;
104 | RefreshView;
105 | CaptionEdit.SetFocus;
106 | EnableApply(Self);
107 | end;
108 | end;
109 |
110 | procedure THeaderEditorForm.DeleteAllSections;
111 | const
112 | Message = 'Delete sections?';
113 | Flags = MB_YESNO or MB_ICONQUESTION;
114 | var
115 | S: TGridHeaderSection;
116 | begin
117 | with SectionsTree do
118 | if (Selected <> nil) and (Selected.Data <> nil) then
119 | begin
120 | S := TGridHeaderSection(Selected.Data);
121 | if Application.MessageBox(Message, PChar(Caption), Flags) = IDYES then
122 | begin
123 | S.ParentSections.Clear;
124 | RefreshView;
125 | EnableApply(nil);
126 | end;
127 | end;
128 | end;
129 |
130 | procedure THeaderEditorForm.DeleteSection;
131 | var
132 | S: TGridHeaderSection;
133 | begin
134 | with SectionsTree do
135 | if (Selected <> nil) and (Selected.Data <> nil) then
136 | begin
137 | S := TGridHeaderSection(Selected.Data);
138 | S.Free;
139 | RefreshView;
140 | SetFocus;
141 | EnableApply(nil);
142 | end;
143 | end;
144 |
145 | procedure THeaderEditorForm.CheckSection;
146 | begin
147 | if PropertiesGroup.Enabled then
148 | begin
149 | with IndexEdit do
150 | try
151 | if StrToIntDef(Text, -1) < 0 then
152 | raise EHeaderError.CreateFmt('Invalid index (%s)', [Text]);
153 | except
154 | SetFocus;
155 | raise;
156 | end;
157 | end;
158 | end;
159 |
160 | procedure THeaderEditorForm.GetSection;
161 | var
162 | S: TGridHeaderSection;
163 | begin
164 | with SectionsTree do
165 | if (Selected <> nil) and (Selected.Data <> nil) then
166 | begin
167 | S := TGridHeaderSection(Selected.Data);
168 | IndexEdit.Text := IntToStr(S.Index);
169 | CaptionEdit.Text := S.Caption;
170 | AlignmentCombo.ItemIndex := Ord(S.Alignment);
171 | WordWrapCheck.Checked := S.WordWrap;
172 | end;
173 | end;
174 |
175 | procedure THeaderEditorForm.GetParams;
176 | begin
177 | FSections.Assign(FGrid.Header.Sections);
178 | RefreshView;
179 | end;
180 |
181 | procedure THeaderEditorForm.MoveSectionDown;
182 | var
183 | S: TGridHeaderSection;
184 | begin
185 | with SectionsTree do
186 | if (Selected <> nil) and (Selected.Data <> nil) then
187 | begin
188 | S := TGridHeaderSection(Selected.Data);
189 | if S.Index < S.ParentSections.Count - 1 then
190 | begin
191 | S.Index := S.Index + 1;
192 | RefreshView;
193 | SelectSection(S);
194 | EnableApply(nil);
195 | end;
196 | end;
197 | end;
198 |
199 | procedure THeaderEditorForm.MoveSectionLeft;
200 | var
201 | S, O: TGridHeaderSection;
202 | begin
203 | with SectionsTree do
204 | if (Selected <> nil) and (Selected.Data <> nil) then
205 | begin
206 | S := TGridHeaderSection(Selected.Data);
207 | O := S.ParentSections.OwnerSection;
208 | if (O <> nil) and (O.ParentSections <> nil) then
209 | begin
210 | S.Collection := O.ParentSections;
211 | S.Index := O.Index;
212 | RefreshView;
213 | SelectSection(S);
214 | EnableApply(nil);
215 | end;
216 | end;
217 | end;
218 |
219 | procedure THeaderEditorForm.MoveSectionRight;
220 | var
221 | S: TGridHeaderSection;
222 | begin
223 | with SectionsTree do
224 | if (Selected <> nil) and (Selected.Data <> nil) then
225 | begin
226 | S := TGridHeaderSection(Selected.Data);
227 | if S.Index < S.ParentSections.Count - 1 then
228 | begin
229 | S.Collection := S.ParentSections[S.Index + 1].Sections;
230 | S.Index := 0;
231 | RefreshView;
232 | SelectSection(S);
233 | EnableApply(nil);
234 | end;
235 | end;
236 | end;
237 |
238 | procedure THeaderEditorForm.MoveSectionUp;
239 | var
240 | S: TGridHeaderSection;
241 | begin
242 | with SectionsTree do
243 | if (Selected <> nil) and (Selected.Data <> nil) then
244 | begin
245 | S := TGridHeaderSection(Selected.Data);
246 | if S.Index > 0 then
247 | begin
248 | S.Index := S.Index - 1;
249 | RefreshView;
250 | SelectSection(S);
251 | EnableApply(nil);
252 | end;
253 | end;
254 | end;
255 |
256 | procedure THeaderEditorForm.PutSection;
257 | var
258 | S: TGridHeaderSection;
259 | begin
260 | with SectionsTree do
261 | if (Selected <> nil) and (Selected.Data <> nil) then
262 | begin
263 | S := TGridHeaderSection(Selected.Data);
264 | S.Index := StrToIntDef(IndexEdit.Text, S.Index);
265 | S.Caption := CaptionEdit.Text;
266 | S.Alignment := TAlignment(AlignmentCombo.ItemIndex);
267 | S.WordWrap := WordWrapCheck.Checked;
268 | end;
269 | end;
270 |
271 | procedure THeaderEditorForm.PutParams;
272 | begin
273 | FGrid.Header.Sections := FSections;
274 | end;
275 |
276 | procedure THeaderEditorForm.RefreshView;
277 |
278 | procedure BeginRefresh;
279 | begin
280 | SectionsTree.OnChange := nil;
281 | SectionsTree.OnChanging := nil;
282 | IndexEdit.OnChange := nil;
283 | CaptionEdit.OnChange := nil;
284 | AlignmentCombo.OnChange := nil;
285 | WordWrapCheck.OnClick := nil;
286 | end;
287 |
288 | procedure EndRefresh;
289 | begin
290 | SectionsTree.OnChange := SectionsTreeChange;
291 | SectionsTree.OnChanging := SectionsTreeChanging;
292 | IndexEdit.OnChange := EnableApply;
293 | CaptionEdit.OnChange := EnableApply;
294 | AlignmentCombo.OnChange := EnableApply;
295 | WordWrapCheck.OnClick := EnableApply;
296 | end;
297 |
298 | procedure RefreshTree;
299 |
300 | function CalcColumnIndex(Section: TGridHeaderSection): Integer;
301 | var
302 | Left: TGridHeaderSection;
303 | begin
304 | if Section.Index > 0 then
305 | begin
306 | Left := Section.ParentSections[Section.Index - 1];
307 | Result := CalcColumnIndex(Left);
308 | if Left.Sections.Count > 0 then
309 | Inc(Result, Left.Sections.Count)
310 | else
311 | Inc(Result);
312 | end
313 | else if Section.Parent <> nil then
314 | Result := CalcColumnIndex(Section.Parent)
315 | else
316 | Result := 0;
317 | end;
318 |
319 | procedure ProcessNode(Node: TTreeNode; Sections: TGridHeaderSections);
320 | var
321 | I, J: Integer;
322 | S: string;
323 | begin
324 | if Node.Count > Sections.Count then
325 | begin
326 | I := Node.Count;
327 | while I > Sections.Count do
328 | begin
329 | Dec(I);
330 | Node.Item[I].Delete;
331 | end;
332 | end;
333 | if Node.Count < Sections.Count then
334 | begin
335 | I := Node.Count;
336 | while I < Sections.Count do
337 | begin
338 | Inc(I);
339 | with SectionsTree do
340 | Selected := Items.AddChild(Node, '');
341 | end;
342 | end;
343 | for I := 0 to Node.Count - 1 do
344 | begin
345 | S := Sections[I].Caption;
346 | { bottom level sections use columns captions if they do not have
347 | their own captions (see DisplayText property) but internal
348 | FSections is not linked with grid, so section cannot get column
349 | caption, and we must calculate it manually }
350 | if (Length(S) = 0) and (Sections[I].Sections.Count = 0) then
351 | begin
352 | J := CalcColumnIndex(Sections[I]);
353 | if J < FGrid.Columns.Count then S := FGrid.Columns[J].Caption;
354 | end;
355 | Node.Item[I].Text := S;
356 | Node.Item[I].Data := Sections[I];
357 | end;
358 | for I := 0 to Node.Count - 1 do
359 | ProcessNode(Node.Item[I], Sections[I].Sections);
360 | end;
361 |
362 | begin
363 | ProcessNode(SectionsTree.Items.GetFirstNode, FSections);
364 | end;
365 |
366 | procedure RefreshControls;
367 | begin
368 | with SectionsTree do
369 | if (Selected <> nil) and (Selected.Data <> nil) then
370 | begin
371 | PropertiesGroup.Enabled := True;
372 | DeleteButton.Enabled := True;
373 | GetSection;
374 | end
375 | else
376 | begin
377 | WordWrapcheck.Checked := False;
378 | AlignmentCombo.ItemIndex := -1;
379 | CaptionEdit.Text := '';
380 | IndexEdit.Text := '';
381 | DeleteButton.Enabled := False;
382 | PropertiesGroup.Enabled := False;
383 | end;
384 | end;
385 |
386 | begin
387 | BeginRefresh;
388 | try
389 | RefreshTree;
390 | RefreshControls;
391 | finally
392 | Endrefresh;
393 | end;
394 | end;
395 |
396 | procedure THeaderEditorForm.SelectSection(Section: TGridHeaderSection);
397 |
398 | function FindNode(Node: TTreeNode): TTreeNode;
399 | begin
400 | while Node <> nil do
401 | begin
402 | if Node.Data = Section then
403 | begin
404 | Result := Node;
405 | Exit;
406 | end;
407 | Result := FindNode(Node.GetFirstChild);
408 | if Result <> nil then Exit;
409 | Node := Node.GetNextSibling;
410 | end;
411 | Result := nil;
412 | end;
413 |
414 | begin
415 | SectionsTree.Selected := FindNode(SectionsTree.Items.GetFirstNode);
416 | end;
417 |
418 | function THeaderEditorForm.Execute(Grid: TCustomGridView): Boolean;
419 | begin
420 | FGrid := Grid;
421 | GetParams;
422 | Result := ShowModal = mrOK;
423 | end;
424 |
425 | procedure THeaderEditorForm.EnableApply(Sender: TObject);
426 | begin
427 | OKButton.Default := False;
428 | ApplyButton.Enabled := True;
429 | ApplyButton.Default := True;
430 | end;
431 |
432 | procedure THeaderEditorForm.DisableApply(Sender: TObject);
433 | begin
434 | ApplyButton.Default := False;
435 | ApplyButton.Enabled := False;
436 | OKButton.Default := True;
437 | end;
438 |
439 | procedure THeaderEditorForm.FormCreate(Sender: TObject);
440 | begin
441 | FSections := TGridHeaderSections.Create(nil, nil);
442 | SectionsTree.Items.Add(nil, 'Sections');
443 | end;
444 |
445 | procedure THeaderEditorForm.FormDestroy(Sender: TObject);
446 | begin
447 | FSections.Free;
448 | end;
449 |
450 | procedure THeaderEditorForm.SectionsTreeChange(Sender: TObject; Node: TTreeNode);
451 | begin
452 | if not (csDestroying in ComponentState) then RefreshView;
453 | end;
454 |
455 | procedure THeaderEditorForm.SectionsTreeChanging(Sender: TObject; Node: TTreeNode; var AllowChange: Boolean);
456 | begin
457 | if not (csDestroying in ComponentState) then
458 | begin
459 | try
460 | CheckSection;
461 | PutSection;
462 | RefreshView;
463 | except
464 | if FExceptCount = 0 then Application.HandleException(Self);
465 | Inc(FExceptCount);
466 | end;
467 | AllowChange := FExceptCount = 0;
468 | end;
469 | end;
470 |
471 | procedure THeaderEditorForm.SectionsTreeEnter(Sender: TObject);
472 | begin
473 | FExceptCount := 0;
474 | end;
475 |
476 | procedure THeaderEditorForm.SectionsTreeKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
477 | begin
478 | if Shift = [] then
479 | case Key of
480 | VK_INSERT:
481 | begin
482 | with AddButton do if Enabled then Click;
483 | Key := 0;
484 | end;
485 | VK_DELETE:
486 | begin
487 | with DeleteButton do if Enabled then Click;
488 | Key := 0;
489 | end;
490 | end;
491 | if Shift = [ssCtrl] then
492 | case Key of
493 | VK_DELETE:
494 | begin
495 | DeleteAllSections;
496 | Key := 0;
497 | end;
498 | VK_UP:
499 | begin
500 | CheckSection;
501 | PutSection;
502 | MoveSectionUp;
503 | Key := 0;
504 | end;
505 | VK_DOWN:
506 | begin
507 | CheckSection;
508 | PutSection;
509 | MoveSectionDown;
510 | Key := 0;
511 | end;
512 | VK_LEFT:
513 | begin
514 | CheckSection;
515 | PutSection;
516 | MoveSectionLeft;
517 | Key := 0;
518 | end;
519 | VK_RIGHT:
520 | begin
521 | CheckSection;
522 | PutSection;
523 | MoveSectionRight;
524 | Key := 0;
525 | end;
526 | end;
527 | end;
528 |
529 | procedure THeaderEditorForm.AddButtonClick(Sender: TObject);
530 | begin
531 | CheckSection;
532 | PutSection;
533 | AddSection;
534 | end;
535 |
536 | procedure THeaderEditorForm.DeleteButtonClick(Sender: TObject);
537 | begin
538 | CheckSection;
539 | PutSection;
540 | DeleteSection;
541 | end;
542 |
543 | procedure THeaderEditorForm.IndexEditKeyPress(Sender: TObject; var Key: Char);
544 | begin
545 | if not CharInSet(Key, [#8, '0'..'9']) then
546 | begin
547 | MessageBeep(0);
548 | Key := #0;
549 | end;
550 | end;
551 |
552 | procedure THeaderEditorForm.OKButtonClick(Sender: TObject);
553 | begin
554 | ApplyButtonClick(ApplyButton);
555 | ModalResult := mrOK;
556 | end;
557 |
558 | procedure THeaderEditorForm.ApplyButtonClick(Sender: TObject);
559 | begin
560 | CheckSection;
561 | PutSection;
562 | PutParams;
563 | GetParams;
564 | DisableApply(nil);
565 | Inc(FChangeCount);
566 | end;
567 |
568 | end.
569 |
--------------------------------------------------------------------------------
/Source/Ex_RegGrid.dcr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/checker2/GridView/191ab645e7bda4e678da383b06f52cb1edbb637c/Source/Ex_RegGrid.dcr
--------------------------------------------------------------------------------
/Source/Ex_RegGrid.pas:
--------------------------------------------------------------------------------
1 | {
2 | TGridView component (grid)
3 |
4 | (C) Roman M. Mochalov, 1997-2019
5 | E-mail: checker@mail.ru
6 |
7 | License: MIT
8 | }
9 |
10 | unit Ex_RegGrid;
11 |
12 | interface
13 |
14 | uses
15 | Windows, SysUtils, Classes, Forms, Dialogs, TypInfo, DesignIntf,
16 | DesignEditors, WideStrings;
17 |
18 | type
19 |
20 | { TGridEditor }
21 |
22 | TGridEditor = class(TDefaultEditor)
23 | private
24 | FCollection: TCollection;
25 | procedure FindCollectionEditor(const PropertyEditor: IProperty);
26 | protected
27 | procedure EditProperty(const PropertyEditor: IProperty; var Continue: Boolean); override;
28 | procedure ShowCollectionEditor(ACollection: TCollection);
29 | public
30 | procedure ExecuteVerb(Index: Integer); override;
31 | function GetVerb(Index: Integer): string; override;
32 | function GetVerbCount: Integer; override;
33 | end;
34 |
35 | { TGridColumnsProperty }
36 |
37 | TGridColumnsProperty = class(TClassProperty)
38 | public
39 | procedure Edit; override;
40 | function GetAttributes: TPropertyAttributes; override;
41 | end;
42 |
43 | { TGridHeaderProperty }
44 |
45 | TGridHeaderProperty = class(TClassProperty)
46 | public
47 | procedure Edit; override;
48 | function GetAttributes: TPropertyAttributes; override;
49 | end;
50 |
51 | { TDBGridFieldNameProperty }
52 |
53 | TDBGridFieldNameProperty = class(TStringProperty)
54 | public
55 | function GetAttributes: TPropertyAttributes; override;
56 | procedure GetValues(Proc: TGetStrProc); override;
57 | end;
58 |
59 | procedure Register;
60 |
61 | implementation
62 |
63 | uses
64 | Ex_Grid, Ex_GridC, Ex_GridH, Ex_DBGrid;
65 |
66 | {$R *.dcr}
67 |
68 | { TGridEditor }
69 |
70 | procedure TGridEditor.FindCollectionEditor(const PropertyEditor: IProperty);
71 | var
72 | P: PTypeInfo;
73 | begin
74 | if FCollection <> nil then
75 | begin
76 | P := PropertyEditor.GetPropType;
77 | if (P <> nil) and (P.Kind = tkClass) and (CompareText(string(P.Name), FCollection.ClassName) = 0) then
78 | begin
79 | PropertyEditor.Edit;
80 | FCollection := nil;
81 | end;
82 | end;
83 | { if FContinue then
84 | EditProperty(Prop, FContinue);!!!}
85 | end;
86 |
87 | procedure TGridEditor.EditProperty(const PropertyEditor: IProperty; var Continue: Boolean);
88 | begin
89 | if CompareText(PropertyEditor.GetName, 'ONGETCELLTEXT') = 0 then
90 | begin
91 | PropertyEditor.Edit;
92 | Continue := False;
93 | end;
94 | end;
95 |
96 | procedure TGridEditor.ShowCollectionEditor(ACollection: TCollection);
97 | var
98 | List: IDesignerSelections;
99 | begin
100 | FCollection := ACollection;
101 | List := TDesignerSelections.Create;
102 | List.Add(Self.Component);
103 | GetComponentProperties(List, [tkClass], Self.Designer, FindCollectionEditor);
104 | end;
105 |
106 | procedure TGridEditor.ExecuteVerb(Index: Integer);
107 | begin
108 | case Index of
109 | 0: ShowCollectionEditor(TCustomGridView(Component).Columns);
110 | 1: if EditGridHeader(TCustomGridView(Component)) then Designer.Modified;
111 | end;
112 | end;
113 |
114 | function TGridEditor.GetVerb(Index: Integer): string;
115 | begin
116 | case Index of
117 | 0: Result := 'Columns Editor...';
118 | 1: Result := 'Header Editor...';
119 | end;
120 | end;
121 |
122 | function TGridEditor.GetVerbCount: Integer;
123 | begin
124 | Result := 2;
125 | end;
126 |
127 | { TGridColumnsProperty }
128 |
129 | procedure TGridColumnsProperty.Edit;
130 | begin
131 | if EditGridColumns(TGridColumns(GetOrdValue).Grid) then Modified;
132 | end;
133 |
134 | function TGridColumnsProperty.GetAttributes: TPropertyAttributes;
135 | begin
136 | Result := [paDialog, paReadOnly];
137 | end;
138 |
139 | { TGridHeaderProperty }
140 |
141 | procedure TGridHeaderProperty.Edit;
142 | begin
143 | if EditGridHeader(TGridHeaderSections(GetOrdValue).Header.Grid) then Modified;
144 | end;
145 |
146 | function TGridHeaderProperty.GetAttributes: TPropertyAttributes;
147 | begin
148 | Result := [paDialog, paReadOnly];
149 | end;
150 |
151 | { TDBGridFieldNameProperty }
152 |
153 | function TDBGridFieldNameProperty.GetAttributes: TPropertyAttributes;
154 | begin
155 | Result := [paValueList, paSortList, paMultiSelect];
156 | end;
157 |
158 | procedure TDBGridFieldNameProperty.GetValues(Proc: TGetStrProc);
159 | var
160 | Grid: TCustomDBGridView;
161 | Values: TStringList;
162 | I: Integer;
163 | begin
164 | Grid := TDBGridColumn(GetComponent(0)).Grid;
165 | if (Grid <> nil) and (Grid.DataLink.DataSet <> nil) then
166 | begin
167 | Values := TStringList.Create;
168 | try
169 | Grid.DataLink.DataSet.GetFieldNames(Values);
170 | for I := 0 to Values.Count - 1 do Proc(Values[I]);
171 | finally
172 | Values.Free;
173 | end;
174 | end;
175 | end;
176 |
177 | procedure Register;
178 | begin
179 | RegisterComponents('GridView', [TGridView, TDBGridView]);
180 |
181 | RegisterComponentEditor(TGridView, TGridEditor);
182 | //RegisterPropertyEditor(TypeInfo(TGridColumns), TGridView, 'Columns', TGridColumnsProperty);
183 | //RegisterPropertyEditor(TypeInfo(TGridHeaderSections), TGridHeader, 'Sections', TGridHeaderProperty);
184 |
185 | RegisterComponentEditor(TDBGridView, TGridEditor);
186 | RegisterPropertyEditor(TypeInfo(string), TDBGridColumn, 'FieldName', TDBGridFieldNameProperty);
187 | //RegisterPropertyEditor(TypeInfo(TGridHeaderSections), TDBGridHeader, 'Sections', TGridHeaderProperty);
188 | end;
189 |
190 | end.
191 |
--------------------------------------------------------------------------------