source: branches/2.20_branch/NewView/InformationFormUnit.pas

Last change on this file was 228, checked in by RBRi, 18 years ago

refactoring for language handling

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1Unit 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
7Interface
8
9Uses
10 Classes,
11 Forms,
12 StdCtrls,
13 Buttons,
14 ACLLanguageUnit;
15
16Type
17 TInformationForm = Class (TForm)
18 InformationMemo: TMemo;
19 OKButton: TButton;
20 Procedure InformationFormOnSetupShow (Sender: TObject);
21 Procedure InformationFormOnShow (Sender: TObject);
22 Procedure InformationFormOnCreate (Sender: TObject);
23 Private
24 {Insert private declarations here}
25 Public
26 FText: pchar; // for messages with long lines
27 Procedure OnLanguageEvent( Language: TLanguageFile;
28 const Apply: boolean );
29 End;
30
31Var
32 InformationForm: TInformationForm;
33
34Implementation
35
36Uses
37 ControlsUtility,
38 DebugUnit,
39 StringUtilsUnit;
40
41Procedure TInformationForm.InformationFormOnSetupShow (Sender: TObject);
42Begin
43 ScaleForm( self, 11, 16 );
44
45 InformationMemo.XStretch := xsFrame;
46 InformationMemo.YStretch := ysFrame;
47End;
48
49Procedure TInformationForm.InformationFormOnShow (Sender: TObject);
50Begin
51 if FText <> nil then
52 InformationMemo.Lines.SetText( FText );
53 FText := nil;
54End;
55
56Procedure TInformationForm.InformationFormOnCreate (Sender: TObject);
57Begin
58 RegisterEventForLanguages( OnLanguageEvent );
59End;
60
61Procedure TInformationForm.OnLanguageEvent( Language: TLanguageFile;
62 const Apply: boolean );
63begin
64 // LogEvent(LogI18n, 'TInformationForm.OnLanguageEvent apply: "' + BoolToStr(Apply) + '"');
65 Language.LoadComponentLanguage( self, Apply );
66end;
67
68Initialization
69 RegisterClasses ([TInformationForm, TMemo, TButton]);
70End.
Note: See TracBrowser for help on using the repository browser.