root / UnitComment.pas @ 15
Historique | Voir | Annoter | Télécharger (1,764 ko)
1 | 1 | avalancogn | unit UnitComment;
|
---|---|---|---|
2 | |||
3 | interface
|
||
4 | |||
5 | uses
|
||
6 | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, |
||
7 | Dialogs, StdCtrls, gnugettext, ImgList, ActnList, JvExStdCtrls, JvButton, |
||
8 | JvCtrls, ExtCtrls; |
||
9 | |||
10 | type
|
||
11 | TFormComment = class(TForm)
|
||
12 | LabelName: TLabel; |
||
13 | EditName: TEdit; |
||
14 | MemoComment: TMemo; |
||
15 | JvImgBtnCancel: TJvImgBtn; |
||
16 | JvImgBtnOK: TJvImgBtn; |
||
17 | ActionListButtons: TActionList; |
||
18 | ActionOK: TAction; |
||
19 | ActionCancel: TAction; |
||
20 | ImageListIcons: TImageList; |
||
21 | PanelButtons: TPanel; |
||
22 | procedure FormCreate(Sender: TObject);
|
||
23 | procedure FormShow(Sender: TObject);
|
||
24 | procedure ActionOKExecute(Sender: TObject);
|
||
25 | procedure ActionCancelExecute(Sender: TObject);
|
||
26 | private
|
||
27 | { D?clarations priv?es }
|
||
28 | public
|
||
29 | { D?clarations publiques }
|
||
30 | Name, OldComment, NewComment: String;
|
||
31 | end;
|
||
32 | |||
33 | var
|
||
34 | FormComment: TFormComment; |
||
35 | |||
36 | implementation
|
||
37 | |||
38 | uses
|
||
39 | UnitDeclaration; |
||
40 | |||
41 | {$R *.dfm}
|
||
42 | |||
43 | procedure TFormComment.ActionCancelExecute(Sender: TObject);
|
||
44 | begin
|
||
45 | ModalResult := mrCancel; |
||
46 | end;
|
||
47 | |||
48 | procedure TFormComment.ActionOKExecute(Sender: TObject);
|
||
49 | begin
|
||
50 | NewComment := MemoComment.Text; |
||
51 | ModalResult := mrOk; |
||
52 | end;
|
||
53 | |||
54 | procedure TFormComment.FormCreate(Sender: TObject);
|
||
55 | begin
|
||
56 | if Screen.Fonts.IndexOf('Arial Unicode MS') <> -1 |
||
57 | then
|
||
58 | Font.Name := 'Arial Unicode MS';
|
||
59 | // PanelButtons.Font.Size := PanelButtons.Font.Size + 2;
|
||
60 | PanelButtons.Font.Style := [fsBold]; |
||
61 | LabelName.Font.Style := [fsBold]; |
||
62 | EditName.Font.Style := [fsBold]; |
||
63 | TranslateComponent(Self); |
||
64 | end;
|
||
65 | |||
66 | procedure TFormComment.FormShow(Sender: TObject);
|
||
67 | begin
|
||
68 | EditName.Text := Name; |
||
69 | if OldComment <> '' |
||
70 | then
|
||
71 | begin
|
||
72 | MemoComment.Text := OldComment; |
||
73 | MemoComment.SelectAll; |
||
74 | end;
|
||
75 | ActiveControl := MemoComment; |
||
76 | end;
|
||
77 | |||
78 | end. |