@@ -6,10 +6,10 @@ interface
6
6
7
7
uses
8
8
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
9
- LazFileUtils, SpinEx,rtcodegen;
9
+ LazFileUtils, Types, SpinEx,rtcodegen;
10
10
11
11
Const
12
- ProgramName = ' RtBinSrc v1.2 By RetroNick - Released May 19 - 2023' ;
12
+ ProgramName = ' RtBinSrc v1.3 By RetroNick - Released May 22 - 2023' ;
13
13
14
14
type
15
15
@@ -42,8 +42,10 @@ TForm1 = class(TForm)
42
42
procedure CopyToClipboardClick (Sender: TObject);
43
43
procedure FormatRadioGroupClick (Sender: TObject);
44
44
procedure FormCreate (Sender: TObject);
45
+ procedure FormDropFiles (Sender: TObject; const FileNames: array of String);
45
46
procedure ImportClick (Sender: TObject);
46
47
procedure InFileClick (Sender: TObject);
48
+ procedure InFileDragDrop (Sender, Source: TObject; X, Y: Integer);
47
49
procedure LanRadioGroupClick (Sender: TObject);
48
50
procedure NumTypeRadioGroupClick (Sender: TObject);
49
51
procedure SaveAsClick (Sender: TObject);
@@ -140,6 +142,34 @@ procedure TForm1.FormCreate(Sender: TObject);
140
142
CGSetMemoProc(@FMemoAppend);
141
143
end ;
142
144
145
+ procedure TForm1.FormDropFiles (Sender: TObject; const FileNames: array of String
146
+ );
147
+ var
148
+ MousePoint: TPoint;
149
+ begin
150
+ if High(Filenames) > 0 then
151
+ begin
152
+ ShowMessage(' Drag only one file!' );
153
+ exit;
154
+ end ;
155
+
156
+ if FileExists(FileNames[0 ]) then
157
+ begin
158
+ OpenDialog.FileName:=FileNames[0 ];
159
+ EditFileName.Caption:=FileNames[0 ];
160
+ EditArrayName.Text:=LowerCase(ExtractFileName(ExtractFileNameWithoutExt(FileNames[0 ])));
161
+ Import .Enabled:=True;
162
+ end
163
+ else
164
+ begin
165
+ ShowMessage(' Invalid File/Directory!' );
166
+ exit;
167
+ end ;
168
+
169
+ MousePoint := ScreenToClient(Mouse.CursorPos);
170
+ if NOT (PtInRect(InFile.BoundsRect, MousePoint) or PtInRect(EditFilename.BoundsRect, MousePoint)) then ImportClick(Self);
171
+ end ;
172
+
143
173
procedure TForm1.ImportClick (Sender: TObject);
144
174
var
145
175
error : word;
@@ -200,6 +230,13 @@ procedure TForm1.InFileClick(Sender: TObject);
200
230
end ;
201
231
end ;
202
232
233
+ procedure TForm1.InFileDragDrop (Sender, Source: TObject; X, Y: Integer);
234
+ begin
235
+
236
+ end ;
237
+
238
+
239
+
203
240
procedure TForm1.LanRadioGroupClick (Sender: TObject);
204
241
begin
205
242
if Processing then exit;
0 commit comments