-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmMain.frm
1856 lines (1677 loc) · 64 KB
/
frmMain.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
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "Mscomct2.ocx"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form frmMain
AutoRedraw = -1 'True
BorderStyle = 3 'Fixed Dialog
Caption = "Hours and Minutes"
ClientHeight = 6150
ClientLeft = 45
ClientTop = 330
ClientWidth = 9060
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmMain.frx":0000
LinkTopic = "Hours and Minutes"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 410
ScaleMode = 3 'Pixel
ScaleWidth = 604
StartUpPosition = 2 'CenterScreen
Begin VB.Timer ctlSwitchModeTimer_NewStyle
Enabled = 0 'False
Interval = 100
Left = 5400
Top = 60
End
Begin HoursAndMinutes.ctlWebbyButton wbTabs
Height = 315
Index = 0
Left = 120
TabIndex = 35
Top = 1605
Width = 1980
_ExtentX = 3493
_ExtentY = 556
Caption = "Preferences"
End
Begin MSComDlg.CommonDialog ctlDialog
Left = 7050
Top = 30
_ExtentX = 847
_ExtentY = 847
_Version = 393216
CancelError = -1 'True
DialogTitle = "Save Backup As"
Filter = "Registration Files|*.reg"
End
Begin VB.Timer ctlModeTimer
Enabled = 0 'False
Interval = 1000
Left = 6300
Top = 60
End
Begin VB.Timer ctlSwitchModeTimer
Enabled = 0 'False
Interval = 100
Left = 5850
Top = 60
End
Begin HoursAndMinutes.ctlTray ctlTray
Left = 6780
Top = 240
_ExtentX = 423
_ExtentY = 423
End
Begin VB.Frame ctlTabsPages
BackColor = &H00FFFFFF&
BorderStyle = 0 'None
Height = 4590
Index = 2
Left = 2340
TabIndex = 25
Top = 1200
Width = 6540
Visible = 0 'False
Begin VB.ListBox lstStatModes
Height = 2295
IntegralHeight = 0 'False
Left = 120
Style = 1 'Checkbox
TabIndex = 46
Top = 960
Width = 6225
End
Begin VB.CommandButton btnStatPlugins
Caption = "&Plugins >>"
Height = 345
Left = 4965
TabIndex = 14
Top = 4020
Width = 1365
End
Begin VB.CommandButton btnStatCreate
Caption = "&Create"
Height = 345
Left = 3495
TabIndex = 13
Top = 4020
Width = 1365
End
Begin MSComCtl2.DTPicker dteStatStartDate
Height = 315
Left = 810
TabIndex = 11
Top = 3450
Width = 1425
_ExtentX = 2514
_ExtentY = 556
_Version = 393216
CalendarBackColor= 16777215
CalendarForeColor= 0
CalendarTitleBackColor= 16777215
CalendarTitleForeColor= 0
CalendarTrailingForeColor= 0
Format = 23527425
UpDown = -1 'True
CurrentDate = 37101
End
Begin MSComCtl2.DTPicker dteStatEndDate
Height = 315
Left = 2865
TabIndex = 12
Top = 3450
Width = 1425
_ExtentX = 2514
_ExtentY = 556
_Version = 393216
CalendarBackColor= 16777215
CalendarForeColor= 0
CalendarTitleBackColor= 16777215
CalendarTitleForeColor= 0
CalendarTrailingForeColor= 0
Format = 23527425
UpDown = -1 'True
CurrentDate = 37101
End
Begin VB.Label Label9
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "until"
Height = 195
Left = 2385
TabIndex = 47
Top = 3510
Width = 300
End
Begin VB.Label lblPluginLink
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "plugin"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 195
Left = 1815
MouseIcon = "frmMain.frx":000C
MousePointer = 99 'Custom
TabIndex = 32
ToolTipText = "Download Plugins"
Top = 405
Width = 420
End
Begin VB.Label Label13
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "&Period:"
Height = 195
Left = 120
TabIndex = 10
Top = 3510
Width = 510
End
Begin VB.Label Label12
BackStyle = 0 'Transparent
Caption = "Show only time related with the following &task(s):"
Height = 240
Left = 120
TabIndex = 9
Top = 720
Width = 3600
End
Begin VB.Label Label11
BackStyle = 0 'Transparent
Caption = $"frmMain.frx":0316
Height = 480
Left = 120
TabIndex = 26
Top = 210
Width = 6225
End
End
Begin VB.Frame ctlTabsPages
BackColor = &H00FFFFFF&
BorderStyle = 0 'None
Height = 4590
Index = 3
Left = 2340
TabIndex = 28
Top = 1200
Width = 6540
Begin VB.CommandButton btnRegister
Caption = "Register"
Height = 345
Left = 5220
TabIndex = 17
Top = 3240
Width = 1125
End
Begin VB.TextBox txtRegCode
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
ForeColor = &H00000000&
Height = 1845
Left = 120
MultiLine = -1 'True
TabIndex = 16
Top = 1290
Width = 6225
End
Begin VB.Label lblMarmaladeMoon
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Marmalade Moon"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 195
Left = 4800
MouseIcon = "frmMain.frx":03A4
MousePointer = 99 'Custom
TabIndex = 33
Top = 405
Width = 1215
End
Begin VB.Label lblRegNote
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Note: Your license is personal, sharing the license to others is strictly forbidden!"
Height = 195
Left = 120
TabIndex = 31
Top = 3210
Width = 5730
Visible = 0 'False
End
Begin VB.Label lblRegisteredTo
BackStyle = 0 'Transparent
Caption = "&License:"
Height = 240
Left = 120
TabIndex = 15
Top = 1065
Width = 3300
End
Begin VB.Label Label16
BackStyle = 0 'Transparent
Caption = "Copyright © 2001 by Port Jackson Computing. All icons from the Marmalade Moon. Used by permission. Artist Kate England."
Height = 465
Left = 120
TabIndex = 30
Top = 405
Width = 6105
End
Begin VB.Label lblVersion
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Port Jackson's...."
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 195
Left = 120
MouseIcon = "frmMain.frx":06AE
MousePointer = 99 'Custom
TabIndex = 29
ToolTipText = "Download Updates"
Top = 210
Width = 1260
End
End
Begin VB.Frame ctlTabsPages
BackColor = &H00FFFFFF&
BorderStyle = 0 'None
Height = 4590
Index = 0
Left = 2340
TabIndex = 18
Top = 1200
Width = 6540
Begin VB.CheckBox chkAutocomment
BackColor = &H00FFFFFF&
Caption = "&Create comments automatically when switching between tasks."
ForeColor = &H00000000&
Height = 225
Left = 120
TabIndex = 34
Top = 3555
Width = 5115
End
Begin VB.CheckBox chkRemindNewStyle
BackColor = &H00FFFFFF&
Caption = "Us&e new style task-switch reminder."
ForeColor = &H00000000&
Height = 255
Left = 120
TabIndex = 7
Top = 3195
Value = 1 'Checked
Width = 3870
End
Begin VB.TextBox txtMIdle
BackColor = &H00FFFFFF&
ForeColor = &H00000000&
Height = 300
Left = 2040
TabIndex = 1
Text = "5"
Top = 540
Width = 570
End
Begin VB.CheckBox chkMIdle
BackColor = &H00FFFFFF&
Caption = "&Stop monitoring after"
ForeColor = &H00000000&
Height = 225
Left = 120
MaskColor = &H00FFFFFF&
TabIndex = 0
Top = 585
Value = 1 'Checked
Width = 1890
End
Begin VB.CheckBox chkMSave
BackColor = &H00FFFFFF&
Caption = "A&utosave every"
ForeColor = &H00000000&
Height = 225
Left = 105
TabIndex = 3
Top = 1545
Value = 1 'Checked
Width = 1890
End
Begin VB.TextBox txtMSave
BackColor = &H00FFFFFF&
ForeColor = &H00000000&
Height = 300
Left = 2040
TabIndex = 4
Text = "15"
Top = 1500
Width = 570
End
Begin VB.CheckBox chkModes
BackColor = &H00FFFFFF&
Caption = "&Remind me to select task when I go active."
ForeColor = &H00000000&
Height = 330
Left = 120
TabIndex = 6
Top = 2805
Value = 1 'Checked
Width = 5070
End
Begin MSComCtl2.UpDown upMIdle
Height = 300
Left = 2610
TabIndex = 2
Top = 540
Width = 240
_ExtentX = 423
_ExtentY = 529
_Version = 393216
Value = 1
BuddyControl = "txtMIdle"
BuddyDispid = 196640
OrigLeft = 3270
OrigTop = 945
OrigRight = 3510
OrigBottom = 1245
Max = 30
Min = 1
SyncBuddy = -1 'True
BuddyProperty = 65547
Enabled = -1 'True
End
Begin MSComCtl2.UpDown upMSave
Height = 300
Left = 2610
TabIndex = 5
Top = 1485
Width = 240
_ExtentX = 423
_ExtentY = 529
_Version = 393216
Value = 1
BuddyControl = "txtMSave"
BuddyDispid = 196643
OrigLeft = 3315
OrigTop = 945
OrigRight = 3555
OrigBottom = 1245
Max = 60
Min = 1
SyncBuddy = -1 'True
BuddyProperty = 65547
Enabled = -1 'True
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "idle minutes"
Height = 195
Left = 2970
TabIndex = 23
Top = 585
Width = 825
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "What would you like Hours and Minutes to do when you're inactive?"
Height = 195
Left = 120
TabIndex = 22
Top = 210
Width = 4845
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Do you want Hours and Minutes to autosave your data as a precaution?"
Height = 195
Left = 120
TabIndex = 21
Top = 1170
Width = 5190
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "minutes"
Height = 195
Left = 2970
TabIndex = 20
Top = 1545
Width = 555
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = $"frmMain.frx":09B8
Height = 435
Left = 120
TabIndex = 19
Top = 2295
Width = 6240
End
End
Begin VB.Frame ctlTabsPages
BackColor = &H00FFFFFF&
BorderStyle = 0 'None
Height = 4590
Index = 1
Left = 2340
TabIndex = 24
Top = 1200
Width = 6540
Visible = 0 'False
Begin MSComctlLib.ListView lstReminders
Height = 3630
Left = 120
TabIndex = 8
Top = 735
Width = 6225
_ExtentX = 10980
_ExtentY = 6403
View = 3
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = 0 'False
HideColumnHeaders= -1 'True
FlatScrollBar = -1 'True
FullRowSelect = -1 'True
_Version = 393217
ForeColor = 0
BackColor = 16777215
BorderStyle = 1
Appearance = 0
NumItems = 3
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "When"
Object.Width = 2822
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "What"
Object.Width = 8062
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "Last Run"
Object.Width = 0
EndProperty
End
Begin VB.Label Label15
BackStyle = 0 'Transparent
Caption = "Reminders are useful for remembering important dates, or to help you remember different tasks. (Rightclick for options)"
Height = 420
Left = 120
TabIndex = 27
Top = 210
Width = 6135
End
End
Begin VB.Frame ctlTabsPages
BackColor = &H00FFFFFF&
BorderStyle = 0 'None
Caption = "Frame1"
Height = 4590
Index = 4
Left = 2340
TabIndex = 37
Top = 1200
Width = 6540
Begin VB.Label lblBackup
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Backup Now!"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 195
Left = 2205
MouseIcon = "frmMain.frx":0A4C
MousePointer = 99 'Custom
TabIndex = 45
Top = 585
Width = 930
End
Begin VB.Label lblTaskModify
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Add, Remove or Modify Tasks"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 195
Left = 390
MouseIcon = "frmMain.frx":0D56
MousePointer = 99 'Custom
TabIndex = 44
Top = 2385
Width = 2145
End
Begin VB.Label lblTaskLogEdit
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Edit the Timelog"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 195
Left = 390
MouseIcon = "frmMain.frx":1060
MousePointer = 99 'Custom
TabIndex = 43
Top = 2100
Width = 1140
End
Begin VB.Label lblTaskAddComent
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Comment Task on Date"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 195
Left = 390
MouseIcon = "frmMain.frx":136A
MousePointer = 99 'Custom
TabIndex = 42
Top = 1815
Width = 1665
End
Begin VB.Label lblTaskSwitch
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Switch Task"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 195
Left = 390
MouseIcon = "frmMain.frx":1674
MousePointer = 99 'Custom
TabIndex = 41
Top = 1545
Width = 840
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = $"frmMain.frx":197E
Height = 420
Left = 390
TabIndex = 40
Top = 990
Width = 6090
End
Begin VB.Image Image3
Height = 90
Left = 135
Picture = "frmMain.frx":1A05
Top = 1035
Width = 120
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Secure your data today!"
Height = 195
Left = 390
TabIndex = 39
Top = 585
Width = 1770
End
Begin VB.Image Image2
Height = 90
Left = 135
Picture = "frmMain.frx":1A47
Top = 645
Width = 120
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "Welcome to Hours and Minutes!"
Height = 465
Left = 120
TabIndex = 38
Top = 210
Width = 6270
End
End
Begin VB.Label lblSection
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Preferences"
BeginProperty Font
Name = "Tahoma"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 285
Left = 2910
TabIndex = 36
Top = 780
Width = 1455
End
Begin VB.Shape shpBorder
Height = 4620
Left = 2325
Top = 1185
Width = 6570
End
Begin VB.Menu mnuStatPluginsMenu
Caption = "Stat Plugins Menu"
Visible = 0 'False
Begin VB.Menu mnuStatPlugins
Caption = ""
Index = 0
End
End
Begin VB.Menu mnuTrayMenu
Caption = "Tray Menu"
Visible = 0 'False
Begin VB.Menu mnuShow
Caption = "&Hours and Minutes"
End
Begin VB.Menu mnuSwitchMode
Caption = "&Switch Task"
Begin VB.Menu mnuModesAdvanced
Caption = "Show &Advanced"
End
Begin VB.Menu mnuLine2
Caption = "-"
End
Begin VB.Menu mnuModes
Caption = "Mode"
Index = 0
End
End
Begin VB.Menu mnuAddComment
Caption = "Add &Comment..."
End
Begin VB.Menu mnuAddReminder
Caption = "Add &Reminder..."
End
Begin VB.Menu mnuLine1
Caption = "-"
End
Begin VB.Menu mnuExit
Caption = "&Exit"
End
End
Begin VB.Menu mnuReminderMenu
Caption = "Reminders Menu"
Visible = 0 'False
Begin VB.Menu mnuReminderAdd
Caption = "&New..."
End
Begin VB.Menu mnuReminderEdit
Caption = "&Edit..."
End
Begin VB.Menu mnuReminderDelete
Caption = "&Delete..."
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
' public settings:
Public m_blnAllowIdle As Boolean
Public m_lngIdleStart As Long
Public m_blnAllowAutosave As Boolean
Public m_lngAutosaveInterval As Long
Public m_blnRemindOnActive As Boolean
Public m_blnRemindOnActive_NewStyle As Boolean
Public m_blnAutoComment As Boolean
' private variables:
Public m_blnLoadState As Boolean
Private m_blnSwitchVisible As Boolean
' private timing variables
Public m_lngActiveModeID As Long
Public m_dteDate As Date
Public m_lngStartTime As Long
Private m_lngIdleTimeMax As Long
Private m_lngMSeconds As Long
Private m_blnIsIdle As Boolean
Private m_lngLastAutosave As Long
Private m_lngIteration As Long
Private Sub lblBackup_Click()
Dim dteNow As String, strNow As String, x As Long, y As Long
Dim lngFile As Long, objReg As clsRegistry
Dim arrValues() As String, lngValues As Long
Dim arrSections() As String, lngSections As Long
On Error GoTo lblError
If MsgBox("This will backup all Hours and Minutes data to a file." & vbCrLf & "Do you wish to continue?", vbYesNo Or vbQuestion) = vbYes Then
dteNow = CStr(Now)
For x = 1 To Len(dteNow)
If (Mid(dteNow, x, 1) >= "0" And Mid(dteNow, x, 1) <= "9") Or (Mid(dteNow, x, 1) = " ") Then
strNow = strNow & Mid(dteNow, x, 1)
End If
Next
With ctlDialog
.FileName = "Hours and Minutes Backup " & strNow & ".reg"
.FLAGS = FileOpenConstants.cdlOFNOverwritePrompt Or FileOpenConstants.cdlOFNPathMustExist
.ShowSave
On Error GoTo lblErrorWriting
modeSaveTime m_lngActiveModeID, m_dteDate, m_lngMSeconds
Set objReg = New clsRegistry
With objReg
.ClassKey = HKEY_CURRENT_USER
lngFile = FreeFile
Open ctlDialog.FileName For Output As #lngFile
Print #lngFile, "REGEDIT4" & vbCrLf
Print #lngFile, "[HKEY_CURRENT_USER\" & m_strRegRoot & "]"
.SectionKey = m_strRegRoot
.EnumerateValues arrValues, lngValues
For x = 1 To lngValues
.ValueKey = arrValues(x)
Print #lngFile, """" & arrValues(x) & """=""" & regReplace(.Value) & """"
Next
Print #lngFile, ""
Print #lngFile, "[HKEY_CURRENT_USER\" & m_strRegRoot & "\Modes]"
.SectionKey = m_strRegRoot & "\Modes"
.EnumerateValues arrValues, lngValues
For x = 1 To lngValues
.ValueKey = arrValues(x)
Print #lngFile, """" & arrValues(x) & """=""" & regReplace(.Value) & """"
Next
Print #lngFile, ""
.EnumerateSections arrSections, lngSections
For y = 1 To lngSections
Print #lngFile, "[HKEY_CURRENT_USER\" & m_strRegRoot & "\Modes\" & arrSections(y) & "]"
.SectionKey = m_strRegRoot & "\Modes\" & arrSections(y)
.EnumerateValues arrValues, lngValues
For x = 1 To lngValues
.ValueKey = arrValues(x)
Print #lngFile, """" & arrValues(x) & """=""" & regReplace(.Value) & """"
Next
Print #lngFile, ""
Next
Close #lngFile
End With
Set objReg = Nothing
MsgBox "The backup has been created successfully!", vbInformation Or vbOKOnly
End With
End If
Exit Sub
lblError:
MsgBox "Warning. No backup has been made.", vbInformation Or vbOKOnly
Exit Sub
lblErrorWriting:
MsgBox "There was an error creating the backup:" & vbCrLf & vbCrLf & Err.Description, vbCritical Or vbOKOnly
Exit Sub
End Sub
Private Sub lblTaskAddComent_Click()
modeAddComment
End Sub
Private Sub lblTaskLogEdit_Click()
modeEditLog
End Sub
Private Sub lblTaskModify_Click()
modeModify
End Sub
Private Sub lblTaskSwitch_Click()
modeSwitch
End Sub
' this function adds either a switch to or a switch from event to the
' comment string of a certain mode (for today)
Private Sub modeAutoComment(lngModeID As Long, blnSwitchTo As Boolean)
Dim objReg As clsRegistry
Set objReg = New clsRegistry
With objReg
.ClassKey = HKEY_CURRENT_USER
.SectionKey = m_strRegRoot & "\Modes\" & lngModeID
.ValueKey = "Comment " & CLng(m_dteDate)
If blnSwitchTo Then
.Value = .Value & "Switched to the Task at " & CStr(Time) & "*"
Else
.Value = .Value & "Switched from the Task at " & CStr(Time) & "*"
End If
End With
Set objReg = Nothing
End Sub
Private Sub modeAddComment()
Dim objReg As clsRegistry
Load frmModeComment
With frmModeComment
.Show 1, Me
If .m_blnCancelPressed = False Then
Set objReg = New clsRegistry
objReg.ClassKey = HKEY_CURRENT_USER
objReg.SectionKey = m_strRegRoot & "\Modes\" & m_lngActiveModeID
objReg.ValueKey = "Comment " & CLng(m_dteDate)
objReg.Value = objReg.Value & .txtValue.Text & "*"
Set objReg = Nothing
End If
End With
Unload frmModeComment
End Sub
Private Sub modeEditLog()
Load frmLogEdit
With frmLogEdit
.m_lngFocusModeID = m_lngActiveModeID
.listModes
.Show 1, Me
End With
Unload frmLogEdit
End Sub
Private Function regReplace(ByVal strString) As String
strString = Replace(strString, "\", "\\")
strString = Replace(strString, """", "\""")
strString = Replace(strString, vbCrLf, vbCr & vbCr & vbLf)
regReplace = strString
End Function
Private Sub btnRegister_Click()
Dim strReturn As String, objReg As clsRegistry
Dim strVal As String
txtRegCode.Enabled = False
txtRegCode.Text = TrimCRLF(txtRegCode.Text)
strReturn = regCodeEvaluate(txtRegCode.Text)
m_lngStartCount = -1
If strReturn = "OK" Then
txtRegCode.Locked = True
txtRegCode.BackColor = vbButtonFace
btnRegister.Visible = False
lblRegNote.Visible = True
If Not m_blnLoadState Then
MsgBox "Thank you for registering!", vbOKOnly Or vbInformation
If ctlModeTimer.Enabled = False Then ctlModeTimer.Enabled = True
Set objReg = New clsRegistry
With objReg
.ClassKey = HKEY_CURRENT_USER
.SectionKey = m_strRegRoot
.ValueKey = "m_strLicense"
.Value = txtRegCode.Text
End With
Set objReg = Nothing
End If
Else
If Trim(txtRegCode.Text) <> "" Then MsgBox "Error Evaluating License:" & vbCrLf & vbCrLf & strReturn, vbCritical Or vbOKOnly
txtRegCode.Text = ""
txtRegCode.Locked = False
txtRegCode.BackColor = vbWindowBackground
btnRegister.Visible = True
lblRegNote.Visible = False
Set objReg = New clsRegistry
With objReg
.ClassKey = HKEY_CURRENT_USER