forked from delphidabbler/vied
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFmViewList.pas
71 lines (59 loc) · 1.77 KB
/
FmViewList.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
{
* 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) 1998-2014, Peter Johnson (www.delphidabbler.com).
*
* Dialogue box used to display (but not edit) string lists. Used to display
* resource file info and error messages.
}
unit FmViewList;
interface
uses
// Delphi
StdCtrls, Controls, ExtCtrls, Classes,
// Project
FmGenericViewDlg;
type
{
TViewListDlg:
Class implementing a dialog box that permits display of string lists. Used
to display resource file info and error messages.
}
TViewListDlg = class(TGenericViewDlg)
lblList: TLabel;
edList: TMemo;
procedure FormShow(Sender: TObject);
private // properties
fDescription: string;
fTitle: string;
procedure SetList(const Value: TStringList);
public
property HelpTopic;
{Redeclared to make public}
property List: TStringList write SetList;
{The list to display in dialog's memo control}
property Title: string write fTitle;
{The title of the dialog box window}
property Description: string write fDescription;
{The description of the contents of the memo to appear above memo}
end;
implementation
{$R *.DFM}
{ TViewListDlg }
procedure TViewListDlg.FormShow(Sender: TObject);
{Event handler called when form is shown: intialises controls}
begin
inherited;
// Set caption per Title property
Caption := fTitle;
// Set label text per Description property}
lblList.Caption := fDescription;
end;
procedure TViewListDlg.SetList(const Value: TStringList);
{Write access method for List property: copies list into memo control}
begin
edList.Lines.Assign(Value);
end;
end.