-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmTimer.frm
189 lines (155 loc) · 5.67 KB
/
frmTimer.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
VERSION 5.00
Begin VB.Form frmTimer
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
Icon = "frmTimer.frx":0000
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Visible = 0 'False
Begin VB.Timer settingsTimer
Enabled = 0 'False
Interval = 6000
Left = 90
Tag = "settingsTimer for reading external changes to prefs"
Top = 1095
End
Begin VB.Timer rotationTimer
Enabled = 0 'False
Interval = 2500
Left = 90
Top = 615
End
Begin VB.Timer revealWidgetTimer
Enabled = 0 'False
Interval = 5000
Left = 90
Top = 135
End
Begin VB.Label Label3
Caption = "Note: this invisible form is also the container for the large 128x128px project icon"
Height = 435
Left = 240
TabIndex = 3
Top = 2400
Width = 4125
End
Begin VB.Label Label2
Caption = "settingsTimer for reading external changes to prefs"
Height = 195
Left = 705
TabIndex = 2
Top = 1170
Width = 3645
End
Begin VB.Label Label1
Caption = "rotationTimer for handling rotation of the screen"
Height = 195
Left = 690
TabIndex = 1
Top = 735
Width = 3570
End
Begin VB.Label Label
Caption = "revealWidgetTimer for revealing after a hide."
Height = 195
Left = 690
TabIndex = 0
Top = 270
Width = 3480
End
End
Attribute VB_Name = "frmTimer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'---------------------------------------------------------------------------------------
' Procedure : revealWidgetTimer_Timer
' Author : beededea
' Date : 05/05/2023
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub revealWidgetTimer_Timer()
On Error GoTo revealWidgetTimer_Timer_Error
revealWidgetTimerCount = revealWidgetTimerCount + 1
If revealWidgetTimerCount >= (minutesToHide * 12) Then
revealWidgetTimerCount = 0
planetWidget.Hidden = False
revealWidgetTimer.Enabled = False
gblPlWidgetHidden = "0"
sPutINISetting softwarePlanet, "widgetHidden", gblPlWidgetHidden, gblPlSettingsFile
End If
On Error GoTo 0
Exit Sub
revealWidgetTimer_Timer_Error:
With Err
If .Number <> 0 Then
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure revealWidgetTimer_Timer of Form frmTimer"
Resume Next
End If
End With
End Sub
'---------------------------------------------------------------------------------------
' Procedure : rotationTimer_Timer
' Author : beededea
' Date : 05/05/2023
' Purpose : for handling rotation of the screen in tablet mode
'---------------------------------------------------------------------------------------
'
Private Sub rotationTimer_Timer()
On Error GoTo rotationTimer_Timer_Error
screenHeightPixels = GetDeviceCaps(menuForm.hdc, VERTRES) ' we use the name of any form currently loaded
screenWidthPixels = GetDeviceCaps(menuForm.hdc, HORZRES)
' will be used to check for orientation changes
If (oldScreenHeightPixels <> screenHeightPixels) Or (oldScreenWidthPixels <> screenWidthPixels) Then
' move/hide onto/from the main screen
Call mainScreen
'store the resolution change
oldScreenHeightPixels = screenHeightPixels
oldScreenWidthPixels = screenWidthPixels
End If
On Error GoTo 0
Exit Sub
rotationTimer_Timer_Error:
With Err
If .Number <> 0 Then
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure rotationTimer_Timer of Form frmTimer"
Resume Next
End If
End With
End Sub
'---------------------------------------------------------------------------------------
' Procedure : settingsTimer_Timer
' Author : beededea
' Date : 13/05/2023
' Purpose : if the unhide setting is set by another process it will unhide the widget
'---------------------------------------------------------------------------------------
'
Private Sub settingsTimer_Timer()
On Error GoTo settingsTimer_Timer_Error
gblPlUnhide = fGetINISetting(softwarePlanet, "unhide", gblPlSettingsFile)
If gblPlUnhide = "true" Then
planetWidget.Hidden = False
sPutINISetting softwarePlanet, "unhide", vbNullString, gblPlSettingsFile
End If
On Error GoTo 0
Exit Sub
settingsTimer_Timer_Error:
With Err
If .Number <> 0 Then
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure settingsTimer_Timer of Form frmTimer"
Resume Next
End If
End With
End Sub
'Private Sub TimerMenu_Timer()
' TimerMenu.Enabled = False
' Call menuForm.PopupMenu(menuForm.mnuMainMenu)
'End Sub