Menu

[r3207]: / trunk / Src / UDialogMgr.pas  Maximize  Restore  History

Download this file

296 lines (238 with data), 10.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
{
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/
*
* Copyright (C) 2007-2013, Peter Johnson (www.delphidabbler.com).
*
* $Rev$
* $Date$
*
* Implements class that manages the display of dialog boxes.
}
unit UDialogMgr;
interface
uses
// Delphi
Classes,
// Project
DB.USnippet, UCompileMgr, USearch;
type
/// <summary>Manages the display of various dialogue boxes.</summary>
/// <remarks>Any window handle associated with the Owner component passed to
/// the inherited constructor is used as the parent window of the dialogue
/// boxes.</remarks>
TDialogMgr = class(TComponent)
public
/// <summary>Displays the About dialogue box.</summary>
procedure ShowAboutDlg;
/// <summary>Displays the Bug Report dialogue box.</summary>
procedure ShowBugReportDlg;
/// <summary>Displays the Find Compiler dialogue box.</summary>
/// <param name="ASearch">ISearch [out] Set to object containing search
/// details. Undefined if user cancelled dialogue.</param>
/// <param name="RefineExisting">Boolean [out] Set to flag indicating if
/// any existing search is to be refined (True) or if this search is to
/// apply to whole database. Undefined if user cancelled dialogue.</param>
/// <returns>Boolean. True if user OKd dialogue or False if user cancelled.
/// </returns>
function ExecFindCompilerDlg(out ASearch: ISearch;
out RefineExisting: Boolean): Boolean;
/// <summary>Displays the Find Text dialogue box.</summary>
/// <param name="ASearch">ISearch [out] Set to object containing search
/// details. Undefined if user cancelled dialogue.</param>
/// <param name="RefineExisting">Boolean [out] Set to flag indicating if
/// any existing search is to be refined (True) or if this search is to
/// apply to whole database. Undefined if user cancelled dialogue.</param>
/// <returns>Boolean. True if user OKd dialogue or False if user cancelled.
/// </returns>
function ExecFindTextDlg(out ASearch: ISearch; out RefineExisting: Boolean):
Boolean;
/// <summary>Displays Find Cross References dialogue box.</summary>
/// <param name="ASnippet">TSnippet [in] Snippet for which cross-references
/// are required.</param>
/// <param name="ASearch">ISearch [out] Set to object containing search
/// details. Undefined if user cancelled dialogue.</param>
/// <returns>Boolean. True if user OKd dialogue or False if user cancelled.
/// </returns>
function ExecFindXRefsDlg(const ASnippet: TSnippet;
out ASearch: ISearch): Boolean;
/// <summary>Displays Preferences dialogue box showing all tabs.</summary>
/// <param name="UpdateUI">Boolean [out] Flag that indicates if the UI
/// needs to be updated as a result of changes to preferences.</param>
/// <returns>Boolean. True if user OKd dialogue or False if user cancelled.
/// </returns>
function ExecPreferencesDlg(out UpdateUI: Boolean): Boolean; overload;
/// <summary>Displays Preference dialogue box showing a single tab.
/// </summary>
/// <param name="PageClassName">string [in] Class name of frame that
/// implements the content of the tab this is to be displayed.</param>
/// <param name="UpdateUI">Boolean [out] Flag that indicates if the UI
/// needs to be updated as a result of changes to preferences.</param>
/// <returns>Boolean. True if user OKd dialogue or False if user cancelled.
/// </returns>
function ExecPreferencesDlg(const PageClassName: string;
out UpdateUI: Boolean): Boolean; overload;
/// <summary>Displays Registration dialogue box.</summary>
/// <returns>Boolean. True if user OKd dialogue or False if user cancelled.
/// </returns>
function ExecRegistrationDlg: Boolean;
/// <summary>Displays Select Snippets dialogue box.</summary>
/// <param name="SelectedSnippets">TSnippetList [in] List of pre-selected
/// snippets.</param>
/// <param name="ASearch">ISearch [out] Set to object containing search
/// details. Undefined if user cancelled dialogue.</param>
/// <returns>Boolean. True if user OKd dialogue or False if user cancelled.
/// </returns>
function ExecSelectionSearchDlg(const SelectedSnippets: TSnippetList;
out ASearch: ISearch): Boolean;
/// <summary>Displays Update From Web dialogue box used to update the local
/// copy of the online database.</summary>
/// <returns>Boolean. True if the database was updated successfully or
/// False if the local database is up to date, if the update failed or if
/// the user cancelled.</returns>
function ExecDBUpdateDlg: Boolean;
/// <summary>Displays the Print dialogue box.</summary>
/// <returns>Boolean. True if user OKd dialogue or False if user cancelled.
/// </returns>
function ExecPrintDlg: Boolean;
/// <summary>Displays the Page Setup dialogue box.</summary>
/// <returns>Boolean. True if user OKd dialogue or False if user cancelled.
/// </returns>
function ExecPageSetupDlg: Boolean;
/// <summary>Displays the Donate dialogue box.</summary>
procedure ShowDonateDlg;
/// <summary>Displays the Test Unit dialogue box.</summary>
/// <param name="Snippet">TSnippet [in] Snippet for which test unit is to
/// be generated.</param>
procedure ShowTestUnitDlg(const Snippet: TSnippet);
/// <summary>Shows Dependencies dialogue box.</summary>
/// <param name="Snippet">TSnippets [in] Snippet for which dependencies are
/// to be displayed.</param>
/// <param name="HelpKeyword">string [in] Keyword of help topic to be
/// associated with the dialogue box.</param>
/// <returns>ISearch. Search containing details of any snippets to be
/// selected when the dialogue box closes. May be nil if no search is to be
/// performed.</returns>
function ShowDependenciesDlg(const Snippet: TSnippet;
const HelpKeyword: string): ISearch;
/// <summary>Displays the Proxy Server configuration dialogue box.
/// </summary>
/// <returns>Boolean. True if user OKd dialogue or False if user cancelled.
/// </returns>
function ExecProxyServerDlg: Boolean;
/// <summary>Displays the News dialogue box.</summary>
procedure ShowNewsDlg;
/// <summary>Displays the Test Compile dialogue box.</summary>
/// <param name="CompileMgr">TCompileMgr [in] Object used to manage test
/// compilation and to retain results.</param>
/// <param name="Snippet">TSnippet [in] Snippet to be test compiled.
/// </param>
procedure ShowTestCompileDlg(const CompileMgr: TCompileMgr;
const Snippet: TSnippet);
/// <summary>Displays the Check For Program Updates dialogue box.</summary>
procedure ShowProgramUpdatesDlg;
/// <summary>Displays the SWAG Import Wizard dialogue box.</summary>
procedure ShowSWAGImportDlg;
end;
implementation
uses
// Delphi
Forms,
// Project
FmAboutDlg, FmDBUpdateDlg, FmDependenciesDlg, FmDonateDlg, FmFindCompilerDlg,
FmFindTextDlg, FmFindXRefsDlg, FmNewsDlg, FmPreferencesDlg, FmPrintDlg,
FmProgramUpdatesDlg, FmProxyServerDlg, FmRegistrationDlg,
FmSelectionSearchDlg, FmSWAGImportDlg, FmTestCompileDlg, FmUserBugReportDlg,
UPageSetupDlgMgr, UTestUnitDlgMgr;
{ TDialogMgr }
function TDialogMgr.ExecDBUpdateDlg: Boolean;
begin
Result := TDBUpdateDlg.Execute(Owner);
end;
function TDialogMgr.ExecFindCompilerDlg(out ASearch: ISearch;
out RefineExisting: Boolean): Boolean;
begin
Result := TFindCompilerDlg.Execute(Owner, ASearch, RefineExisting);
end;
function TDialogMgr.ExecFindTextDlg(out ASearch: ISearch;
out RefineExisting: Boolean): Boolean;
begin
Result := TFindTextDlg.Execute(Owner, ASearch, RefineExisting);
end;
function TDialogMgr.ExecFindXRefsDlg(const ASnippet: TSnippet;
out ASearch: ISearch): Boolean;
begin
Result := TFindXRefsDlg.Execute(Owner, ASnippet, ASearch);
end;
function TDialogMgr.ExecPageSetupDlg: Boolean;
begin
Result := TPageSetupDlgMgr.Execute(Owner);
end;
function TDialogMgr.ExecPreferencesDlg(out UpdateUI: Boolean): Boolean;
begin
Result := TPreferencesDlg.Execute(Owner, UpdateUI);
end;
function TDialogMgr.ExecPreferencesDlg(const PageClassName: string;
out UpdateUI: Boolean): Boolean;
begin
Result := TPreferencesDlg.Execute(Owner, PageClassName, UpdateUI);
end;
function TDialogMgr.ExecPrintDlg: Boolean;
begin
Result := TPrintDlg.Execute(Owner);
end;
function TDialogMgr.ExecProxyServerDlg: Boolean;
begin
Result := TProxyServerDlg.Execute(Owner);
end;
function TDialogMgr.ExecRegistrationDlg: Boolean;
begin
Result := TRegistrationDlg.Execute(Owner);
end;
function TDialogMgr.ExecSelectionSearchDlg(
const SelectedSnippets: TSnippetList; out ASearch: ISearch): Boolean;
begin
Result := TSelectionSearchDlg.Execute(Owner, SelectedSnippets, ASearch);
end;
procedure TDialogMgr.ShowAboutDlg;
begin
TAboutDlg.Execute(Owner);
end;
procedure TDialogMgr.ShowBugReportDlg;
begin
TUserBugReportDlg.Execute(Owner);
end;
function TDialogMgr.ShowDependenciesDlg(const Snippet: TSnippet;
const HelpKeyword: string): ISearch;
begin
Result := TDependenciesDlg.Execute(
Owner, Snippet, [tiDependsUpon, tiRequiredBy], True, HelpKeyword
);
end;
procedure TDialogMgr.ShowDonateDlg;
begin
TDonateDlg.Execute(Owner);
end;
procedure TDialogMgr.ShowNewsDlg;
begin
TNewsDlg.Execute(Owner);
end;
procedure TDialogMgr.ShowProgramUpdatesDlg;
begin
TProgramUpdatesDlg.Execute(Owner);
end;
procedure TDialogMgr.ShowSWAGImportDlg;
begin
TSWAGImportDlg.Execute(Owner);
end;
procedure TDialogMgr.ShowTestCompileDlg(const CompileMgr: TCompileMgr;
const Snippet: TSnippet);
begin
TTestCompileDlg.Execute(Owner, CompileMgr, Snippet);
end;
procedure TDialogMgr.ShowTestUnitDlg(const Snippet: TSnippet);
begin
TTestUnitDlgMgr.DisplayTestUnit(Owner, Snippet);
end;
end.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.