-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWholeDeckMatch.frm
361 lines (352 loc) · 11.4 KB
/
WholeDeckMatch.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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form frmWholeDeckMatch
BorderStyle = 3 'Fixed Dialog
Caption = "Whole Deck Match"
ClientHeight = 3195
ClientLeft = 2760
ClientTop = 3750
ClientWidth = 6030
Icon = "WholeDeckMatch.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 6030
ShowInTaskbar = 0 'False
Begin MSComDlg.CommonDialog dlgCommonDialog
Left = 4965
Top = 1320
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Frame TrapFrame
Height = 1050
Left = 330
TabIndex = 9
Top = 1515
Width = 3870
Begin VB.OptionButton SaveTrapOption
Caption = "Save Traps to File"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 120
TabIndex = 5
Top = 390
Width = 2580
End
Begin VB.OptionButton SuspendTrapOption
Caption = "Suspend Search on Trap"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 120
TabIndex = 4
Top = 135
Value = -1 'True
Width = 2580
End
Begin VB.Label TrapFileLabel
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 270
Left = 405
TabIndex = 10
Top = 675
Width = 3345
End
End
Begin VB.TextBox ThresholdCards
Alignment = 2 'Center
Height = 315
Left = 3120
TabIndex = 3
Top = 1260
Width = 510
End
Begin VB.CheckBox ThresholdCheck
Caption = "Trap threshold matches of"
BeginProperty Font
Name = "Arial"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 330
TabIndex = 2
Top = 1260
Width = 2745
End
Begin VB.CommandButton CancelButton
Caption = "Cancel"
Height = 375
Left = 4695
TabIndex = 1
Top = 2625
Width = 1215
End
Begin VB.CommandButton OKButton
Caption = "OK"
Height = 375
Left = 3255
TabIndex = 0
Top = 2625
Width = 1215
End
Begin VB.Label Label2
Caption = "Click the checkbox below if you would like to have Stackview trap the search at a specified threshhold match amount."
BeginProperty Font
Name = "Arial"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 570
Left = 210
TabIndex = 8
Top = 570
Width = 5550
End
Begin VB.Label Label4
Caption = "cards"
BeginProperty Font
Name = "Arial"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 3705
TabIndex = 7
Top = 1290
Width = 570
End
Begin VB.Label Label1
Caption = "The Match range will be the whole deck (all 52 cards)."
BeginProperty Font
Name = "Arial"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 195
TabIndex = 6
Top = 165
Width = 5550
End
End
Attribute VB_Name = "frmWholeDeckMatch"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CancelButton_Click()
SearchSpecialCancel = True
If WholeDeckMatchSet = False Then
frmSearch.SearchMatchPartialOption.Value = True
ThresholdCards.Text = Empty
ThresholdCheck.Value = 0
End If
If SuspendTrapWholeFinal Then
TrapFileWhole = Empty
TrapFileLabel.Caption = Empty
End If
Unload Me
End Sub
Private Sub Form_Load()
If WholeDeckMatchSet = False Then
ThresholdCards.Text = Empty
ThresholdCheck.Value = 0
TrapFileLabel.Caption = Empty
TrapFileWhole = Empty
SuspendTrapOption.Value = True
SaveTrapOption.Value = False
TrapFrame.Enabled = False
SuspendTrapOption.Enabled = False
SaveTrapOption.Enabled = False
Else
ThresholdCards.Text = ThresholdMatchCards
If TrapThreshold Then
ThresholdCheck.Value = 1
TrapFileWhole = TrapFileFinal
TrapFileLabel.Caption = TrapFileWhole
SuspendTrapWhole = SuspendTrapFinal
SuspendTrapOption.Value = SuspendTrapFinal
SaveTrapOption.Value = Not SuspendTrapFinal
TrapFrame.Enabled = True
SuspendTrapOption.Enabled = True
SaveTrapOption.Enabled = True
Else
ThresholdCheck.Value = 0
TrapFileLabel.Caption = Empty
TrapFileWhole = Empty
SuspendTrapOption.Value = True
SaveTrapOption.Value = False
TrapFrame.Enabled = False
SuspendTrapOption.Enabled = False
SaveTrapOption.Enabled = False
End If
End If
End Sub
Private Sub OKButton_Click()
If ThresholdCheck.Value = 1 And ThresholdCards.Text = Empty Then
MsgBox "Please enter a valid number less than 52" _
& Chr(13) & "in the 'cards' Input Box"
ThresholdCards.SetFocus
Exit Sub
End If
If ThresholdCheck.Value = 1 And ThresholdCards.Text <> Empty And _
(Not IsNumeric(ThresholdCards.Text) Or _
Val(ThresholdCards.Text) < 1 Or _
Val(ThresholdCards.Text) > 51) Then
ThresholdCards.Text = Empty
MsgBox "Please enter a valid number less than 52" _
& Chr(13) & "in the 'cards' Input Box"
ThresholdCards.SetFocus
Exit Sub
End If
SearchMatchStartCard = 1
SearchMatchEndCard = 52
SearchSpecialCancel = False
ThresholdMatchCards = Val(ThresholdCards.Text)
If ThresholdCheck.Value = 1 Then
TrapThreshold = True
If SuspendTrapOption Then
SuspendTrapWholeFinal = True
SuspendTrapFinal = True
TrapFileWholeFinal = Empty
TrapFileLabel.Caption = Empty
Else
SuspendTrapWholeFinal = False
SuspendTrapFinal = False
TrapFileWholeFinal = TrapFileWhole
TrapFileFinal = TrapFileWhole
TrapPathWholeFinal = TrapPathWhole
TrapPathFinal = TrapPathWhole
End If
Else
TrapThreshold = False
End If
WholeDeckMatchSet = True
Unload Me
End Sub
Private Sub SaveTrapOption_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If SaveTrapOption.Value = True Then
SuspendTrapWhole = False
SaveTrapFileWhole
End If
End Sub
Private Sub SuspendTrapOption_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If SuspendTrapOption.Value Then
SuspendTrapWhole = True
TrapFileWhole = Empty
TrapFileLabel.Caption = Empty
End If
End Sub
Private Sub SaveTrapFileWhole()
Dim sFile As String
Dim tFile As String
dlgCommonDialog.CancelError = True
On Error GoTo TrapCancelError
dlgCommonDialog.DialogTitle = "Create Trap File As"
dlgCommonDialog.Filter = "StackView Trap Files (*.svt)|*.svt"
dlgCommonDialog.ShowSave
If Len(dlgCommonDialog.FileName) = 0 Then
Exit Sub
End If
sFile = dlgCommonDialog.FileName
tFile = dlgCommonDialog.FileTitle
On Error GoTo TrapSaveError
Dim fso, trapfile
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(sFile) Then
Dim Msg ' Declare variable.
' Set the message text.
Msg = "The file " & tFile & " already exists." & Chr(13) & _
"Do you want to overwrite the file?"
' If user clicks the No button, stop QueryUnload.
If MsgBox(Msg, vbQuestion + vbYesNo, Me.Caption) = vbNo Then
Cancel = True
Exit Sub
Else
Set trapfile = fso.CreateTextFile(sFile, True)
trapfile.Close
TrapFileLabel.Caption = tFile
TrapFileWhole = tFile
TrapPathWhole = sFile
TrapFileLabel.Visible = True
Exit Sub
End If
Else
Set trapfile = fso.CreateTextFile(sFile, True)
trapfile.Close
TrapFileLabel.Caption = tFile
TrapFileWhole = tFile
TrapPathWhole = sFile
TrapFileLabel.Visible = True
Exit Sub
End If
TrapCancelError:
If TrapFileLabel.Caption = Empty Then
SuspendTrapOption = True
End If
Exit Sub
TrapSaveError:
MsgBox ("Error creating Trap file.")
End Sub
Private Sub ThresholdCheck_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If ThresholdCheck.Value = 0 Then
ThresholdCards.Text = Empty
End If
If ThresholdCheck.Value = 1 Then
TrapFrame.Enabled = True
SaveTrapOption.Enabled = True
SuspendTrapOption.Enabled = True
TrapFileLabel.Visible = True
SuspendTrapOption.Value = True
SuspendTrapWhole = True
Else
TrapFrame.Enabled = False
SaveTrapOption.Enabled = False
SuspendTrapOption.Enabled = False
TrapFileLabel.Visible = False
End If
End Sub