Subversion Repositories autosfx

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 daniel-mar 1
unit ExtractorComment;
2
 
3
interface
4
 
5
uses
6
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
7
  Dialogs, StdCtrls;
8
 
9
type
10
  TCommentForm = class(TForm)
11
    DescMemo: TMemo;
12
    OkBtn: TButton;
13
    CancelBtn: TButton;
14
    procedure FormResize(Sender: TObject);
15
  public
16
    function ShowCommentModal(Comment: string): boolean;
17
  end;
18
 
19
var
20
  CommentForm: TCommentForm;
21
 
22
implementation
23
 
24
uses
25
  SFXBehavior;
26
 
27
{$R *.dfm}
28
 
29
procedure TCommentForm.FormResize(Sender: TObject);
30
begin
31
  DescMemo.Width  := ClientWidth  - 2 * DescMemo.Left;
32
  DescMemo.Height := ClientHeight - 3 * DescMemo.Top - OkBtn.Height;
33
  CancelBtn.Top   := 2 * DescMemo.Top + DescMemo.Height;
34
  OkBtn.Top       := CancelBtn.Top;
35
  OkBtn.Left      := ClientWidth - OkBtn.Width - CancelBtn.Left;
36
end;
37
 
38
function TCommentForm.ShowCommentModal(Comment: string): boolean;
39
begin
40
  DescMemo.Text := TrimRight(StripBehavior(Comment));
41
  result := ShowModal() = mrOk;
42
end;
43
 
44
end.