source: trunk/NewView/ProductInformationFormUnit.pas

Last change on this file was 472, checked in by ataylor, 3 years ago

Fix various outstanding problems with dialog layout & scaling.

  • Property svn:eol-style set to native
File size: 2.8 KB
Line 
1Unit ProductInformationFormUnit;
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 Buttons,
13 StdCtrls,
14 ExtCtrls,
15 ACLLanguageUnit;
16
17Type
18 TProductInformationForm = Class (TForm)
19 OKButton: TButton;
20 NameAndVersionEdit: TEdit;
21 CopyrightEdit: TEdit;
22 Image1: TImage;
23 Bevel1: TBevel;
24 LicenseEdit: TEdit;
25 TranslationInfoLabel: TLabel;
26 WebPageEdit: TEdit;
27 EmailEdit: TEdit;
28 Procedure EmailEditOnClick (Sender: TObject);
29 Procedure WebPageEditOnClick (Sender: TObject);
30 Procedure ProductInformationFormOnSetupShow (Sender: TObject);
31 Procedure AboutBoxOnCreate (Sender: TObject);
32 Public
33 Procedure OnLanguageEvent( Language: TLanguageFile;
34 const Apply: boolean );
35 VersionMsg: string;
36 End;
37
38Var
39 ProductInformationForm: TProductInformationForm;
40
41procedure EnsureProductInformationFormLoaded;
42
43Implementation
44
45uses
46 VersionUnit,
47 ControlsUtility,
48 WebBrowserUnit,
49 DebugUnit,
50 StringUtilsUnit;
51
52Procedure TProductInformationForm.EmailEditOnClick (Sender: TObject);
53Begin
54 LaunchURL('"mailto:' + EmailEdit.Text + '"');
55End;
56
57Procedure TProductInformationForm.WebPageEditOnClick (Sender: TObject);
58Begin
59 LaunchURL('"http://' + WebPageEdit.Text + '"');
60End;
61
62
63Procedure TProductInformationForm.ProductInformationFormOnSetupShow (Sender: TObject);
64Begin
65 ScaleForm( self, 10, 16 );
66End;
67
68
69Procedure TProductInformationForm.OnLanguageEvent( Language: TLanguageFile;
70 const Apply: boolean );
71begin
72 LogEvent(LogI18n, 'TProductInformationForm.OnLanguageEvent apply: "' + BoolToStr(Apply) + '"');
73 Language.LoadComponentLanguage( self, Apply );
74
75 Language.LL( Apply, VersionMsg, 'VersionMsg', 'Version: ' );
76end;
77
78Procedure TProductInformationForm.AboutBoxOnCreate (Sender: TObject);
79Begin
80 RegisterForLanguages( OnLanguageEvent );
81
82 NameAndVersionEdit.Text := 'NewView ' + GetAppVersion;
83
84 NameAndVersionEdit.Font := Screen.CreateCompatibleFont( Font );
85 NameAndVersionEdit.Font.Attributes := [ faBold ];
86
87 WebPageEdit.Font := Screen.CreateCompatibleFont( Font );
88 WebPageEdit.Font.Attributes := [ faUnderscore ];
89 EmailEdit.Font := WebPageEdit.Font;
90
91 CopyrightEdit.Text := GetCopyrightMsg;
92 LicenseEdit.Text := GetLicenseMsg;
93
94 WebPageEdit.Cursor := GetLinkCursor;
95 EmailEdit.Cursor := GetLinkCursor;
96End;
97
98procedure EnsureProductInformationFormLoaded;
99begin
100 if ProductInformationForm = nil then
101 ProductInformationForm := TProductInformationForm.Create( nil );
102end;
103
104Initialization
105 RegisterClasses ([TProductInformationForm, TButton,
106 TEdit, TImage, TLabel, TBevel]);
107 RegisterUpdateProcForLanguages( EnsureProductInformationFormLoaded );
108End.
Note: See TracBrowser for help on using the repository browser.