-
Notifications
You must be signed in to change notification settings - Fork 38
/
udisplaygrid.pas
executable file
·163 lines (132 loc) · 4.94 KB
/
udisplaygrid.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
unit uDisplayGrid;
{ A new unit added in QuickHash 2.6.3 to better enable the seperate display of
results when copying files from Source to Destination folders. Allows the main
form to contain treeview explorer style charts for source and destination.
SQLite added with v3.0.0 and routines re-written accordingly
}
{$mode objfpc}{$H+} // {$H+} ensures strings are of unlimited size
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
Grids, StdCtrls, Menus, DBGrids, DbCtrls;
type
{ TfrmDisplayGrid1 }
TfrmDisplayGrid1 = class(TForm)
btnClipboardResultsCOPYTAB: TButton;
DBGrid_COPY: TDBGrid;
CopyTabDBNavigator: TDBNavigator;
MenuItem_SaveDBToCSV: TMenuItem;
MenuItem_CopySelectedRowCOPYGRID: TMenuItem;
MenuItem_CopyToClipboard: TMenuItem;
MenuItem_SaveDBToHTML: TMenuItem;
MenuItem_ShowAllCOPYGRID: TMenuItem;
MenuItem_SortByDestinationNameCOPYGRID: TMenuItem;
MenuItem_SortBySourceNameCOPYGRID: TMenuItem;
MenuItem_SortBySourceHashCOPYGRID: TMenuItem;
MenuItem_SortByDestinationHashCOPYGRID: TMenuItem;
frmDisplayGridPopupMenu: TPopupMenu;
frmDisplayGridSaveDialog1: TSaveDialog;
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure btnClipboardResultsCOPYTABClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure MenuItem_SaveDBToCSVClick(Sender: TObject);
procedure MenuItem_CopySelectedRowCOPYGRIDClick(Sender: TObject);
procedure MenuItem_CopyToClipboardClick(Sender: TObject);
procedure MenuItem_SaveDBToHTMLClick(Sender: TObject);
procedure MenuItem_ShowAllCOPYGRIDClick(Sender: TObject);
procedure MenuItem_SortByDestinationHashCOPYGRIDClick(Sender: TObject);
procedure MenuItem_SortByDestinationNameCOPYGRIDClick(Sender: TObject);
procedure MenuItem_SortBySourceHashCOPYGRIDClick(Sender: TObject);
procedure MenuItem_SortBySourceNameCOPYGRIDClick(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
frmDisplayGrid1: TfrmDisplayGrid1;
implementation
{$R *.lfm}
uses
// New as of v3.0.0
dbases_sqlite;
{ TfrmDisplayGrid1 }
procedure TfrmDisplayGrid1.FormClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
DBGrid_COPY.Clear
end;
procedure TfrmDisplayGrid1.btnClipboardResultsCOPYTABClick(Sender: TObject);
begin
frmSQLiteDBases.DatasetToClipBoardCOPYTAB(DBGrid_COPY);
end;
procedure TfrmDisplayGrid1.FormCreate(Sender: TObject);
begin
end;
procedure TfrmDisplayGrid1.MenuItem_CopySelectedRowCOPYGRIDClick(Sender: TObject);
begin
frmSQLiteDBases.CopySelectedRowCOPYTAB(DBGrid_COPY);
end;
procedure TfrmDisplayGrid1.MenuItem_CopyToClipboardClick(Sender: TObject);
begin
frmSQLiteDBases.DatasetToClipBoardCOPYTAB(DBGrid_COPY);
end;
// Save the COPY Window results pane to HTML File
procedure TfrmDisplayGrid1.MenuItem_SaveDBToHTMLClick(Sender: TObject);
var
ExportFilename : string;
begin
ExportFilename := '';
frmDisplayGridSaveDialog1.Title := 'Save results as...';
frmDisplayGridSaveDialog1.InitialDir := GetCurrentDir;
frmDisplayGridSaveDialog1.Filter := 'Web Page|*.html';
frmDisplayGridSaveDialog1.DefaultExt := 'HTML';
if frmDisplayGridSaveDialog1.Execute then
begin
ExportFilename := frmDisplayGridSaveDialog1.FileName;
frmSQLiteDBases.SaveCOPYWindowToHTML(DBGrid_COPY, ExportFilename);
end;
end;
// Save the COPY Window results pane to CSV File
procedure TfrmDisplayGrid1.MenuItem_SaveDBToCSVClick(Sender: TObject);
var
ExportFilename : string;
begin
ExportFilename := '';
frmDisplayGridSaveDialog1.Title := 'Save results as...';
frmDisplayGridSaveDialog1.InitialDir := GetCurrentDir;
frmDisplayGridSaveDialog1.Filter := 'Comma Sep|*.csv';
frmDisplayGridSaveDialog1.DefaultExt := 'csv';
if frmDisplayGridSaveDialog1.Execute then
begin
ExportFilename := frmDisplayGridSaveDialog1.FileName;
frmSQLiteDBases.SaveCopyDBToCSV(DBGrid_COPY, ExportFilename);
end;
end;
procedure TfrmDisplayGrid1.MenuItem_ShowAllCOPYGRIDClick(Sender: TObject);
begin
DBGrid_COPY.Clear;
frmSQLiteDBases.ShowAllCOPYGRID(DBGrid_COPY);
end;
procedure TfrmDisplayGrid1.MenuItem_SortByDestinationHashCOPYGRIDClick(Sender: TObject);
begin
DBGrid_COPY.Clear;
frmSQLiteDBases.SortByDestinationHash(DBGrid_COPY);
end;
procedure TfrmDisplayGrid1.MenuItem_SortBySourceHashCOPYGRIDClick(Sender: TObject);
begin
DBGrid_COPY.Clear;
frmSQLiteDBases.SortBySourceHash(DBGrid_COPY);
end;
procedure TfrmDisplayGrid1.MenuItem_SortBySourceNameCOPYGRIDClick(Sender: TObject);
begin
DBGrid_COPY.Clear;
frmSQLiteDBases.SortBySourceFilename(DBGrid_COPY);
end;
procedure TfrmDisplayGrid1.MenuItem_SortByDestinationNameCOPYGRIDClick(Sender: TObject);
begin
DBGrid_COPY.Clear;
frmSQLiteDBases.SortByDestinationFilename(DBGrid_COPY);
end;
initialization
end.