-
Notifications
You must be signed in to change notification settings - Fork 32
/
frm.frm
320 lines (301 loc) · 9.45 KB
/
frm.frm
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
VERSION 5.00
Begin VB.Form frm
Caption = "VB6 -> .NET"
ClientHeight = 5205
ClientLeft = 120
ClientTop = 465
ClientWidth = 5190
LinkTopic = "Form1"
ScaleHeight = 5205
ScaleWidth = 5190
StartUpPosition = 3 'Windows Default
Begin VB.Frame fra
Height = 4935
Left = 120
TabIndex = 0
Top = 120
Width = 4935
Begin VB.OptionButton optVersion
Caption = "v2"
Height = 255
Index = 1
Left = 2648
TabIndex = 17
Top = 1080
Value = -1 'True
Width = 615
End
Begin VB.OptionButton optVersion
Caption = "v1"
Height = 255
Index = 0
Left = 1928
TabIndex = 16
Top = 1080
Width = 615
End
Begin VB.CommandButton cmdSupport
Caption = "SUPPORT"
Height = 285
Left = 2520
TabIndex = 15
Top = 720
Width = 1215
End
Begin VB.CommandButton cmdScan
Caption = "SCAN"
Height = 285
Left = 1200
TabIndex = 14
Top = 720
Width = 1215
End
Begin VB.CommandButton cmdFile
Caption = " Single File ----->"
Height = 495
Left = 240
TabIndex = 6
Top = 1680
Width = 1455
End
Begin VB.TextBox txtFile
Height = 285
Left = 2040
TabIndex = 5
Top = 1800
Width = 2415
End
Begin VB.CommandButton cmdLint
Caption = "L&int"
Height = 285
Left = 3960
TabIndex = 4
Top = 600
Width = 855
End
Begin VB.CommandButton cmdConfig
Caption = "Conf&ig"
Height = 285
Left = 3960
TabIndex = 3
Top = 240
Width = 855
End
Begin VB.TextBox txtStats
Appearance = 0 'Flat
BackColor = &H8000000F&
Height = 1695
Left = 2040
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 12
Top = 2160
Width = 2655
End
Begin VB.CommandButton cmdClasses
Caption = "Classes"
Height = 495
Left = 240
TabIndex = 8
Top = 2880
Width = 1455
End
Begin VB.CommandButton cmdModules
Caption = "Modules"
Height = 495
Left = 240
TabIndex = 9
Top = 3480
Width = 1455
End
Begin VB.CommandButton cmdAll
Caption = "ALL"
Height = 495
Left = 240
TabIndex = 10
Top = 4320
Width = 1455
End
Begin VB.CommandButton cmdForms
Caption = "Forms"
Height = 495
Left = 240
TabIndex = 7
Top = 2280
Width = 1455
End
Begin VB.CommandButton cmdExit
Cancel = -1 'True
Caption = "E&xit"
Height = 495
Left = 3240
TabIndex = 11
Top = 4320
Width = 1455
End
Begin VB.TextBox txtSrc
Height = 285
Left = 1200
Locked = -1 'True
TabIndex = 2
Text = "C:\WinCDS\WinCDS\WinCDS.vbp"
Top = 240
Width = 2655
End
Begin VB.Label lblPrg
Alignment = 2 'Center
BackStyle = 0 'Transparent
Height = 255
Left = 2040
TabIndex = 13
Top = 4200
Width = 2415
End
Begin VB.Shape shpPrgBack
BackColor = &H00FFC0C0&
Height = 255
Left = 2040
Top = 3960
Width = 2415
End
Begin VB.Shape shpPrg
BackColor = &H00FFC0C0&
BackStyle = 1 'Opaque
BorderStyle = 0 'Transparent
Height = 255
Left = 2040
Top = 3960
Visible = 0 'False
Width = 1335
End
Begin VB.Label lblSrc
Alignment = 1 'Right Justify
Caption = "Project File:"
Height = 255
Left = 240
TabIndex = 1
Top = 240
Width = 855
End
End
End
Attribute VB_Name = "frm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
' Main form
Public pMax As Long
Public Property Get ConverterVersion() As String
Dim I As Long
For I = optVersion.LBound To optVersion.UBound
If optVersion(I) Then ConverterVersion = optVersion(I).Caption: Exit Function
Next
ConverterVersion = CONVERTER_VERSION_1
End Property
Private Sub cmdAll_Click()
If Not ConfigValid Then Exit Sub
IsWorking
ConvertProject txtSrc, ConverterVersion
IsWorking True
MsgBox "Complete"
End Sub
Private Sub cmdClasses_Click()
If Not ConfigValid Then Exit Sub
IsWorking
ConvertFileList FilePath(txtSrc), VBPClasses(txtSrc), vbCrLf, ConverterVersion
IsWorking True
End Sub
Private Sub cmdConfig_Click()
frmConfig.Show 1
modConfig.LoadSettings True
txtSrc = vbpFile
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdFile_Click()
Dim Success As Boolean
If txtFile = "" Then
MsgBox "Enter a file in the box.", vbExclamation, "No File Entered"
Exit Sub
End If
If Not ConfigValid Then Exit Sub
IsWorking
Success = ConvertFile(txtFile, False, ConverterVersion)
IsWorking True
If Success Then MsgBox "Converted " & txtFile & "."
End Sub
Private Sub cmdForms_Click()
If Not ConfigValid Then Exit Sub
IsWorking
ConvertFileList FilePath(txtSrc), VBPForms(txtSrc), vbCrLf, ConverterVersion
IsWorking True
End Sub
Private Sub cmdModules_Click()
If Not ConfigValid Then Exit Sub
IsWorking
ConvertFileList FilePath(txtSrc), VBPModules(txtSrc), vbCrLf, ConverterVersion
IsWorking True
End Sub
Private Function ConfigValid() As Boolean
modConfig.LoadSettings
If Dir(modConfig.vbpFile) = "" Then
MsgBox "Project file not found. Perhaps do config first?", vbExclamation, "File Not Found"
Exit Function
End If
If Dir(modConfig.OutputFolder, vbDirectory) = "" Then
MsgBox "Ouptut Folder not found. Perhaps do config first?", vbExclamation, "Directory Not Found"
Exit Function
End If
If modConfig.AssemblyName = "" Then
MsgBox "Assembly name not set. Perhaps do config first?", vbExclamation, "Setting Not Found"
Exit Function
End If
ConfigValid = True
End Function
Private Sub IsWorking(Optional ByVal Done As Boolean = False)
txtFile.Enabled = Done
cmdConfig.Enabled = Done
cmdLint.Enabled = Done
cmdFile.Enabled = Done
cmdAll.Enabled = Done
cmdClasses.Enabled = Done
cmdExit.Enabled = Done
cmdForms.Enabled = Done
cmdModules.Enabled = Done
txtSrc.Enabled = Done
cmdScan.Enabled = Done
cmdSupport.Enabled = Done
MousePointer = IIf(Done, vbDefault, vbHourglass)
End Sub
Public Function Prg(Optional ByVal Val As Long = -1, Optional ByVal Max As Long = -1, Optional ByVal Cap As String = "#") As String
On Error Resume Next
If Max >= 0 Then pMax = Max
lblPrg = IIf(Prg = "#", "", Cap)
shpPrg.Width = Val / pMax * 2415
shpPrg.Visible = Val >= 0
lblPrg.Visible = shpPrg.Visible
End Function
Private Sub cmdLint_Click()
If Not ConfigValid Then Exit Sub
frmLinter.Show vbModal
End Sub
Private Sub cmdScan_Click()
If Not ConfigValid Then Exit Sub
IsWorking False
ScanRefs
IsWorking True
End Sub
Private Sub cmdSupport_Click()
If Not ConfigValid Then Exit Sub
If MsgBox("Generate Project files?", vbYesNo) = vbYes Then CreateProjectFile vbpFile
If MsgBox("Generate Support files?", vbYesNo) = vbYes Then CreateProjectSupportFiles
End Sub
Private Sub Form_Load()
modConfig.Hush = True
modConfig.LoadSettings
modConfig.Hush = False
txtSrc = vbpFile
End Sub