root / UFWarning.pas
Historique | Voir | Annoter | Télécharger (2,243 ko)
1 | 3 | avalancogn | unit UFWarning ;
|
---|---|---|---|
2 | |||
3 | interface
|
||
4 | |||
5 | uses
|
||
6 | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, |
||
7 | Dialogs, StdCtrls, Buttons, ComCtrls, StrUtils, UVariables, gnugettext; |
||
8 | |||
9 | type
|
||
10 | TFWarning = class(TForm)
|
||
11 | BBOk: TBitBtn; |
||
12 | CBDisplay: TCheckBox; |
||
13 | REMessage: TRichEdit; |
||
14 | procedure FormCreate(Sender: TObject);
|
||
15 | procedure FormShow(Sender: TObject);
|
||
16 | procedure FormClose(Sender: TObject; var Action: TCloseAction); |
||
17 | private
|
||
18 | { D?clarations priv?es }
|
||
19 | public
|
||
20 | { D?clarations publiques }
|
||
21 | Msg: String;
|
||
22 | end;
|
||
23 | |||
24 | var
|
||
25 | FWarning: TFWarning; |
||
26 | |||
27 | implementation
|
||
28 | |||
29 | uses
|
||
30 | UUtil, UStrings; |
||
31 | |||
32 | {$R *.dfm}
|
||
33 | |||
34 | { TFComment }
|
||
35 | |||
36 | procedure TFWarning.FormCreate(Sender: TObject);
|
||
37 | begin
|
||
38 | if Screen.Fonts.IndexOf('Arial Unicode MS') <> -1 |
||
39 | then
|
||
40 | Font.Name := 'Arial Unicode MS';
|
||
41 | TranslateComponent(Self); |
||
42 | Width := 468 + (Width - ClientWidth);
|
||
43 | Height := 248 + (Height - ClientHeight);
|
||
44 | end;
|
||
45 | |||
46 | procedure TFWarning.FormShow(Sender: TObject);
|
||
47 | {
|
||
48 | var
|
||
49 | ResName: String;
|
||
50 | Stream: TResourceStream;
|
||
51 | }
|
||
52 | begin
|
||
53 | {
|
||
54 | ResName := UpperCase(Msg);
|
||
55 | Stream := TResourceStream.Create(ResInstance, ResName, 'TEXT');
|
||
56 | try
|
||
57 | REMessage.Lines.LoadFromStream(Stream);
|
||
58 | finally
|
||
59 | Stream.Free;
|
||
60 | end;
|
||
61 | }
|
||
62 | case AnsiIndexStr(Msg, ['CorrCUD', 'CalcAli', 'GraphAli', 'UnitProfilP', 'PDMoy', 'Precocite', 'Entretien', 'OptInit', 'SimulT', 'Besoin', 'InraAfz']) of |
||
63 | 0: // CorrCUD |
||
64 | REMessage.Lines.Add(MsgCorrCUD); |
||
65 | 1: // CalcAli |
||
66 | REMessage.Lines.Add(MsgCalcAli); |
||
67 | 2: // GraphAli |
||
68 | REMessage.Lines.Add(MsgGraphAli); |
||
69 | 3: // UnitProfilP |
||
70 | REMessage.Lines.Add(MsgUnitProfilP); |
||
71 | 4: // PDMoy |
||
72 | REMessage.Lines.Add(MsgPDMoy); |
||
73 | 5: // Precocite |
||
74 | REMessage.Lines.Add(MsgPrecocite); |
||
75 | 6: // Entretien |
||
76 | REMessage.Lines.Add(MsgEntretien); |
||
77 | 7: // OptInit |
||
78 | REMessage.Lines.Add(MsgOptInit); |
||
79 | 8: // SimulT |
||
80 | REMessage.Lines.Add(MsgSimulT); |
||
81 | 9: // Besoin |
||
82 | REMessage.Lines.Add(MsgBesoin); |
||
83 | 10: // InraAfz |
||
84 | REMessage.Lines.Add(MsgInraAfz); |
||
85 | end;
|
||
86 | end;
|
||
87 | |||
88 | procedure TFWarning.FormClose(Sender: TObject; var Action: TCloseAction); |
||
89 | begin
|
||
90 | if CBDisplay.Checked
|
||
91 | then
|
||
92 | BdRWriteBoolean('\Software\InraPorc\Config\Messages', Msg, False);
|
||
93 | end;
|
||
94 | |||
95 | end. |