-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmMenu.frm
683 lines (516 loc) · 21.5 KB
/
frmMenu.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
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
VERSION 5.00
Begin VB.Form menuForm
BorderStyle = 0 'None
ClientHeight = 4395
ClientLeft = 0
ClientTop = 285
ClientWidth = 4290
ControlBox = 0 'False
Icon = "frmMenu.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4395
ScaleWidth = 4290
ShowInTaskbar = 0 'False
Visible = 0 'False
Begin VB.Menu mnuMainMenu
Caption = "mainmenu"
Begin VB.Menu mnuAbout
Caption = "About Saturn Cairo widget"
End
Begin VB.Menu mnuBlank5
Caption = "-"
End
Begin VB.Menu mnuProgramPreferences
Caption = "Widget Preferences"
End
Begin VB.Menu mnublank1
Caption = "-"
End
Begin VB.Menu mnuCoffee
Caption = "Donate a coffee with KoFi"
Index = 2
End
Begin VB.Menu blank7
Caption = ""
End
Begin VB.Menu mnuHelpSplash
Caption = "Saturn One-Page Help"
End
Begin VB.Menu mnuOnline
Caption = "Online Help and other options"
Begin VB.Menu mnuWidgets
Caption = "See the other widgets"
End
Begin VB.Menu mnuLatest
Caption = "Download Latest Version from Github"
End
Begin VB.Menu mnuSupport
Caption = "Contact Support"
End
Begin VB.Menu mnuFacebook
Caption = "Chat about the widget on Facebook"
End
Begin VB.Menu mnuHelpHTM
Caption = "Open Help CHM"
End
End
Begin VB.Menu mnuLicence
Caption = "Display Licence Agreement"
End
Begin VB.Menu blank2
Caption = ""
End
Begin VB.Menu mnuAppFolder
Caption = "Reveal Widget in Windows Explorer"
End
Begin VB.Menu blank4
Caption = ""
End
Begin VB.Menu menuRestart
Caption = "Reload Widget (F5)"
End
Begin VB.Menu mnuEditWidget
Caption = "Edit Widget using..."
End
Begin VB.Menu mnuSwitchOff
Caption = "Switch off my functions"
End
Begin VB.Menu mnuTurnFunctionsOn
Caption = "Turn all functions ON"
End
Begin VB.Menu mnuseparator1
Caption = "-"
End
Begin VB.Menu mnuLockWidget
Caption = "Lock Widget"
End
Begin VB.Menu mnuHideWidget
Caption = "Hide Widget"
End
Begin VB.Menu mnuQuit
Caption = "Close Widget"
End
End
End
Attribute VB_Name = "menuForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'---------------------------------------------------------------------------------------
' Procedure : Form_Load
' Author : beededea
' Date : 07/04/2020
' Purpose : The main dock won't take a menu when using GDI so we have a separate form for the menu
'---------------------------------------------------------------------------------------
'
Private Sub Form_Load()
On Error GoTo Form_Load_Error
Me.Width = 1 ' the menu form is made as small as possible and moved off screen so that it does not show anywhere on the
Me.Height = 1 ' screen, the menu appearing at the cursor point when it is told to do so by the dock form mousedown.
'Me.ControlBox = False ' design time properties set in the IDE
'Me.ShowInTaskbar = False ' set in the IDE ' NOTE: is possible in RC forms at runtime
'Me.MaxButton = False ' set in the IDE
'Me.MinButton = False ' set in the IDE
Me.Visible = False
On Error GoTo 0
Exit Sub
Form_Load_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Form_Load of Form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : menuRestart_Click
' Author : beededea
' Date : 03/05/2023
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub menuRestart_Click()
On Error GoTo menuRestart_Click_Error
Call reloadWidget
On Error GoTo 0
Exit Sub
menuRestart_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure menuRestart_Click of Form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuAppFolder_Click
' Author : beededea
' Date : 05/05/2023
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub mnuAppFolder_Click()
Dim folderPath As String: folderPath = vbNullString
Dim execStatus As Long: execStatus = 0
On Error GoTo mnuAppFolder_Click_Error
folderPath = App.Path
If fDirExists(folderPath) Then ' if it is a folder already
execStatus = ShellExecute(Me.hwnd, "open", folderPath, vbNullString, vbNullString, 1)
If execStatus <= 32 Then MsgBox "Attempt to open folder failed."
Else
MsgBox "Having a bit of a problem opening a folder for this widget - " & folderPath & " It doesn't seem to have a valid working directory set.", "Saturn Widget Confirmation Message", vbOKOnly + vbExclamation
'MessageBox Me.hWnd, "Having a bit of a problem opening a folder for that command - " & sCommand & " It doesn't seem to have a valid working directory set.", "Saturn Gauge Confirmation Message", vbOKOnly + vbExclamation
End If
On Error GoTo 0
Exit Sub
mnuAppFolder_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuAppFolder_Click of Form menuForm"
End Sub
Private Sub mnublank1_Click()
'Call mnuAbout_Click
End Sub
Private Sub mnuBlank2_Click()
'Call mnuIconSettings_Click_Event
End Sub
Private Sub mnublnk_Click()
'Call mnusettings_Click
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuEditWidget_Click
' Author : beededea
' Date : 05/05/2023
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub mnuEditWidget_Click()
Dim editorPath As String: editorPath = vbNullString
Dim execStatus As Long: execStatus = 0
On Error GoTo mnuEditWidget_Click_Error
editorPath = PrDefaultEditor
If fFExists(editorPath) Then ' if it is a folder already
'''If debugflg = 1 Then msgBox "ShellExecute " & sCommand
' run the selected program
execStatus = ShellExecute(Me.hwnd, "open", editorPath, vbNullString, vbNullString, 1)
If execStatus <= 32 Then MsgBox "Attempt to open the IDE for this widget failed."
Else
MsgBox "Having a bit of a problem opening an IDE for this widgt - " & editorPath & " It doesn't seem to have a valid working directory set."
'MessageBox Me.hWnd, "Having a bit of a problem opening a folder for that command - " & sCommand & " It doesn't seem to have a valid working directory set.", "Saturn Widget Confirmation Message", vbOKOnly + vbExclamation
End If
On Error GoTo 0
Exit Sub
mnuEditWidget_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuEditWidget_Click of Form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuHelpHTM_Click
' Author : beededea
' Date : 14/05/2023
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub mnuHelpHTM_Click()
On Error GoTo mnuHelpHTM_Click_Error
If fFExists(App.Path & "\help\Help.chm") Then
Call ShellExecute(Me.hwnd, "Open", App.Path & "\help\Help.chm", vbNullString, App.Path, 1)
Else
MsgBox ("The help file - Saturn.html.html- is missing from the help folder.")
End If
On Error GoTo 0
Exit Sub
mnuHelpHTM_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuHelpHTM_Click of Form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuHelpPdf_Click
' Author : beededea
' Date : 14/05/2023
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub mnuHelpSplash_Click()
Dim fileToPlay As String: fileToPlay = vbNullString
On Error GoTo mnuHelpPdf_Click_Error
fileToPlay = "till.wav"
If PrEnableSounds = "1" And fFExists(App.Path & "\resources\sounds\" & fileToPlay) Then
PlaySound App.Path & "\resources\sounds\" & fileToPlay, ByVal 0&, SND_FILENAME Or SND_ASYNC
End If
helpForm.Top = (screenHeightTwips / 2) - (helpForm.Height / 2)
helpForm.Left = (screenWidthTwips / 2) - (helpForm.Width / 2)
helpForm.show
If (helpForm.WindowState = 1) Then
helpForm.WindowState = 0
End If
On Error GoTo 0
Exit Sub
mnuHelpPdf_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuHelpPdf_Click of Form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuHideWidget_Click
' Author : beededea
' Date : 14/05/2023
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub mnuHideWidget_Click()
On Error GoTo mnuHideWidget_Click_Error
saturnWidget.Hidden = True
frmTimer.revealWidgetTimer.Enabled = True
PrWidgetHidden = "1"
' we have to save the value here
sPutINISetting softwarePlanet, "widgetHidden", PrWidgetHidden, StSettingsFile
On Error GoTo 0
Exit Sub
mnuHideWidget_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuHideWidget_Click of Form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuLockWidget_Click
' Author : beededea
' Date : 05/05/2023
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub mnuLockWidget_Click()
Dim fileToPlay As String: fileToPlay = vbNullString
On Error GoTo mnuLockWidget_Click_Error
fileToPlay = "lock.wav"
If PrEnableSounds = "1" And fFExists(App.Path & "\resources\sounds\" & fileToPlay) Then
PlaySound App.Path & "\resources\sounds\" & fileToPlay, ByVal 0&, SND_FILENAME Or SND_ASYNC
End If
If PrPreventDragging = "1" Then
mnuLockWidget.Checked = False
PrPreventDragging = "0"
saturnWidget.Locked = False
planetPrefs.chkPreventDragging.Value = 0
Else
mnuLockWidget.Checked = True
saturnWidget.Locked = 1
PrPreventDragging = "1"
planetPrefs.chkPreventDragging.Value = 1
End If
sPutINISetting softwarePlanet, "preventDragging", PrPreventDragging, StSettingsFile
On Error GoTo 0
Exit Sub
mnuLockWidget_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuLockWidget_Click_Error of Form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuProgramPreferences_Click
' Author : beededea
' Date : 07/05/2023
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub mnuProgramPreferences_Click()
On Error GoTo mnuProgramPreferences_Click_Error
Call makeProgramPreferencesAvailable
On Error GoTo 0
Exit Sub
mnuProgramPreferences_Click_Error:
With Err
If .Number <> 0 Then
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuProgramPreferences_Click of Form menuForm"
Resume Next
End If
End With
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuQuit_Click
' Author : beededea
' Date : 07/04/2020
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub mnuQuit_Click()
On Error GoTo mnuQuit_Click_Error
Call saturnForm_Unload
On Error GoTo 0
Exit Sub
mnuQuit_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuQuit_Click of Form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuCoffee_Click
' Author : beededea
' Date : 13/02/2019
' Purpose : main menu item to buy the developer a coffee
'---------------------------------------------------------------------------------------
'
Private Sub mnuCoffee_Click(Index As Integer)
Call mnuCoffee_ClickEvent
On Error GoTo 0
Exit Sub
mnuCoffee_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuCoffee_Click of form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuFacebook_Click
' Author : beededea
' Date : 14/02/2019
' Purpose :
'---------------------------------------------------------------------------------------
'
Public Sub mnuFacebook_Click()
Dim answer As VbMsgBoxResult
On Error GoTo mnuFacebook_Click_Error
'''If debugflg = 1 Then msgBox "%" & "mnuFacebook_Click"
answer = MsgBox("Visiting the Facebook chat page - this button opens a browser window and connects to our Facebook chat page. Proceed?", vbExclamation + vbYesNo)
If answer = vbYes Then
Call ShellExecute(Me.hwnd, "Open", "http://www.facebook.com/profile.php?id=100012278951649", vbNullString, App.Path, 1)
End If
On Error GoTo 0
Exit Sub
mnuFacebook_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuFacebook_Click of form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuLatest_Click
' Author : beededea
' Date : 13/02/2019
' Purpose :
'---------------------------------------------------------------------------------------
'
Public Sub mnuLatest_Click()
Dim answer As VbMsgBoxResult: answer = vbNo
On Error GoTo mnuLatest_Click_Error
'''If debugflg = 1 Then msgBox "%" & "mnuLatest_Click"
'MsgBox "The download menu option is not yet enabled."
answer = MsgBox("Download latest version of the program from github - this button opens a browser window and connects to the widget download page where you can check and download the latest SETUP.EXE file). Proceed?", vbExclamation + vbYesNo)
If answer = vbYes Then
Call ShellExecute(Me.hwnd, "Open", "https://github.com/yereverluvinunclebert/Saturn-VB6-Widget/raw/main/Setup.exe", vbNullString, App.Path, 1)
End If
On Error GoTo 0
Exit Sub
mnuLatest_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuLatest_Click of form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuLicence_Click
' Author : beededea
' Date : 14/02/2019
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub mnuLicence_Click()
On Error GoTo mnuLicence_Click_Error
'''If debugflg = 1 Then msgBox "%" & "mnuLicence_Click"
Call mnuLicence_ClickEvent
On Error GoTo 0
Exit Sub
mnuLicence_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuLicence_Click of form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuSupport_Click
' Author : beededea
' Date : 13/02/2019
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub mnuSupport_Click()
On Error GoTo mnuSupport_Click_Error
Call mnuSupport_ClickEvent
On Error GoTo 0
Exit Sub
mnuSupport_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuSupport_Click of form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuSweets_Click
' Author : beededea
' Date : 13/02/2019
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub mnuSweets_Click()
Dim answer As VbMsgBoxResult
On Error GoTo mnuSweets_Click_Error
'''If debugflg = 1 Then msgBox "%" & "mnuSweets_Click"
answer = MsgBox(" Help support the creation of more widgets like this. Buy me a Kofi! This button opens a browser window and connects to Kofi donation page). Will you be kind and proceed?", vbExclamation + vbYesNo)
If answer = vbYes Then
Call ShellExecute(Me.hwnd, "Open", "https://www.ko-fi.com/yereverluvinunclebert", vbNullString, App.Path, 1)
End If
On Error GoTo 0
Exit Sub
mnuSweets_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuSweets_Click of form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuSwitchOff_Click
' Author : beededea
' Date : 05/05/2023
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub mnuSwitchOff_Click()
On Error GoTo mnuSwitchOff_Click_Error
'saturnWidget.Rotating = False
mnuSwitchOff.Checked = True
mnuTurnFunctionsOn.Checked = False
PrGaugeFunctions = "0"
sPutINISetting softwarePlanet, "gaugeFunctions", PrGaugeFunctions, StSettingsFile
On Error GoTo 0
Exit Sub
mnuSwitchOff_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuSwitchOff_Click of Form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuTurnFunctionsOn_Click
' Author : beededea
' Date : 05/05/2023
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub mnuTurnFunctionsOn_Click()
Dim fileToPlay As String: fileToPlay = vbNullString
On Error GoTo mnuTurnFunctionsOn_Click_Error
fileToPlay = "ting.wav"
If PrEnableSounds = "1" And fFExists(App.Path & "\resources\sounds\" & fileToPlay) Then
PlaySound App.Path & "\resources\sounds\" & fileToPlay, ByVal 0&, SND_FILENAME Or SND_ASYNC
End If
'saturnWidget.Rotating = True
mnuSwitchOff.Checked = False
mnuTurnFunctionsOn.Checked = True
PrGaugeFunctions = "1"
sPutINISetting softwarePlanet, "gaugeFunctions", PrGaugeFunctions, StSettingsFile
On Error GoTo 0
Exit Sub
mnuTurnFunctionsOn_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuTurnFunctionsOn_Click of Form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuWidgets_Click
' Author : beededea
' Date : 13/02/2019
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub mnuWidgets_Click()
Dim answer As VbMsgBoxResult
On Error GoTo mnuWidgets_Click_Error
'''If debugflg = 1 Then msgBox "%" & "mnuWidgets_Click"
answer = MsgBox(" This button opens a browser window and connects to the Steampunk widgets page on my site. Do you wish to proceed?", vbExclamation + vbYesNo)
If answer = vbYes Then
Call ShellExecute(Me.hwnd, "Open", "https://www.deviantart.com/yereverluvinuncleber/gallery/59981269/yahoo-widgets", vbNullString, App.Path, 1)
End If
On Error GoTo 0
Exit Sub
mnuWidgets_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuWidgets_Click of form menuForm"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : mnuAbout_Click
' Author : beededea
' Date : 13/02/2019
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub mnuAbout_Click()
On Error GoTo mnuAbout_Click_Error
Call aboutClickEvent
On Error GoTo 0
Exit Sub
mnuAbout_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure mnuAbout_Click of form menuForm"
End Sub
'Private Sub TimerMenu_Timer()
' TimerMenu.Enabled = False
' 'Me.PopupMenu mnuMainMenu
' Call menuForm.PopupMenu(menuForm.mnuMainMenu)
'
'End Sub