1 | Unit InformationFormUnit;
|
---|
2 |
|
---|
3 | // NewView - a new OS/2 Help Viewer
|
---|
4 | // Copyright 2003 Aaron Lawrence (aaronl at consultant dot com)
|
---|
5 | // This software is released under the Gnu Public License - see readme.txt
|
---|
6 |
|
---|
7 | Interface
|
---|
8 |
|
---|
9 | Uses
|
---|
10 | Classes, Forms, Graphics, StdCtrls, Buttons,
|
---|
11 | ACLLanguageUnit;
|
---|
12 |
|
---|
13 | Type
|
---|
14 | TInformationForm = Class (TForm)
|
---|
15 | InformationMemo: TMemo;
|
---|
16 | OKButton: TButton;
|
---|
17 | Procedure InformationFormOnSetupShow (Sender: TObject);
|
---|
18 | Procedure InformationFormOnShow (Sender: TObject);
|
---|
19 | Procedure InformationFormOnCreate (Sender: TObject);
|
---|
20 | Private
|
---|
21 | {Insert private declarations here}
|
---|
22 | Public
|
---|
23 | FText: pchar; // for messages with long lines
|
---|
24 | Procedure OnLanguageEvent( Language: TLanguageFile;
|
---|
25 | const Apply: boolean );
|
---|
26 | End;
|
---|
27 |
|
---|
28 | Var
|
---|
29 | InformationForm: TInformationForm;
|
---|
30 |
|
---|
31 | Implementation
|
---|
32 |
|
---|
33 | Uses
|
---|
34 | ControlsUtility;
|
---|
35 |
|
---|
36 | Procedure TInformationForm.InformationFormOnSetupShow (Sender: TObject);
|
---|
37 | Begin
|
---|
38 | ScaleForm( self, 11, 16 );
|
---|
39 |
|
---|
40 | InformationMemo.XStretch := xsFrame;
|
---|
41 | InformationMemo.YStretch := ysFrame;
|
---|
42 | End;
|
---|
43 |
|
---|
44 | Procedure TInformationForm.InformationFormOnShow (Sender: TObject);
|
---|
45 | Begin
|
---|
46 | if FText <> nil then
|
---|
47 | InformationMemo.Lines.SetText( FText );
|
---|
48 | FText := nil;
|
---|
49 | End;
|
---|
50 |
|
---|
51 | Procedure TInformationForm.InformationFormOnCreate (Sender: TObject);
|
---|
52 | Begin
|
---|
53 | RegisterForLanguages( OnLanguageEvent );
|
---|
54 | End;
|
---|
55 |
|
---|
56 | Procedure TInformationForm.OnLanguageEvent( Language: TLanguageFile;
|
---|
57 | const Apply: boolean );
|
---|
58 | begin
|
---|
59 | Language.LoadComponentLanguage( self, Apply );
|
---|
60 | end;
|
---|
61 |
|
---|
62 | Initialization
|
---|
63 | RegisterClasses ([TInformationForm, TMemo, TButton]);
|
---|
64 | End.
|
---|