Menu

[r111]: / trunk / Docs / Design / Design.html  Maximize  Restore  History

Download this file

586 lines (537 with data), 16.9 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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>
DelphiDabbler.com: CodeSnip Design Notes
</title>
<style type="text/css">
<!--
html {
font-family: Verdana, Arial, mono;
font-size: 9pt;
}
.heading {
font-size: 15pt;
font-weight: bold;
padding: 6px;
border: 1px silver solid;
margin-top: 0px;
margin-bottom: 12px;
text-align: center;
background-color: #EEEEEE;
}
h1 {
font-size: 15pt;
font-weight: bold;
}
h2 {
font-size: 13pt;
font-weight: bold;
}
h3 {
font-size: 11pt;
font-weight: bold;
}
h4 {
font-size: 9pt;
font-weight: bold;
}
p {
margin-top: 12px;
margin-bottom: 12px;
}
ul, ol {
padding: 0;
margin-top: 1em;
margin-bottom: 1em;
margin-left: 3em;;
}
li.spaced {
margin-top: 8px;
}
table.gui {
background-color: silver;
}
td.gui, th.gui {
background-color: white;
}
div.copyright,
div.copyright a:link,
div.copyright a:visited,
div.copyright a:active {
margin: 0px;
margin-top: 4px;
font-size: 8pt;
text-align: right;
color: silver;
}
.delphi {
color: blue;
}
.lib {
color: red;
}
-->
</style>
</head>
<body>
<div class="heading">CodeSnip Design Notes</div>
<h1>GUI</h1>
<p>The GUI is represented schematically below:</p>
<table class="gui" cellspacing="2" cellpadding="0" width="100%">
<tr>
<td class="gui"
style="background-color: #CCCCFF; vertical-align: top;">
<div style="text-align: center; padding: 4px;">
<strong>Main Menu / Main Toolbar</strong>
</div>
</td>
</tr>
<tr>
<td class="gui"
style="background-color: #FFCCCC; vertical-align: top;">
<div style="text-align: center; padding: 4px;">
<strong>Main Display</strong>
</div>
<div style="padding: 4px;">
<table class="gui" cellspacing="2" cellpadding="0" width="100%">
<tr>
<td class="gui" height="30px;" width="20%"
style="background-color: #FFFFCC; vertical-align: top;">
<div style="padding: 4px; text-align: center;">
<strong>Overview Pane</strong>
</div>
<div style="padding: 4px; text-align: left;">
Displays an overview of the routines available in the code
snip database. Contains 2 views:<br />
(1) that lists all routines uncategorised<br />
(2) that groups routines in categories.
</div>
</td>
<td class="gui"
style="background-color: #BBFFBB; vertical-align: top;">
<div style="text-align: center; padding: 4px;">
<strong>Details Pane</strong>
</div>
<div style="text-align: center; padding: 4px;">
Determines which if two detail panes is displayed: either a
Detail pane or a Compiler pane. One of the two panes below
is displayed:
</div>
<div style="padding: 4px;">
<table class="gui" cellspacing="2" cellpadding="2"
width="100%" style="background-color: #CCFFCC;">
<tr>
<td width="50%"
style="background-color: #DDFFCC; vertical-align: top;" >
<div style="text-align: center; padding: 4px;">
<strong>Information Pane</strong>
</div>
<div style="text-align: left; padding: 4px;">
Displays detail of currently selected item which can
be one of
</div>
<ul style="margin-top: 0px; margin-left: 20px; padding: 4px;">
<li>A routine: displays info about the routine.</li>
<li>A category: displays list of routines in
category.</li>
<li>Header of uncategorised display: displays list
of all routines with descriptions</li>
<li>Welcome page.</li>
</ul>
</td>
<td width="50%"
style="background-color: #CCFFDD; vertical-align: top;" >
<div style="padding: 4px; text-align: center;">
<strong>Compile Pane</strong>
</div>
<div style="padding: 4px; text-align: left;">
Displays a page where a routine can be test
compiled in one of installed versions of
Delphi, or displays welcome page. If
currently selected item is not a routine
and not displaying welcome page this page
carries a message saying to select a
routine.
</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td class="gui"
style="background-color: #FFCCAA; vertical-align: top;">
<div style="text-align: center; padding: 4px;">
<strong>Status Bar</strong>
</div>
</td>
</tr>
</table>
<p>The GUI is divided conceptually into <em>command</em> and <em>display</em>
subsystems. The <em>command</em> subsystem manages user input and the
<em>display</em> subsytem handles output.</p>
<p>Each of the GUI components noted above takes some responsibility for
processing commands and displaying data as described below.</p>
<table class="gui" width="100%" cellspacing="1" cellpadding="4">
<tr>
<td width="20%" style="background-color: #CCCCFF;">
<strong>Main Menu / Main Toolbar</strong>
</td>
<td width="80%" class="gui">
<div style="margin-bottom: 4px;"><em>Display:</em>
Most menu items and toolbar items have no specific objects used to
manipulate the way they display. However, some, like the forward
and backward navigation controls are managed by manager object.</div>
<div><em>Commands:</em>
Each menu item and toolbar item has an associated action that is
handled by event handlers in the main form (see below) or by custom
actions.</div>
</td>
</tr>
<tr>
<td width="20%" style="background-color: #FFCCCC;">
<strong>Main Display</strong>
</td>
<td width="80%" class="gui">
<div style="margin-bottom: 4px;"><em>Display:</em>
The main display is managed by a
master object that implements some of the high level display
logic. It hands detailed display duties over to other display
objects (below).</div>
<div style="margin-bottom: 4px;"><em>Commands:</em>
This object has no command duties: it simply reports changes of
display to the owner object (main form).</div>
</td>
</tr>
<tr>
<td width="20%" style="background-color: #FFFFCC;">
<strong>Overview Pane</strong>
</td>
<td width="80%" class="gui">
<div style="margin-bottom: 4px;"><em>Display:</em>
Manages the overview routine list (treeview) and the overview
tabs (tab set). Clicking a tab causes a change of display format
(either uncategorised or categorised). All the controls in this view
are encapsulated in a frame. Can be instructed by the Main Display
object to highlight a particular item.</div>
<div><em>Commands:</em>
Selecting a item in the treeview initiates a display command - this
triggers an action in the main form which is passed on to the Main
Display object for implementation. Note that clicking a tab is not
reported as a command since this has an impact only within the pane
and does not change the view elsewhere in the display.</div>
</td>
</tr>
<tr>
<td width="20%" style="background-color: #BBFFBB;">
<strong>Details Pane</strong>
</td>
<td width="80%" class="gui">
<div style="margin-bottom: 4px;"><em>Display:</em>
Has a manager object that simply selects a new tab when
instructed by the Main Display object. This pane is implemented
within a frame that contains a page control that contains other
frames that hold the controls needed by each different detail
view.
</div>
<div><em>Commands:</em>
Triggers an action when a tab control is clicked that is handled
in the main form. The main form instructs the Main Display
object to change the detail view accordingly.
</div>
</td>
</tr>
<tr>
<td width="20%" style="background-color: #DDFFCC;">
<strong>Information Pane</strong>
</td>
<td width="80%" class="gui">
<div style="margin-bottom: 4px;"><em>Display:</em>
This detail display is managed by an object that displays the
current selected view item in a web browser control. This
manager object creates the require HTML. The pane is implemented
in a frame.
</div>
<div><em>Commands:</em>
Some view items display links in the web browser that, when
clicked, perform some action. This is handled by a command
object that both implements the web browser's
&quot;external&quot; object and triggers the appropriate action.
The action is managed by the main form which calls on the
appropropriate object to implement it.
</div>
</td>
</tr>
<tr>
<td width="20%" style="background-color: #CCFFDD;">
<strong>Compile Pane</strong>
</td>
<td width="80%" class="gui">
<div style="margin-bottom: 4px;"><em>Display:</em>
Displays current compiler details to the user and provides
controls that can be used to test-compile a selected unit.
If the currently selected view item is not a routine this area
displays a message to that effect and hides controls.
</div>
<div><em>Commands:</em>
Each control in this area is associated with an action that is
handled by the main form which in turn calls the appropriate
object to handle the action.
</div>
</td>
</tr>
<tr>
<td width="20%" style="background-color: #FFCCAA;">
<strong>Status Bar</strong>
</td>
<td width="80%" class="gui">
<div style="margin-bottom: 4px;"><em>Display:</em>
Displays status information. Updated via action objects.
</div>
<div><em>Commands:</em>
No commands issued.
</div>
</td>
</tr>
<tr>
<td width="25%" class="gui">
<strong>Main Form</strong>
</td>
<td width="80%" class="gui">
<div style="margin-bottom: 4px;"><em>Display:</em>
Handles the display of GUI widgets that do not form part of the
main display - e.g. the splitter bar, the size and location of
the main window etc. Any &quot;commands&quot; that are purely
concerned with main display items are not necessarily handled
by actions but may use event handlers. Several helper objects
are created and maintained by the main form.
</div>
<div><em>Commands:</em>
All commands issued by other GUI components as actions are
handled by the main form. Top level logic is handled here to
convert the action request into a form that can be handled by
some other display or other object. Some simple, none display
related actions may be entirely implemented in the main form.
</div>
</td>
</tr>
</table>
<h1>Handling GUI Events</h1>
<p>There are several ways in which the user can intiate events in the GUI:</p>
<ul>
<li>Menu items</li>
<li>Tool buttons</li>
<li>Tab sets in overview and detail panes</li>
<li>Changing selection in tree view</li>
<li>Clicking links in web browser controls</li>
</ul>
<p>All possible GUI events ultimately result in an Action being triggered. The
following schematic shows how CodeSnip responds to events in the GUI and causes
actions to be triggered:</p>
<p style="text-align: center;">
<img src="GUIEvents.gif" width="456" height="178" border=0" />
</p>
<p>Triggering actions is quite straightforward in the case of menu items and
tool buttons. They have actions associated with them at design time that are
automatically triggered when the menu item or toolbutton is clicked.</p>
<p>For tabs (TTabSet and TPageControl) and the tree view this is not so
straightforward since appropriate actions can't be directly associated. Instead
events in these controls are handled by event handlers, which ultimately call
a method of the &quot;notifier&quot; object (described later).</p>
<p>The web browser controls can also trigger GUI events as a result of the user
clicking links or pressing buttons in HTML forms. The web browser's DOM provides
an &quot;external&quot; object that can be used to transmit these events to the
main application. We define an object that extends the &quot;external&quot;
object with methods that can be called from within the browser. The
&quot;external&quot; object calls methods of the notifier object in response to
these events.</p>
<p>The notifier object has knowledge of various Action objects that can be
triggered when the notifier's methods are called. Some of these actions are
simple actions, some are standard actions and others are custom actions defined
in CodeSnip. The notifier object therefore provides a means for objects that
can't natively trigger actions to cause actions to be triggered.</p>
<p>Most actions are handled in OnExecute event handlers in the main form. Some
of these simply manipulate some values and then cause a further action to be
triggered via the Notifier object. Most lead to the main form implementing the
action, either directly or via subsidiary objects. A few standard and custom
actions lead directly to the requested command being carried out.</p>
<h1>Class Heirachies</h1>
<h2>Frames</h2>
<pre><span class="delphi">[TFrame]</span>
|
+-- TBrowserBaseFrame
| |
| +-- TDetailViewFrame
| | |
| | +-- TCompCheckFrame
| | |
| | +-- TInfoFrame
| |
| +-- THTMLDlgFrame
| | |
| | +-- TFixedHTMLDlgFrame
| | |
| | +-- THTMLTpltDlgFrame
| |
| +-- THTMLPreviewFrame
| |
| +-- TNewsHTMLFrame
|
+-- TCheckedTVFrame
| |
| +-- TSelectSnippetsFrame
| |
| +-- TSelectUserSnippetsFrame
|
+-- TMemoPreviewFrame
| |
| +-- TRTFPreviewFrame
| |
| +-- TTextPreviewFrame
|
+-- TNewsFrame
|
+-- TPrefsBaseFrame
| |
| +-- TGeneralPrefsFrame
| |
| +-- THiliterPrefsFrame
| |
| +-- TPrintingPrefsFrame
| |
| +-- TSourcePrefsFrame
|
+-- TRTFShowCaseFrame
|
+-- TTitledFrame
|
+-- TDetailFrame
|
+-- TOverviewFrame</pre>
<h2>Forms</h2>
<pre><span class="delphi">[TForm]</span>
|
+-- TBaseForm
|
+-- THelpAwareForm
| |
| +-- TGenericDlg
| | |
| | +-- TGenericOKDlg
| | | |
| | | +-- TCodeExportDlg
| | | |
| | | +-- TCompilersDlg
| | | |
| | | +-- TEditTextDlg
| | | |
| | | +-- TFindCompilerDlg
| | | |
| | | +-- TFindTextDlg
| | | |
| | | +-- TFindXRefsDlg
| | | |
| | | +-- TPreferencesDlg
| | | |
| | | +-- TPrintDlg
| | | |
| | | +-- TSelectionSearchDlg
| | | |
| | | +-- TUserDBEditDlg
| | |
| | +-- TGenericViewDlg
| | | |
| | | +-- THTMLViewDlg
| | | | |
| | | | +-- TAboutDlg
| | | | |
| | | | +-- TCompErrorDlg
| | | |
| | | +-- TPreviewDlg
| | | |
| | | +-- TUpdateDlg
| | |
| | +-- TMailingListDlg
| | |
| | +-- TWizardDlg
| | |
| | +-- TBugReportDlg
| | |
| | +-- TCodeSubmitDlg
| | |
| | +-- TRegistrationDlg
| |
| +-- TMainForm
|
+-- TSplashForm
|
+-- TWaitDlg</pre>
<h2>Common Dialogs</h2>
<pre><span class="delphi">[TCommonDialog]</span>
|
+-- <span class="delphi">[TColorDialog]</span>
| |
| +-- TColorDialogEx
|
+-- <span class="delphi">[TOpenDialog]</span>
| |
| +-- <span class="delphi">[TSaveDialog]</span>
| | |
| | +-- TSaveDialogEx
| | |
| | +-- TSaveSourceDlg
| |
| +-- TOpenDialogEx
|
+-- <span class="delphi">[TPageSetupDialog]</span>
|
+-- TPageSetupDialogEx
</pre>
<h2>Actions</h2>
<pre><span class="delphi">[TBasicAction]</span>
|
+-- <span class="delphi">[TContainedAction]</span>
| |
| +-- <span class="delphi">[TCustomAction]</span>
| |
| +-- TLinkAction
|
+-- TCompLogAction
|
+-- TEditRoutineAction
|
+-- TRoutineAction
|
+-- TTestCompileAction
|
+-- TViewItemAction</pre>
<h2>Menus and Menu items</h2>
<pre><span class="delphi">[TPopupMenu]</span>
|
+-- TAbstractWBPopupMenu
| |
| +-- TWBNulPopupMenu
| |
| +-- TWBPopupMenu
| |
| +-- TWBDefaultPopupMenu
|
+-- THistoryMenu
|
+-- TBackHistoryMenu
|
+-- TForwardHistoryMenu</pre>
<pre><span class="delphi">[TMenuItem]</span>
|
+-- THistoryMenuItem
|
+-- TWBTempMenuItem</pre>
</body>
</html>
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.