Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | daniel-mar | 1 | unit journal; |
2 | |||
3 | interface |
||
4 | |||
5 | uses |
||
6 | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, |
||
7 | Dialogs, StdCtrls, Menus, ImgList; |
||
8 | |||
9 | type |
||
10 | TMDIJournalForm = class(TForm) |
||
11 | Memo1: TMemo; |
||
12 | MainMenu1: TMainMenu; |
||
13 | Journal1: TMenuItem; |
||
14 | Close1: TMenuItem; |
||
15 | procedure FormShow(Sender: TObject); |
||
16 | procedure FormClose(Sender: TObject; var Action: TCloseAction); |
||
17 | procedure Close1Click(Sender: TObject); |
||
18 | public |
||
19 | procedure DoRefresh; |
||
20 | end; |
||
21 | |||
22 | var |
||
23 | MDIJournalForm: TMDIJournalForm; |
||
24 | |||
25 | implementation |
||
26 | |||
27 | {$R *.dfm} |
||
28 | |||
29 | uses |
||
30 | main, global; |
||
31 | |||
32 | procedure TMDIJournalForm.Close1Click(Sender: TObject); |
||
33 | begin |
||
34 | Close; |
||
35 | end; |
||
36 | |||
37 | procedure TMDIJournalForm.DoRefresh; |
||
38 | begin |
||
39 | if FileExists(getJournalFileName()) then |
||
40 | begin |
||
41 | Memo1.Lines.LoadFromFile(getJournalFileName()); |
||
42 | end; |
||
43 | SendMessage(Memo1.Handle, WM_VSCROLL, SB_BOTTOM, 0); // TODO: geht nicht in w95 |
||
44 | end; |
||
45 | |||
46 | procedure TMDIJournalForm.FormClose(Sender: TObject; var Action: TCloseAction); |
||
47 | begin |
||
48 | Action := caFree; |
||
49 | end; |
||
50 | |||
51 | procedure TMDIJournalForm.FormShow(Sender: TObject); |
||
52 | begin |
||
53 | DoRefresh; |
||
54 | end; |
||
55 | |||
56 | end. |