root / UFIntro.pas
Historique | Voir | Annoter | Télécharger (1,57 ko)
1 |
unit UFIntro;
|
---|---|
2 |
|
3 |
interface
|
4 |
|
5 |
uses
|
6 |
Windows, Forms, Classes, Controls, Messages, Dialogs, StdCtrls, Buttons, |
7 |
ExtCtrls, ComCtrls; |
8 |
|
9 |
type
|
10 |
TFIntro = class(TForm)
|
11 |
PBoutons: TPanel; |
12 |
BBOk: TBitBtn; |
13 |
BBCancel: TBitBtn; |
14 |
BBClose: TBitBtn; |
15 |
REText: TRichEdit; |
16 |
procedure FormShow(Sender: TObject);
|
17 |
procedure FormCreate(Sender: TObject);
|
18 |
procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND; |
19 |
private
|
20 |
{ D?clarations priv?es }
|
21 |
public
|
22 |
{ D?clarations publiques }
|
23 |
end;
|
24 |
|
25 |
var
|
26 |
FIntro: TFIntro; |
27 |
|
28 |
implementation
|
29 |
|
30 |
uses
|
31 |
SysUtils, gnugettext, UVariables; |
32 |
|
33 |
{$R *.dfm}
|
34 |
|
35 |
procedure TFIntro.FormCreate(Sender: TObject);
|
36 |
begin
|
37 |
if Screen.Fonts.IndexOf('Arial Unicode MS') <> -1 |
38 |
then
|
39 |
Font.Name := 'Arial Unicode MS';
|
40 |
TranslateComponent(Self); |
41 |
end;
|
42 |
|
43 |
procedure TFIntro.FormShow(Sender: TObject);
|
44 |
var
|
45 |
LicType, ResName: String;
|
46 |
Stream: TResourceStream; |
47 |
begin
|
48 |
case LicenseType of |
49 |
1: LicType := 'Education'; |
50 |
2: LicType := 'Complete'; |
51 |
else LicType := 'Evaluation'; |
52 |
end;
|
53 |
if Copy(LanguageCode, 1, 2) = 'fr' |
54 |
then // Fran?ais |
55 |
ResName := UpperCase(LicType + '_fr')
|
56 |
else // Anglais |
57 |
ResName := UpperCase(LicType + '_en');
|
58 |
Stream := TResourceStream.Create(ResInstance, ResName, 'TEXT');
|
59 |
try
|
60 |
REText.Lines.LoadFromStream(Stream); |
61 |
finally
|
62 |
Stream.Free; |
63 |
end;
|
64 |
ActiveControl := REText; |
65 |
end;
|
66 |
|
67 |
procedure TFIntro.WMSysCommand(var Message: TWMSysCommand); |
68 |
begin
|
69 |
if Message.CmdType = SC_MINIMIZE
|
70 |
then
|
71 |
Application.Minimize |
72 |
else
|
73 |
inherited;
|
74 |
end;
|
75 |
|
76 |
end.
|