-
Notifications
You must be signed in to change notification settings - Fork 2
/
frmWindowFind.vb
400 lines (218 loc) · 9.59 KB
/
frmWindowFind.vb
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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
Option Strict Off
Option Explicit On
Imports VB = Microsoft.VisualBasic
Friend Class frmWindowFind
Inherits System.Windows.Forms.Form
Private m_strArray() As String
Private Sub cmdClose_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdClose.Click
Call Me.Close()
End Sub
Private Sub cmdDecide_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdDecide.Click
Dim i As Integer
ReDim m_strArray(0)
m_strArray(0) = ""
For i = 0 To UBound(g_Obj) - 1
With g_Obj(i)
If (optSearchAll.Checked = True Or .intSelect = modMain.OBJ_SELECT.Selected) And (Val(txtMeasureMin.Text) <= .intMeasure And Val(txtMeasureMax.Text) >= .intMeasure) And ((modInput.strToNum((txtNumMin.Text)) <= .sngValue And modInput.strToNum((txtNumMax.Text)) >= .sngValue) Or .intCh = 8 Or .intCh = 9) Then
.intSelect = modMain.OBJ_SELECT.NON_SELECT
Select Case .intCh
Case 8 'BPM
If _lstGrid_3.GetItemChecked(0) Then Call SearchProcess(i)
Case 9 'STOP
If _lstGrid_3.GetItemChecked(1) Then Call SearchProcess(i)
Case 11 To 15, 31 To 35, 51 To 55 '1P 1-5
If _lstGrid_0.GetItemChecked(.intCh Mod 10 - 1) Then Call SearchProcess(i)
Case 18, 19, 38, 39, 58, 59 '1P 6-7
If _lstGrid_0.GetItemChecked(.intCh Mod 10 - 3) Then Call SearchProcess(i)
Case 16, 36, 56 '1P SC
If _lstGrid_0.GetItemChecked(7) Then Call SearchProcess(i)
Case 21 To 25, 41 To 45, 61 To 65 '2P 1-5
If _lstGrid_1.GetItemChecked(.intCh Mod 10 - 1) Then Call SearchProcess(i)
Case 28, 29, 48, 49, 68, 69 '2P 6-7
If _lstGrid_1.GetItemChecked(.intCh Mod 10 - 3) Then Call SearchProcess(i)
Case 26, 46, 66 '2P SC
If _lstGrid_1.GetItemChecked(7) Then Call SearchProcess(i)
Case 4 'BGA
If _lstGrid_3.GetItemChecked(2) Then Call SearchProcess(i)
Case 7 'Layer
If _lstGrid_3.GetItemChecked(3) Then Call SearchProcess(i)
Case 6 'Poor
If _lstGrid_3.GetItemChecked(4) Then Call SearchProcess(i)
Case Is > 100 'BGM
If _lstGrid_2.GetItemChecked(.intCh - 101) Then Call SearchProcess(i)
End Select
Else
.intSelect = modMain.OBJ_SELECT.NON_SELECT
End If
End With
Next i
If optProcessDelete.Checked Then
Call frmMain.mnuEditDelete_Click(Nothing, New System.EventArgs())
ElseIf optProcessSelect.Checked Then
Call modDraw.MoveSelectedObj()
ElseIf optProcessReplace.Checked Then
If UBound(m_strArray) Then
Call g_InputLog.AddData(Join(m_strArray, modLog.getSeparator))
End If
End If
frmMain.picMain.Refresh()
End Sub
Private Sub cmdReset_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdReset.Click
Dim j As Integer
With _lstGrid_0
.Visible = False
For j = 0 To .Items.Count - 1
.SetItemChecked(j, False)
Next j
.SelectedIndex = 0
.Visible = True
End With
With _lstGrid_1
.Visible = False
For j = 0 To .Items.Count - 1
.SetItemChecked(j, False)
Next j
.SelectedIndex = 0
.Visible = True
End With
With _lstGrid_2
.Visible = False
For j = 0 To .Items.Count - 1
.SetItemChecked(j, False)
Next j
.SelectedIndex = 0
.Visible = True
End With
With _lstGrid_3
.Visible = False
For j = 0 To .Items.Count - 1
.SetItemChecked(j, False)
Next j
.SelectedIndex = 0
.Visible = True
End With
End Sub
Private Sub cmdInvert_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdInvert.Click
Dim j As Integer
With _lstGrid_0
.Visible = False
For j = 0 To .Items.Count - 1
.SetItemChecked(j, Not .GetItemChecked(j))
Next j
.SelectedIndex = 0
.Visible = True
End With
With _lstGrid_1
.Visible = False
For j = 0 To .Items.Count - 1
.SetItemChecked(j, Not .GetItemChecked(j))
Next j
.SelectedIndex = 0
.Visible = True
End With
With _lstGrid_2
.Visible = False
For j = 0 To .Items.Count - 1
.SetItemChecked(j, Not .GetItemChecked(j))
Next j
.SelectedIndex = 0
.Visible = True
End With
With _lstGrid_3
.Visible = False
For j = 0 To .Items.Count - 1
.SetItemChecked(j, Not .GetItemChecked(j))
Next j
.SelectedIndex = 0
.Visible = True
End With
End Sub
Private Sub cmdSelect_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdSelect.Click
Dim j As Integer
With _lstGrid_0
.Visible = False
For j = 0 To .Items.Count - 1
.SetItemChecked(j, True)
Next j
.SelectedIndex = 0
.Visible = True
End With
With _lstGrid_0
.Visible = False
For j = 0 To .Items.Count - 1
.SetItemChecked(j, True)
Next j
.SelectedIndex = 0
.Visible = True
End With
With _lstGrid_2
.Visible = False
For j = 0 To .Items.Count - 1
.SetItemChecked(j, True)
Next j
.SelectedIndex = 0
.Visible = True
End With
With _lstGrid_3
.Visible = False
For j = 0 To .Items.Count - 1
.SetItemChecked(j, True)
Next j
.SelectedIndex = 0
.Visible = True
End With
End Sub
'UPGRADE_WARNING: Form イベント frmWindowFind.Activate には新しい動作が含まれます。 詳細については、'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6BA9B8D2-2A32-4B6E-8D36-44949974A5B4"' をクリックしてください。
Private Sub frmWindowFind_Activated(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Activated
Call cmdDecide.Focus()
End Sub
Private Sub frmWindowFind_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
Dim i As Integer
For i = 2 To 32
Call _lstGrid_2.Items.Add(Format(i, "00"))
Next i
Call cmdSelect_Click(cmdSelect, New System.EventArgs())
_lstGrid_0.SelectedIndex = 0
_lstGrid_1.SelectedIndex = 0
_lstGrid_2.SelectedIndex = 0
_lstGrid_3.SelectedIndex = 0
End Sub
Private Sub txtMeasureMax_Enter(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles txtMeasureMax.Enter
txtMeasureMax.SelectionStart = 0
txtMeasureMax.SelectionLength = Len(txtMeasureMax.Text)
End Sub
Private Sub txtMeasureMin_Enter(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles txtMeasureMin.Enter
txtMeasureMin.SelectionStart = 0
txtMeasureMin.SelectionLength = Len(txtMeasureMin.Text)
End Sub
Private Sub txtNumMax_Enter(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles txtNumMax.Enter
txtNumMax.SelectionStart = 0
txtNumMax.SelectionLength = Len(txtNumMax.Text)
End Sub
Private Sub txtNumMin_Enter(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles txtNumMin.Enter
txtNumMin.SelectionStart = 0
txtNumMin.SelectionLength = Len(txtNumMin.Text)
End Sub
Private Sub txtReplace_Enter(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles txtReplace.Enter
optProcessReplace.Checked = True
txtReplace.SelectionStart = 0
txtReplace.SelectionLength = Len(txtReplace.Text)
End Sub
Private Sub SearchProcess(ByVal num As Integer)
With g_Obj(num)
If optProcessReplace.Checked Then
If .intCh <> 8 And .intCh <> 9 Then
m_strArray(UBound(m_strArray)) = modInput.strFromNum(modMain.CMD_LOG.OBJ_CHANGE) & modInput.strFromNum(.lngID, 4) & modInput.strFromNum(.sngValue) & VB.Right("0" & txtReplace.Text, 2)
ReDim Preserve m_strArray(UBound(m_strArray) + 1)
.sngValue = modInput.strToNum((txtReplace.Text))
End If
End If
.intSelect = modMain.OBJ_SELECT.Selected
End With
End Sub
Private Sub frmWindowFind_FormClosed(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
e.Cancel = True
Call Me.Hide()
Call frmMain.picMain.Focus()
End Sub
End Class