-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchild.pas
74 lines (57 loc) · 1.58 KB
/
child.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
unit child;
{$mode objfpc}{$H+}
interface
uses
LCLIntf, LCLType, Classes, SysUtils, DB, fpcsvexport, Forms, Controls,
Graphics, Dialogs, ExtCtrls, Grids, DBGrids, fpspreadsheetctrls, fpspreadsheetgrid,
fpsallformats, fpstypes, fpspreadsheet, fpsdataset, HtmlView, ZMConnection,
ZMQueryDataSet;
type
{ TFrameTemplate }
{ TMDIChild }
TMDIChild = class(TFrame)
CSVExporter1: TCSVExporter;
CSVExporter2: TCSVExporter;
DataGrid: TDBGrid;
DataSource1: TDataSource;
Dataset1: TsWorksheetDataset;
DataSource2: TDataSource;
HtmlViewer: THtmlViewer;
QueryConnection1: TZMConnection;
QueryDataSet1: TZMQueryDataSet;
Dataset2: TsWorksheetDataset;
QueryConnection2: TZMConnection;
QueryDataSet2: TZMQueryDataSet;
procedure DataGridMouseMove(Sender: TObject; Shift: TShiftState; X, Y: integer);
procedure DataGridTitleClick(Column: TColumn);
private
public
end;
var
MDIChild: TMDIChild;
implementation
uses main;
{$R *.lfm}
{ TMDIChild }
procedure TMDIChild.DataGridMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: integer);
var
pt: TGridCoord;
begin
pt := DataGrid.MouseCoord(x, y);
if pt.y = 0 then
DataGrid.Cursor := crHandPoint
else
DataGrid.Cursor := crDefault;
end;
procedure TMDIChild.DataGridTitleClick(Column: TColumn);
var
i: integer;
begin
with DataGrid do
for i := 0 to Columns.Count - 1 do
Columns[i].Title.Font.Style := Columns[i].Title.Font.Style - [fsBold];
Column.Title.Font.Style := Column.Title.Font.Style + [fsBold];
Dataset1.SortOnFields(Column.Field.FieldName);
end;
end.