-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathfrmOptions.frm
559 lines (468 loc) · 15.3 KB
/
frmOptions.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
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
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
VERSION 5.00
Begin VB.Form frmOptions
BorderStyle = 3 'Fixed Dialog
Caption = "ViOrb Options"
ClientHeight = 5670
ClientLeft = 45
ClientTop = 375
ClientWidth = 7260
BeginProperty Font
Name = "Tahoma"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmOptions.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 378
ScaleMode = 3 'Pixel
ScaleWidth = 484
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.Timer timDelayRefresh
Enabled = 0 'False
Interval = 1
Left = 4200
Top = 1560
End
Begin VB.Timer timDelayMoveMode
Enabled = 0 'False
Interval = 1
Left = 4080
Top = 960
End
Begin VB.CommandButton cmdDelete
Caption = "&Delete"
Height = 495
Left = 1440
TabIndex = 18
Top = 3000
Width = 1095
End
Begin VB.CommandButton cmdBrowse
Caption = "&Browse"
Height = 495
Left = 2640
TabIndex = 17
Top = 3000
Width = 1095
End
Begin VB.CommandButton cmdMore
Caption = "&Get More"
Height = 495
Left = 240
TabIndex = 16
Top = 3000
Width = 1095
End
Begin VB.CheckBox chkSpoof
Caption = "Spoof ViOrb as ViGlance Orb to maintain compatability with other ViApps"
Height = 255
Left = 240
TabIndex = 14
Top = 4800
Width = 6975
End
Begin VB.CheckBox chkManual
Caption = "Manually Position Orb"
Height = 255
Left = 240
TabIndex = 12
Top = 4320
Width = 2895
End
Begin VB.CommandButton cmdNudgeUp
Caption = "é"
CausesValidation= 0 'False
BeginProperty Font
Name = "Wingdings"
Size = 9
Charset = 2
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4800
TabIndex = 6
Top = 720
Width = 1575
End
Begin VB.CommandButton cmdNudgeBottom
Caption = "ê"
CausesValidation= 0 'False
BeginProperty Font
Name = "Wingdings"
Size = 9
Charset = 2
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4800
TabIndex = 5
Top = 2880
Width = 1575
End
Begin VB.CommandButton cmdNudgeRight
Caption = "è"
CausesValidation= 0 'False
BeginProperty Font
Name = "Wingdings"
Size = 9
Charset = 2
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1575
Left = 6480
TabIndex = 4
Top = 1200
Width = 375
End
Begin VB.CommandButton cmdNudgeLeft
Caption = "ç"
CausesValidation= 0 'False
BeginProperty Font
Name = "Wingdings"
Size = 9
Charset = 2
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1575
Left = 4320
TabIndex = 3
Top = 1200
Width = 375
End
Begin VB.CheckBox chkStart
Caption = "Start With Windows"
Height = 375
Left = 240
TabIndex = 2
Top = 3720
Width = 2895
End
Begin VB.FileListBox flSkins
Appearance = 0 'Flat
Height = 2340
Left = 240
Pattern = "*.png"
TabIndex = 1
Top = 600
Width = 3495
End
Begin VB.Label Label3
Caption = "Don't adjust this setting unless you understand it."
BeginProperty Font
Name = "Tahoma"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 15
Top = 5160
Width = 6735
End
Begin VB.Label Label2
Caption = "Remember to makesure that 'manually position orb' is unchecked if you want to enable the nudge feature."
Height = 975
Left = 3960
TabIndex = 13
Top = 3600
Width = 3135
End
Begin VB.Label Label6
Caption = "Nudge Orb Tool"
Height = 375
Left = 4080
TabIndex = 11
Top = 240
Width = 2295
End
Begin VB.Label lblTop
Alignment = 2 'Center
Caption = "0"
BeginProperty Font
Name = "Tahoma"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5280
TabIndex = 10
Top = 1200
Width = 615
End
Begin VB.Label lblBottom
Alignment = 2 'Center
Caption = "0"
BeginProperty Font
Name = "Tahoma"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5280
TabIndex = 9
Top = 2400
Width = 615
End
Begin VB.Label lblRight
Alignment = 1 'Right Justify
Caption = "0"
BeginProperty Font
Name = "Tahoma"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5760
TabIndex = 8
Top = 1800
Width = 495
End
Begin VB.Label lblLeft
Caption = "0"
BeginProperty Font
Name = "Tahoma"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4920
TabIndex = 7
Top = 1800
Width = 495
End
Begin VB.Label Label1
Caption = "Select start button"
Height = 375
Left = 240
TabIndex = 0
Top = 240
Width = 2295
End
End
Attribute VB_Name = "frmOptions"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'--------------------------------------------------------------------------------
' Component : frmOptions
' Project : ViOrb5
'
' Description: Provides program options for ViOrb such as skin and startup
' options
'
' Modified :
'--------------------------------------------------------------------------------
Option Explicit
Private Const StartWithWindowsRegistryPath As String = "HKCU\Software\Microsoft\Windows\CurrentVersion\Run\"
Private m_ignoreInput As Boolean 'when true, events are effectively ignored when fired on controls
Sub ForceRefresh()
Unload frmStartButton
Unload frmZOrderKeeper
Unload frmFader
Set frmZOrderKeeper = Nothing
Set frmStartButton = Nothing
Set frmFader = Nothing
frmZOrderKeeper.Show
UpdateCaptions
End Sub
Sub SelectedSkinByName(ByVal theSkinName As String)
On Error GoTo Handler
If theSkinName = vbNullString Then
Exit Sub
End If
Dim skinIndex As Long
For skinIndex = 0 To flSkins.ListCount
If UCase$(flSkins.List(skinIndex)) = UCase$(theSkinName) Then
flSkins.Selected(skinIndex) = True
End If
Next
Exit Sub
Handler:
LogError 0, Err.Description, "frmOptions"
End Sub
Sub TestStartWithWindows()
m_ignoreInput = True 'this is a very crude way to block events when programatically changing control properties
chkStart.Value = vbUnchecked
If UCase$(RegistryHelper.ReadKeyString(StartWithWindowsRegistryPath & App.Title)) = UCase$(App.Path & "\" & App.EXEName & ".exe") Then
chkStart.Value = vbChecked
End If
m_ignoreInput = False
End Sub
Sub UpdateCaptions()
lblLeft.Caption = frmStartButton.NudgeX
lblRight.Caption = 0 - frmStartButton.NudgeX
lblTop.Caption = frmStartButton.NudgeY
lblBottom.Caption = 0 - frmStartButton.NudgeY
m_ignoreInput = True 'this is a very crude way to block events when programatically changing control properties
If frmStartButton.ManualPosition Then
chkManual.Value = vbChecked
cmdNudgeLeft.Enabled = False
cmdNudgeRight.Enabled = False
cmdNudgeUp.Enabled = False
cmdNudgeBottom.Enabled = False
Else
chkManual.Value = vbUnchecked
cmdNudgeLeft.Enabled = True
cmdNudgeRight.Enabled = True
cmdNudgeUp.Enabled = True
cmdNudgeBottom.Enabled = True
End If
m_ignoreInput = False
End Sub
Sub cmdBrowse_Click()
Dim selectedFile As Scripting.File
Dim szSelectedFile As String
Dim szProposedFileName As String
Dim copyNumber As Long
szSelectedFile = BrowseForFile(0, "Portable Network Graphics;*.png", "Choose New Start Orb Image", Me.hWnd)
If Not FSO.FileExists(szSelectedFile) Then
Exit Sub
End If
Set selectedFile = FSO.GetFile(szSelectedFile)
szProposedFileName = selectedFile.Name
While FSO.FileExists(App.Path & "\Resources\" & szProposedFileName)
copyNumber = copyNumber + 1
szProposedFileName = FSO.GetBaseName(szSelectedFile) & "(" & copyNumber & ").png"
Wend
selectedFile.Copy App.Path & "\Resources\" & szProposedFileName, False
flSkins.Refresh
SelectedSkinByName szProposedFileName
End Sub
Private Sub chkManual_Click()
If m_ignoreInput Then Exit Sub
If chkManual.Value = vbUnchecked Then
If IsWindow(TaskbarHelper.g_StartButtonHwnd) = APIFALSE Then
If IsWindow(TaskbarHelper.g_viOrbToolbar) = APIFALSE Then
frmInstall.Show vbModal
End If
If IsWindow(TaskbarHelper.g_viOrbToolbar) = APIFALSE Then
chkManual.Value = vbChecked
Exit Sub
End If
frmZOrderKeeper.HijackZOrder
End If
frmStartButton.ResetPosition
Else
If IsWindow(TaskbarHelper.g_viOrbToolbar) = APITRUE Then
MsgBox "Remove the 'Start' Toolbar from your taskbar first." & vbCrLf & "Right click taskbar, Toolbars > 'Start'", vbCritical
chkManual.Value = vbUnchecked
Exit Sub
End If
frmStartButton.ActivateMoveMode
End If
End Sub
Private Sub chkSpoof_Click()
If m_ignoreInput Then Exit Sub
If chkSpoof.Value = vbUnchecked Then
frmStartButton.Caption = MainHelper.ViOrb_Identifier
Else
frmStartButton.Caption = MainHelper.ViGlance_Identifier
End If
End Sub
Private Sub chkStart_Click()
If m_ignoreInput Then Exit Sub
If chkStart.Value = vbChecked Then
RegistryHelper.WriteRegistryString StartWithWindowsRegistryPath & App.Title, App.Path & "\" & App.EXEName & ".exe"
Else
RegistryHelper.DeleteKey App.Path & "\" & App.EXEName & ".exe"
End If
End Sub
Private Sub cmdDelete_Click()
Dim szFilename As String
szFilename = flSkins.List(flSkins.ListIndex)
If LCase$(szFilename) = LCase$(Default_Orb_Name) Then
Exit Sub
End If
SelectedSkinByName Default_Orb_Name
If Not flSkins.List(flSkins.ListIndex) = Default_Orb_Name Then Exit Sub
If Not FSO.FileExists(App.Path & "\Resources\" & szFilename) Then Exit Sub
If MsgBox("Do you really want to delete, " & szFilename & "?", vbQuestion Or vbYesNo) = vbNo Then
Exit Sub
End If
FSO.DeleteFile App.Path & "\Resources\" & szFilename, True
flSkins.Refresh
Me.Show
End Sub
Private Sub cmdMore_Click()
Call ShellExecute(Me.hWnd, vbNullString, "http://lee-soft.com/skins/", vbNullString, App.Path, 0)
End Sub
Private Sub cmdNudgeBottom_Click()
frmStartButton.NudgeY = frmStartButton.NudgeY + 1
UpdateCaptions
End Sub
Private Sub cmdNudgeLeft_Click()
frmStartButton.NudgeX = frmStartButton.NudgeX - 1
UpdateCaptions
End Sub
Private Sub cmdNudgeRight_Click()
frmStartButton.NudgeX = frmStartButton.NudgeX + 1
UpdateCaptions
End Sub
Private Sub cmdNudgeUp_Click()
frmStartButton.NudgeY = frmStartButton.NudgeY - 1
UpdateCaptions
End Sub
Private Sub flSkins_Click()
If m_ignoreInput Then Exit Sub
RegistryHelper.WriteRegistryString AppSettingsRegistryPath & "filename", flSkins.List(flSkins.ListIndex)
ForceRefresh
End Sub
Private Sub Form_Activate()
UpdateCaptions
End Sub
Private Sub Form_Load()
flSkins.Path = App.Path & "\Resources\"
TestStartWithWindows
If frmStartButton.Caption = MainHelper.ViGlance_Identifier Then
chkSpoof.Value = vbChecked
End If
UpdateCaptions
End Sub
Private Sub timDelayMoveMode_Timer()
timDelayMoveMode.Enabled = False
frmStartButton.ActivateMoveMode
End Sub
Private Sub timDelayRefresh_Timer()
timDelayRefresh.Enabled = False
ForceRefresh
End Sub