-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUFormViewToolParams.pas
100 lines (85 loc) · 2.23 KB
/
UFormViewToolParams.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
unit UFormViewToolParams;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, ComCtrls, TntStdCtrls, TntDialogs;
type
TFormViewToolParams = class(TForm)
GroupBox1: TGroupBox;
btnOk: TButton;
btnCancel: TButton;
edCommand: TTntEdit;
labCommand: TLabel;
btnCommandBrowse: TButton;
edParams: TTntEdit;
labParams: TLabel;
labMacros: TLabel;
labCaption: TLabel;
edCaption: TEdit;
chkSelectAll: TCheckBox;
chkCopy: TCheckBox;
labActions: TLabel;
OpenDialog1: TTntOpenDialog;
labActions2: TLabel;
chkExit: TCheckBox;
labActions1: TLabel;
labParamsHint: TLabel;
listMacros: TListBox;
procedure btnCommandBrowseClick(Sender: TObject);
procedure listMacros33DblClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
function FGetFileDescription(const FileName: WideString): WideString;
implementation
uses
ATxMsg, ATxMsgProc, ATxSProc, ATxVersionInfo, ATxUtils,
TntSysUtils;
{$R *.DFM}
procedure TFormViewToolParams.btnCommandBrowseClick(Sender: TObject);
begin
with OpenDialog1 do
begin
FileName:= SExpandVars(edCommand.Text);
InitialDir:= SExtractFileDir(FileName);
if Execute then
begin
edCaption.Text:= FGetFileDescription(FileName);
edCommand.Text:= FileName;
end;
end;
end;
procedure TFormViewToolParams.listMacros33DblClick(Sender: TObject);
var
S: string;
begin
with listMacros do
if ItemIndex >= 0 then
begin
S:= Items[ItemIndex];
if edParams.Text = '' then
edParams.Text:= S
else
edParams.Text:= edParams.Text + ' ' + S;
end;
end;
procedure TFormViewToolParams.FormShow(Sender: TObject);
begin
{$I Lang.FormViewToolParams.inc}
end;
function FGetFileDescription(const FileName: WideString): WideString;
begin
Result:= FGetVersionInfo(FileName, vsFileDescription);
if Result='' then
Result:= WideChangeFileExt(SExtractFileName(FileName), '');
end;
procedure TFormViewToolParams.FormCreate(Sender: TObject);
begin
//Fix form font
//FixFormFont(Self.Font);
end;
end.