@@ -9,7 +9,7 @@ interface
9
9
LazFileUtils, SpinEx,rtcodegen;
10
10
11
11
Const
12
- ProgramName = ' RtBinSrc v1.1 By RetroNick - Released May 9 - 2023' ;
12
+ ProgramName = ' RtBinSrc v1.2 By RetroNick - Released May 19 - 2023' ;
13
13
14
14
type
15
15
@@ -52,6 +52,7 @@ TForm1 = class(TForm)
52
52
Lan : integer;
53
53
Format : integer;
54
54
NumType : integer;
55
+ Processing : boolean;
55
56
56
57
procedure SetBasicTypes ;
57
58
procedure SetGWBasicTypes ;
@@ -122,11 +123,17 @@ procedure TForm1.SaveAsClick(Sender: TObject);
122
123
procedure FMemoAppend (msg : string);
123
124
begin
124
125
Form1.MemoWithCode.Append(msg);
126
+ if (Form1.CG.LineCount Mod 50 ) = 0 then
127
+ begin
128
+ Form1.InfoLabel.Caption:=' Imported ' +IntToStr(Form1.CG.LineCount)+' Lines' ;
129
+ Application.ProcessMessages;
130
+ end ;
125
131
end ;
126
132
127
133
procedure TForm1.FormCreate (Sender: TObject);
128
134
begin
129
135
Caption:=ProgramName;
136
+ Processing:=False;
130
137
SetBasicTypes;
131
138
CGInit(CG);
132
139
CGSetLineNumber(CG,LineStartSpinEdit.Value ,LineStepsSpinEdit.Value );
@@ -137,12 +144,26 @@ procedure TForm1.ImportClick(Sender: TObject);
137
144
var
138
145
error : word;
139
146
begin
147
+ if Processing then
148
+ begin
149
+ // ShowMessage('Processing Previous Import');
150
+ // InfoLabel.Caption:='Import Canceled';
151
+ Import .Caption:=' Import' ; // rename cancel back to import
152
+ CGSetImportStatus(CG,FALSE);
153
+ Processing:=FALSE;
154
+ exit;
155
+ end ;
156
+
140
157
if EditArrayName.Text=' ' then
141
158
begin
142
159
ShowMessage(' Array Name Field Cannot be blank' );
143
160
exit;
144
161
end ;
162
+
163
+ Import .Caption:=' Cancel' ; // rename import button to cancel
164
+ Processing:=True;
145
165
CGReset(CG);
166
+ // CGSetImportStatus(CG,TRUE);
146
167
CGSetIndent(CG,indentSpinedit.Value );
147
168
CGSetValuesPerLine(CG,ItemsPerLineSpinEdit.Value );
148
169
InfoLabel.Caption:=' ' ;
@@ -156,14 +177,19 @@ procedure TForm1.ImportClick(Sender: TObject);
156
177
if error<>0 then
157
178
begin
158
179
ShowMessage(' Error Importing File ' );
159
- exit;
180
+ end
181
+ else
182
+ begin
183
+ if CG.ImportStatus then InfoLabel.Caption:=' File Imported Successfully' else InfoLabel.Caption:=' File Import Canceled' ;
160
184
end ;
161
-
162
- InfoLabel .Caption:=' File Imported ' ;
185
+ Processing:=False;
186
+ Import .Caption:=' Import ' ; // rename cancel back to import
163
187
end ;
164
188
165
189
procedure TForm1.InFileClick (Sender: TObject);
166
190
begin
191
+ if Processing then exit;
192
+
167
193
// OpenDialog.Filter := 'Windows BMP|*.bmp|PNG|*.png|PC Paintbrush |*.pcx|DP-Amiga IFF LBM|*.lbm|DP-Amiga IFF BBM Brush|*.bbm|GIF|*.gif|RM RAW Files|*.raw|All Files|*.*';
168
194
if OpenDialog.Execute then
169
195
begin
@@ -176,6 +202,7 @@ procedure TForm1.InFileClick(Sender: TObject);
176
202
177
203
procedure TForm1.LanRadioGroupClick (Sender: TObject);
178
204
begin
205
+ if Processing then exit;
179
206
case LanRadioGroup.ItemIndex of 0 :SetBasicTypes;
180
207
1 :SetGWBasicTypes;
181
208
2 :SetCTypes;
@@ -185,11 +212,11 @@ procedure TForm1.LanRadioGroupClick(Sender: TObject);
185
212
186
213
procedure TForm1.CopyToClipboardClick (Sender: TObject);
187
214
begin
215
+ if Processing then exit;
188
216
MemoWithCode.SelectAll;
189
217
MemoWithCode.CopyToClipboard;
190
218
MemoWithCode.SelLength:=0 ;
191
219
InfoLabel.Caption:=' Code Copied to Clipboard' ;
192
-
193
220
end ;
194
221
195
222
procedure TForm1.FormatRadioGroupClick (Sender: TObject);
@@ -223,7 +250,6 @@ procedure TForm1.SetGWBasicTypes;
223
250
IndentSpinEdit.Enabled:=false;
224
251
LineStartSpinEdit.Enabled:=true;
225
252
LineStepsSpinEdit.Enabled:=true;
226
-
227
253
end ;
228
254
229
255
procedure TForm1.SetPascalTypes ;
0 commit comments