Statistiques
| Révision:

root / UFError.pas @ 3

Historique | Voir | Annoter | Télécharger (1,398 ko)

1 3 avalancogn
unit UFError;
2
3
interface
4
5
uses
6
  Windows, Forms, Classes, Controls, StdCtrls, Buttons;
7
8
type
9
  TFError = class(TForm)
10
    MErrors: TMemo;
11
    LFolder: TLabel;
12
    LQuestion: TLabel;
13
    EFolder: TEdit;
14
    BBYes: TBitBtn;
15
    BBNo: TBitBtn;
16
    LWarning: TLabel;
17
    BBHelp: TBitBtn;
18
    procedure FormShow(Sender: TObject);
19
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
20
    procedure BBHelpClick(Sender: TObject);
21
    procedure FormCreate(Sender: TObject);
22
  private
23
    { D?clarations priv?es }
24
  public
25
    { D?clarations publiques }
26
  end;
27
28
var
29
  FError: TFError;
30
31
implementation
32
33
uses
34
  Dialogs, SysUtils, gnugettext, UStrings, UInit;
35
36
{$R *.dfm}
37
38
procedure TFError.FormCreate(Sender: TObject);
39
begin
40
  if Screen.Fonts.IndexOf('Arial Unicode MS') <> -1
41
  then
42
    Font.Name := 'Arial Unicode MS';
43
  TranslateComponent(Self);
44
end;
45
46
procedure TFError.FormShow(Sender: TObject);
47
begin
48
  EFolder.Text := GetCurrentDir;
49
end;
50
51
procedure TFError.FormClose(Sender: TObject; var Action: TCloseAction);
52
const
53
  LOG = 'Errors.log';
54
begin
55
  if ModalResult = mrYes
56
  then
57
  begin
58
    MErrors.Lines.SaveToFile(LOG);
59
    MessageDlg(Format(MsgRecordErrors, [LOG, EFolder.Text]), mtInformation, [mbOK], 0);
60
    SaveData;
61
  end;
62
end;
63
64
procedure TFError.BBHelpClick(Sender: TObject);
65
begin
66
  Application.HelpCommand(HELP_CONTEXT, HelpContext);
67
end;
68
69
end.