| 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,
|
|---|
| 11 | Forms,
|
|---|
| 12 | StdCtrls,
|
|---|
| 13 | Buttons,
|
|---|
| 14 | ACLLanguageUnit;
|
|---|
| 15 |
|
|---|
| 16 | Type
|
|---|
| 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 |
|
|---|
| 31 | Var
|
|---|
| 32 | InformationForm: TInformationForm;
|
|---|
| 33 |
|
|---|
| 34 | Implementation
|
|---|
| 35 |
|
|---|
| 36 | Uses
|
|---|
| 37 | ControlsUtility,
|
|---|
| 38 | DebugUnit,
|
|---|
| 39 | StringUtilsUnit;
|
|---|
| 40 |
|
|---|
| 41 | Procedure TInformationForm.InformationFormOnSetupShow (Sender: TObject);
|
|---|
| 42 | Begin
|
|---|
| 43 | ScaleForm( self, 11, 16 );
|
|---|
| 44 |
|
|---|
| 45 | InformationMemo.XStretch := xsFrame;
|
|---|
| 46 | InformationMemo.YStretch := ysFrame;
|
|---|
| 47 | End;
|
|---|
| 48 |
|
|---|
| 49 | Procedure TInformationForm.InformationFormOnShow (Sender: TObject);
|
|---|
| 50 | Begin
|
|---|
| 51 | if FText <> nil then
|
|---|
| 52 | InformationMemo.Lines.SetText( FText );
|
|---|
| 53 | FText := nil;
|
|---|
| 54 | End;
|
|---|
| 55 |
|
|---|
| 56 | Procedure TInformationForm.InformationFormOnCreate (Sender: TObject);
|
|---|
| 57 | Begin
|
|---|
| 58 | RegisterEventForLanguages( OnLanguageEvent );
|
|---|
| 59 | End;
|
|---|
| 60 |
|
|---|
| 61 | Procedure TInformationForm.OnLanguageEvent( Language: TLanguageFile;
|
|---|
| 62 | const Apply: boolean );
|
|---|
| 63 | begin
|
|---|
| 64 | // LogEvent(LogI18n, 'TInformationForm.OnLanguageEvent apply: "' + BoolToStr(Apply) + '"');
|
|---|
| 65 | Language.LoadComponentLanguage( self, Apply );
|
|---|
| 66 | end;
|
|---|
| 67 |
|
|---|
| 68 | Initialization
|
|---|
| 69 | RegisterClasses ([TInformationForm, TMemo, TButton]);
|
|---|
| 70 | End.
|
|---|