-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsferrormgr.vc2
3108 lines (2743 loc) · 102 KB
/
sferrormgr.vc2
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
*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (ES) AUTOGENERADO - ¡¡ATENCIÓN!! - ¡¡NO PENSADO PARA EJECUTAR!! USAR SOLAMENTE PARA INTEGRAR CAMBIOS Y ALMACENAR CON HERRAMIENTAS SCM!!
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.20" SourceFile="sferrormgr.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS sferrormessage AS form
*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="edtMessage" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdCancel" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdDebug" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdContinue" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdRetry" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdQuit" UniqueID="" Timestamp="" />
#INCLUDE "sfctrls.h"
*<DefinedPropArrayMethod>
*p: cchoice && The choice the user made
*p: oerrormgr && A reference to an SFErrorMgr object
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
*<PropValue>
AllowOutput = .F.
AlwaysOnTop = .T.
AutoCenter = .T.
BorderStyle = 2
Caption = "Error"
cchoice =
Closable = .F.
Desktop = .T.
DoCreate = .T.
Height = 254
MaxButton = .F.
MinButton = .F.
Name = "sferrormessage"
oerrormgr = NULL
ShowWindow = 1
Width = 461
WindowType = 1
_memberdata = <VFPData>
<memberdata name="cchoice" display="cChoice"/>
<memberdata name="oerrormgr" display="oErrorMgr"/>
</VFPData>
*</PropValue>
ADD OBJECT 'cmdCancel' AS commandbutton WITH ;
Caption = "Cancel", ;
FontName = "Segoe UI", ;
Height = 27, ;
Left = 10, ;
Name = "cmdCancel", ;
Top = 220, ;
Width = 84
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'cmdContinue' AS commandbutton WITH ;
Caption = "Continue", ;
FontName = "Segoe UI", ;
Height = 27, ;
Left = 190, ;
Name = "cmdContinue", ;
Top = 220, ;
Width = 84
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'cmdDebug' AS commandbutton WITH ;
Caption = "Debug", ;
FontName = "Segoe UI", ;
Height = 27, ;
Left = 100, ;
Name = "cmdDebug", ;
Top = 220, ;
Width = 84
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'cmdQuit' AS commandbutton WITH ;
Caption = "Quit", ;
FontName = "Segoe UI", ;
Height = 27, ;
Left = 370, ;
Name = "cmdQuit", ;
Top = 220, ;
Width = 84
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'cmdRetry' AS commandbutton WITH ;
Caption = "Retry", ;
FontName = "Segoe UI", ;
Height = 27, ;
Left = 280, ;
Name = "cmdRetry", ;
Top = 220, ;
Width = 84
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'edtMessage' AS label WITH ;
BackStyle = 0, ;
Caption = "Error message", ;
FontName = "Segoe UI", ;
Height = 200, ;
Left = 10, ;
Name = "edtMessage", ;
Top = 10, ;
Width = 440, ;
WordWrap = .T.
*< END OBJECT: BaseClass="label" />
PROCEDURE Destroy
This.oErrorMgr = NULL
ENDPROC
PROCEDURE Init
lparameters toErrorMgr
with This
* Save a reference to the error manager that called us.
.oErrorMgr = toErrorMgr
* Grab the screen's or active form's icon.
do case
case not empty(.Icon)
case type('_screen.ActiveForm.Name') = 'C' and ;
pemstatus(_screen.ActiveForm, 'Icon', 5) and ;
not empty(nvl(_screen.ActiveForm.Icon, ''))
.Icon = _screen.ActiveForm.Icon
otherwise
.Icon = _screen.Icon
endcase
endwith
ENDPROC
PROCEDURE Show
lparameters tnStyle
with This
.cmdCancel.Enabled = .oErrorMgr.lCanCancel
.cmdDebug.Enabled = .oErrorMgr.lShowDebug
.cmdContinue.Enabled = .oErrorMgr.lCanContinue
.cmdRetry.Enabled = .oErrorMgr.lCanContinue
.Caption = .oErrorMgr.cTitle
.edtMessage.Caption = left(strtran(.oErrorMgr.cMessage, ccTAB, space(4)), ;
254)
endwith
dodefault(tnStyle)
ENDPROC
PROCEDURE cmdCancel.Click
Thisform.cChoice = This.Caption
Thisform.Hide()
ENDPROC
PROCEDURE cmdCancel.Init
This.Caption = ccMSG_CANCEL
dodefault()
ENDPROC
PROCEDURE cmdContinue.Click
Thisform.cChoice = This.Caption
Thisform.Hide()
ENDPROC
PROCEDURE cmdContinue.Init
This.Caption = ccMSG_CONTINUE
dodefault()
ENDPROC
PROCEDURE cmdDebug.Click
Thisform.cChoice = This.Caption
Thisform.Hide()
ENDPROC
PROCEDURE cmdDebug.Init
This.Caption = ccMSG_DEBUG
dodefault()
ENDPROC
PROCEDURE cmdQuit.Click
Thisform.cChoice = This.Caption
Thisform.Hide()
ENDPROC
PROCEDURE cmdQuit.Init
This.Caption = ccMSG_QUIT
dodefault()
ENDPROC
PROCEDURE cmdRetry.Click
Thisform.cChoice = This.Caption
Thisform.Hide()
ENDPROC
PROCEDURE cmdRetry.Init
This.Caption = ccMSG_RETRY
dodefault()
ENDPROC
ENDDEFINE
DEFINE CLASS sferrormessagedialog AS form && A modal dialog to display error messages
*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="shpSendReport" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblMessage6" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblMessage4" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="shpRecover" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdSave" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblMessage3" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdContinue" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdHelp" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdQuit" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblMessage5" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblComments" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Image1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblMessage1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblMessage2" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="edtComments" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdEmail" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblSenderName" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="txtSenderName" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblSenderEmail" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="txtSenderEmail" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblSendReport" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblRecover" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="tmrFocus" UniqueID="" Timestamp="" />
#INCLUDE "sferrormgr.h"
*<DefinedPropArrayMethod>
*m: sendmessage && Sends the error message
*p: cchoice && The choice made by the user
*p: ccontact && The contact's name
*p: cemail && The contact's email address
*p: lsent && .T. if a ticket was created or email sent
*p: oerrormgr && A reference to an SFErrorMgr object
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
*<PropValue>
AllowOutput = .F.
AlwaysOnTop = .T.
AutoCenter = .T.
BackColor = 255,255,255
BorderStyle = 2
Caption = "Error"
cchoice =
ccontact =
cemail =
Closable = .F.
ControlBox = .F.
Desktop = .T.
DoCreate = .T.
Height = 540
lsent = .F.
MaxButton = .F.
MinButton = .F.
Name = "sferrormessagedialog"
oerrormgr = .NULL.
ShowWindow = 1
Width = 475
WindowType = 1
_memberdata = <VFPData>
<memberdata name="cchoice" type="property" display="cChoice"/>
<memberdata name="ccontact" type="property" display="cContact"/>
<memberdata name="cemail" type="property" display="cEmail"/>
<memberdata name="oerrormgr" type="property" display="oErrorMgr"/>
<memberdata name="sendmessage" type="method" display="SendMessage"/>
<memberdata name="lsent" display="lSent"/>
</VFPData>
*</PropValue>
ADD OBJECT 'cmdContinue' AS commandbutton WITH ;
Caption = "\<Continue", ;
FontName = "Segoe UI", ;
Height = 27, ;
Left = 285, ;
Name = "cmdContinue", ;
TabIndex = 18, ;
Top = 490, ;
Width = 84, ;
ZOrderSet = 7
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'cmdEmail' AS commandbutton WITH ;
Caption = "\<Send", ;
FontName = "Segoe UI", ;
Height = 27, ;
Left = 375, ;
Name = "cmdEmail", ;
TabIndex = 15, ;
Top = 315, ;
Width = 84
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'cmdHelp' AS commandbutton WITH ;
Caption = "Help", ;
FontName = "Segoe UI", ;
Height = 27, ;
Left = 195, ;
Name = "cmdHelp", ;
TabIndex = 17, ;
Top = 490, ;
Width = 84, ;
ZOrderSet = 7
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'cmdQuit' AS commandbutton WITH ;
Caption = "\<Quit", ;
FontName = "Segoe UI", ;
Height = 27, ;
Left = 375, ;
Name = "cmdQuit", ;
TabIndex = 19, ;
Top = 490, ;
Width = 84, ;
ZOrderSet = 8
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'cmdSave' AS commandbutton WITH ;
Caption = "S\<ave...", ;
FontName = "Segoe UI", ;
Height = 27, ;
Left = 375, ;
Name = "cmdSave", ;
TabIndex = 16, ;
Top = 355, ;
Width = 84, ;
ZOrderSet = 4
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'edtComments' AS editbox WITH ;
FontName = "Segoe UI", ;
Height = 78, ;
Left = 20, ;
Name = "edtComments", ;
SelectOnEntry = .T., ;
TabIndex = 10, ;
Top = 230, ;
Width = 440, ;
ZOrderSet = 14
*< END OBJECT: BaseClass="editbox" />
ADD OBJECT 'Image1' AS image WITH ;
Height = 59, ;
Left = -1, ;
Name = "Image1", ;
Picture = errorheader.gif, ;
Top = -1, ;
Width = 477, ;
ZOrderSet = 11
*< END OBJECT: BaseClass="image" />
ADD OBJECT 'lblComments' AS label WITH ;
AutoSize = .T., ;
BackStyle = 0, ;
Caption = "Please enter any \<comments you think would help Technical Support staff:", ;
FontName = "Segoe UI", ;
Left = 20, ;
Name = "lblComments", ;
TabIndex = 9, ;
Top = 210, ;
ZOrderSet = 10
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'lblMessage1' AS label WITH ;
AutoSize = .T., ;
BackStyle = 0, ;
Caption = "An unexpected error has occurred.", ;
FontBold = .T., ;
FontName = "Segoe UI", ;
Left = 15, ;
Name = "lblMessage1", ;
TabIndex = 1, ;
Top = 10, ;
Width = 196, ;
ZOrderSet = 12
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'lblMessage2' AS label WITH ;
AutoSize = .T., ;
BackStyle = 0, ;
Caption = "We apologize for the inconvenience; the trouble is temporary.", ;
FontName = "Segoe UI", ;
Left = 15, ;
Name = "lblMessage2", ;
TabIndex = 2, ;
Top = 35, ;
Width = 327, ;
ZOrderSet = 13
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'lblMessage3' AS label WITH ;
AutoSize = .F., ;
BackStyle = 0, ;
Caption = "It is very important to report this error to Technical Support. The error report contains critical information our staff needs to provide you with a resolution to this problem as quickly as possible.", ;
FontName = "Segoe UI", ;
Height = 44, ;
Left = 20, ;
Name = "lblMessage3", ;
TabIndex = 4, ;
Top = 95, ;
Width = 434, ;
WordWrap = .T., ;
ZOrderSet = 6
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'lblMessage4' AS label WITH ;
AutoSize = .F., ;
BackStyle = 0, ;
Caption = "Please click the Send button to send the error report to Technical Support.", ;
FontName = "Segoe UI", ;
Height = 44, ;
Left = 20, ;
Name = "lblMessage4", ;
TabIndex = 11, ;
Top = 315, ;
Width = 346, ;
WordWrap = .T., ;
ZOrderSet = 2
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'lblMessage5' AS label WITH ;
AutoSize = .F., ;
BackStyle = 0, ;
Caption = "If you wish to continue working in this application, click Continue. To exit, click Quit.", ;
FontName = "Segoe UI", ;
Height = 30, ;
Left = 15, ;
Name = "lblMessage5", ;
TabIndex = 14, ;
Top = 450, ;
Width = 434, ;
WordWrap = .T., ;
ZOrderSet = 9
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'lblMessage6' AS label WITH ;
AutoSize = .F., ;
BackStyle = 0, ;
Caption = "If you want to save a copy of the report for your own records, please click Save.", ;
FontName = "Segoe UI", ;
Height = 30, ;
Left = 20, ;
Name = "lblMessage6", ;
TabIndex = 12, ;
Top = 355, ;
Width = 349, ;
WordWrap = .T., ;
ZOrderSet = 1
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'lblRecover' AS label WITH ;
AutoSize = .T., ;
BackColor = 255,255,255, ;
Caption = " 2. Recovering From the Error ", ;
FontName = "Segoe UI", ;
Left = 15, ;
Name = "lblRecover", ;
Style = 3, ;
Top = 425
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'lblSenderEmail' AS label WITH ;
AutoSize = .T., ;
BackStyle = 0, ;
Caption = "Your email address", ;
FontName = "Segoe UI", ;
Left = 20, ;
Name = "lblSenderEmail", ;
TabIndex = 7, ;
Top = 183, ;
Visible = .T.
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'lblSenderName' AS label WITH ;
AutoSize = .T., ;
BackStyle = 0, ;
Caption = "Your name", ;
FontName = "Segoe UI", ;
Left = 20, ;
Name = "lblSenderName", ;
TabIndex = 5, ;
Top = 158, ;
Visible = .T.
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'lblSendReport' AS label WITH ;
AutoSize = .T., ;
BackColor = 255,255,255, ;
Caption = " 1. Send Report to Technical Support ", ;
FontName = "Segoe UI", ;
Left = 15, ;
Name = "lblSendReport", ;
Style = 3, ;
Top = 70
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'shpRecover' AS shape WITH ;
BackStyle = 0, ;
Height = 102, ;
Left = 5, ;
Name = "shpRecover", ;
Style = 3, ;
Top = 431, ;
Width = 465
*< END OBJECT: BaseClass="shape" />
ADD OBJECT 'shpSendReport' AS shape WITH ;
BackStyle = 0, ;
Height = 330, ;
Left = 5, ;
Name = "shpSendReport", ;
Style = 3, ;
Top = 76, ;
Width = 465
*< END OBJECT: BaseClass="shape" />
ADD OBJECT 'tmrFocus' AS timer WITH ;
Height = 23, ;
Interval = 500, ;
Left = 65, ;
Name = "tmrFocus", ;
Top = 495, ;
Width = 23
*< END OBJECT: BaseClass="timer" />
ADD OBJECT 'txtSenderEmail' AS textbox WITH ;
ControlSource = "Thisform.cEmail", ;
FontName = "Segoe UI", ;
Height = 23, ;
Left = 160, ;
Name = "txtSenderEmail", ;
SelectOnEntry = .T., ;
TabIndex = 8, ;
Top = 180, ;
Visible = .T., ;
Width = 300
*< END OBJECT: BaseClass="textbox" />
ADD OBJECT 'txtSenderName' AS textbox WITH ;
ControlSource = "Thisform.cContact", ;
FontName = "Segoe UI", ;
Height = 23, ;
Left = 160, ;
Name = "txtSenderName", ;
SelectOnEntry = .T., ;
TabIndex = 6, ;
Top = 155, ;
Visible = .T., ;
Width = 300
*< END OBJECT: BaseClass="textbox" />
PROCEDURE Destroy
This.oErrorMgr = NULL
ENDPROC
PROCEDURE GotFocus
* If lblComments is too long, word wrap it.
doevents force
if This.lblComments.Width > This.lblMessage3.Width
This.lblComments.AutoSize = .F.
This.lblComments.WordWrap = .T.
This.lblComments.Height = 30
This.lblComments.Width = This.lblMessage3.Width
This.edtComments.Top = 250
This.edtComments.Height = 58
endif This.lblComments.Width > This.lblMessage3.Width
This.Refresh()
ENDPROC
PROCEDURE Init
lparameters toErrorMgr
with This
* Save a reference to the error manager that called us.
.oErrorMgr = toErrorMgr
* Grab the screen's or active form's icon.
do case
case not empty(.Icon)
case type('_screen.ActiveForm.Name') = 'C' and ;
pemstatus(_screen.ActiveForm, 'Icon', 5) and ;
not empty(nvl(_screen.ActiveForm.Icon, ''))
.Icon = _screen.ActiveForm.Icon
otherwise
.Icon = _screen.Icon
endcase
endwith
ENDPROC
PROCEDURE sendmessage && Sends the error message
* Create a support ticket or send an email.
local lcContact, ;
lcEmail, ;
lcMessage, ;
llOK
with This
lcContact = alltrim(.cContact)
lcEmail = alltrim(.cEmail)
lcMessage = alltrim(.oErrorMgr.cMessage) + ;
iif(empty(.edtComments.Value), '', ccCRLF + ccCRLF + 'Comments:' + ;
ccCRLF + .edtComments.Value)
llOK = .oErrorMgr.CreateTicketOrEmail(lcMessage, lcEmail, lcContact)
* Display any error that occurred during sending.
if not llOK
if type('oLocalizer.Name') = 'C'
lcMessage = oLocalizer.GetLocalizedString('ERR_CANT_EMAIL_ERROR')
else
lcMessage = 'The email could not be sent. The message from the ' + ;
'email server was:'
endif type('oLocalizer.Name') = 'C'
messagebox(lcMessage + ccCR + ccCR + .oErrorMgr.cMailErrorMessage, ;
MB_ICONSTOP, _screen.Caption)
endif not llOK
endwith
return llOK
ENDPROC
PROCEDURE Show
lparameters tnStyle
local llLocalizer, ;
lnAdjust
with This
* Set the captions appropriately.
llLocalizer = type('oLocalizer.Name') = 'C'
.Caption = .oErrorMgr.cTitle
do case
case llLocalizer
.Caption = oLocalizer.GetLocalizedString('FRM_CAP_ERRORDIALOG')
if .oErrorMgr.lCanCancel
.lblMessage5.Caption = oLocalizer.GetLocalizedString('LBL_CAP_ERROR_4')
else
.lblMessage5.Caption = oLocalizer.GetLocalizedString('LBL_CAP_ERROR_7')
endif .oErrorMgr.lCanCancel
case not .oErrorMgr.lCanCancel
.lblMessage5.Caption = 'Due to the nature of the error, the ' + ;
'application must shut down. Please click Quit.'
endcase
do case
case not .oErrorMgr.lScreenShot
case llLocalizer
.lblMessage4.Caption = .lblMessage4.Caption + ' ' + ;
oLocalizer.GetLocalizedString('LBL_CAP_ERROR_SCREEN_SHOT')
otherwise
.lblMessage4.Caption = .lblMessage4.Caption + ;
' A screen shot is automatically included.'
endcase
* Hide some controls if necessary.
.cmdContinue.Visible = .oErrorMgr.lCanCancel
if not .oErrorMgr.lUserCanSaveDialog
store .F. to .lblMessage6.Visible, .cmdSave.Visible
lnAdjust = .lblMessage6.Top - .lblMessage4.Top
store .lblMessage6.Top to .lblMessage4.Top, .cmdEmail.Top
.edtComments.Height = .edtComments.Height + lnAdjust
endif not .oErrorMgr.lUserCanSaveDialog
* Set other properties.
.cContact = .oErrorMgr.cContact
.cEmail = .oErrorMgr.cEmail
endwith
dodefault(tnStyle)
ENDPROC
PROCEDURE cmdContinue.Click
* Flag that the user wants to cancel the operation that caused the error but
* stay in the application, then return to the error manager.
Thisform.cChoice = ccMSG_CANCEL
Thisform.Hide()
ENDPROC
PROCEDURE cmdContinue.Init
if type('oLocalizer.Name') = 'C'
This.Caption = oLocalizer.GetLocalizedString('MSG_CONTINUEHOT')
endif type('oLocalizer.Name') = 'C'
dodefault()
ENDPROC
PROCEDURE cmdEmail.Click
Thisform.lSent = Thisform.SendMessage()
This.Enabled = not Thisform.lSent
ENDPROC
PROCEDURE cmdEmail.Init
if type('oLocalizer.Name') = 'C'
This.Caption = oLocalizer.GetLocalizedString('CMD_CAP_SEND', .T.)
endif type('oLocalizer.Name') = 'C'
dodefault()
ENDPROC
PROCEDURE cmdEmail.Refresh
* This button is only enabled if we have a mail server to use, we're using
* MAPI, or we have code for CreateTicket.
local loError
loError = Thisform.oErrorMgr
This.Enabled = (not empty(loError.cMailServer) or loError.lMAPI or ;
pemstatus(loError, 'CreateTicket', 0)) and ;
not empty(Thisform.txtSenderName.Value) and ;
not empty(Thisform.txtSenderEmail.Value) and not Thisform.lSent
ENDPROC
PROCEDURE cmdHelp.Click
if Thisform.HelpContextID = 0
help
else
help id Thisform.HelpContextID
endif Thisform.HelpContextID = 0
ENDPROC
PROCEDURE cmdHelp.Init
if type('oLocalizer.Name') = 'C'
This.Caption = oLocalizer.GetLocalizedString('UI_CMD_HELP_LOC')
endif type('oLocalizer.Name') = 'C'
dodefault()
ENDPROC
PROCEDURE cmdQuit.Click
* Flag that the user wants to quit and return to the error manager.
Thisform.cChoice = ccMSG_QUIT
Thisform.Hide()
ENDPROC
PROCEDURE cmdQuit.Init
if type('oLocalizer.Name') = 'C'
This.Caption = oLocalizer.GetLocalizedString('MSG_QUITHOT')
endif type('oLocalizer.Name') = 'C'
dodefault()
ENDPROC
PROCEDURE cmdSave.Click
local lcFileName
lcFileName = putfile('', 'Error.txt', 'Text file (*.txt)')
if not empty(lcFileName)
copy file (Thisform.oErrorMgr.cErrorLogTextFile) to (lcFileName)
lcFileName = '"' + lcFileName + '"'
try
declare integer ShellExecute in SHELL32.DLL ;
integer nWinHandle, ; && handle of parent window
string cOperation, ; && operation to perform
string cFileName, ; && filename
string cParameters, ; && parameters for the executable
string cDirectory, ; && default directory
integer nShowWindow && window state
ShellExecute(0, 'Open', lcFileName, '', '', 1)
catch
endtry
endif not empty(lcFileName)
ENDPROC
PROCEDURE cmdSave.Init
if type('oLocalizer.Name') = 'C'
This.Caption = oLocalizer.GetLocalizedString('CMD_CAP_SAVE_ERROR')
endif type('oLocalizer.Name') = 'C'
dodefault()
ENDPROC
PROCEDURE lblComments.Init
if type('oLocalizer.Name') = 'C'
This.Caption = oLocalizer.GetLocalizedString('LBL_CAP_ERROR_3')
endif type('oLocalizer.Name') = 'C'
ENDPROC
PROCEDURE lblMessage1.Init
if type('oLocalizer.Name') = 'C'
This.Caption = oLocalizer.GetLocalizedString('LBL_CAP_ERROR_1')
endif type('oLocalizer.Name') = 'C'
ENDPROC
PROCEDURE lblMessage2.Init
if type('oLocalizer.Name') = 'C'
This.Caption = oLocalizer.GetLocalizedString('LBL_CAP_ERROR_8')
endif type('oLocalizer.Name') = 'C'
ENDPROC
PROCEDURE lblMessage3.Init
if type('oLocalizer.Name') = 'C'
This.Caption = oLocalizer.GetLocalizedString('LBL_CAP_ERROR_2')
endif type('oLocalizer.Name') = 'C'
ENDPROC
PROCEDURE lblMessage4.Init
if type('oLocalizer.Name') = 'C'
This.Caption = oLocalizer.GetLocalizedString('LBL_CAP_ERROR_6')
endif type('oLocalizer.Name') = 'C'
ENDPROC
PROCEDURE lblMessage6.Init
if type('oLocalizer.Name') = 'C'
This.Caption = oLocalizer.GetLocalizedString('LBL_CAP_ERROR_11')
endif type('oLocalizer.Name') = 'C'
dodefault()
ENDPROC
PROCEDURE lblRecover.Init
if type('oLocalizer.Name') = 'C'
This.Caption = oLocalizer.GetLocalizedString('LBL_CAP_ERROR_10', , .T.)
endif type('oLocalizer.Name') = 'C'
ENDPROC
PROCEDURE lblSenderEmail.Init
if type('oLocalizer.Name') = 'C'
This.Caption = oLocalizer.GetLocalizedString('LBL_CAP_EMAIL_ADDRESS')
endif type('oLocalizer.Name') = 'C'
ENDPROC
PROCEDURE lblSenderName.Init
if type('oLocalizer.Name') = 'C'
This.Caption = oLocalizer.GetLocalizedString('LBL_CAP_EMAIL_CONTACT')
endif type('oLocalizer.Name') = 'C'
ENDPROC
PROCEDURE lblSendReport.Init
if type('oLocalizer.Name') = 'C'
This.Caption = oLocalizer.GetLocalizedString('LBL_CAP_ERROR_9', , .T.)
endif type('oLocalizer.Name') = 'C'
ENDPROC
PROCEDURE tmrFocus.Timer
* Force us to be the top window if not.
if not wontop() = Thisform.Name
activate window (Thisform.Name)
This.Enabled = .F.
endif not wontop() = Thisform.Name
ENDPROC
PROCEDURE txtSenderEmail.InteractiveChange
Thisform.cmdEmail.Refresh()
ENDPROC
PROCEDURE txtSenderName.InteractiveChange
Thisform.cmdEmail.Refresh()
ENDPROC
ENDDEFINE
DEFINE CLASS sferrormgr AS custom && An error manager class
*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />
#INCLUDE "sferrormgr.h"
*<DefinedPropArrayMethod>
*m: about && Provides documentation for the class
*m: checkintry && Checks to see if we're in a TRY structure somewhere in the call stack
*m: cleanupbeforereturn && Provides an opportunity to clean things up before RETURN TO is used
*m: commandshell && Displays a pseudo-command window at runtime
*m: createerrormessage && Creates a string describing the error
*m: createmailobject && Creates a mail object
*m: createticket && Creates a support ticket
*m: createticketoremail && Creates a ticket or sends an email
*m: decrypt && Decrypts a string
*m: diderroroccur && An exposed method to return the value of the protected lErrorOccurred.
*m: displayerror && Displays an error message to the user.
*m: errorhandler && The ON ERROR handler.
*m: getmemvars && Creates a list of memvars and their values
*m: immediateexit && Performs an immediate exit
*m: isreturntooncallstack && Determines if the routine specified in cReturnToOnCancel is on the call stack
*m: logerror && Logs the error to a log file.
*m: reseterror && An exposed method to reset the values of the protected lErrorOccurred and public aErrorInfo.
*m: revertalltables && Reverts all cursors in all datasessions
*m: reverttables && Revert cursors in the current datasession
*m: screenshot && Takes a screen shot
*m: setdialogproperties && Sets properties of the error dialog before displaying it
*m: seterror && Sets lErrorOccurred and aErrorInfo to information about the most recent error
*m: setsuppresserrors && An exposed method to set the value of the protected lSuppressErrors.
*p: calias && The selected alias
*p: cappname && The name of the application
*p: cattachments && Attachments for the email or support ticket
*p: cconsoleclass && The class to use for a debugging console at runtime
*p: cconsolelibrary && The library containing the class specified in cConsoleClass
*p: ccontact && The user's display name
*p: ccurrerror && The former ON ERROR handler.
*p: cdefaultaction && The default action to take
*p: cemail && The user's email address
*p: cemaillogfolder && The folder to use for email logging
*p: cencryptionlibrary && The name of the encryption library to use
*p: cerrorlogfile && The name of the table to log errors to
*p: cerrorlogtextfile && The name of the text file to log errors to
*p: cimagefile && The name and path of the image file for the screen shot
*p: clanguage && The language to use for messages
*p: cmailclass && The class to use for emailing
*p: cmailerrormessage && The message of any error from the mail object
*p: cmaillibrary && The library containing the class specified in cMailClass
*p: cmailserver && The mail server
*p: cmessage && The body of the error message
*p: cmessageclass && The name of the class to use to display messages
*p: cmessagelibrary && The library the message class is in
*p: cpassword && The email password
*p: crecipient && The recipient of the email
*p: cresourcetable && The name of the resource table to use
*p: creturntooncancel && The name of the program to return to when Cancel is chosen
*p: creturntoonquit && The name of the program to return to when Quit is chosen
*p: csenderemail && The sender's email address
*p: csendername && The name of the sender
*p: cskipnames && Names of objects, members, or variables to skip log information about
*p: csubject && The subject of the error message
*p: ctitle && The default title for the error message dialog.
*p: cuser && The name of the user.
*p: cusername && The email user name
*p: cversion && The application version number
*p: lautocreateticket && .T. to automatically create a ticket
*p: lcancancel && .T. if the user can "cancel" (that is, stay in the application)
*p: lcancontinue && .T. if the user can "continue" (that is, RETRY or RETURN)
*p: ldisplayerrors && .T. if we're supposed to display errors and get the user's choice
*p: ldisplayingerrordialog && .T. if we're displaying the error dialog
*p: lemaillogging && .T. to do email logging
*p: lerrorinfosaved && .T. if the error information has been saved in aErrorInfo
*p: lerroroccurred && .T. if an error occurred
*p: lgetmemvars && .T. to include memory variables in the error report; .F. if an ActiveX control would cause a buffer overrun
*p: lgettingmemvars && .T. if we're using LIST MEMORY or LIST OBJECTS; an Access method can check it and do nothing if .T.
*p: lhandlingerror && .T. if we're in the process of handling an error
*p: linsidetry && .T. if code was executing inside a TRY structure when the error occurred
*p: llogtotable && .T. if the error should be logged to a table
*p: lmapi && .T. to use MAPI
*p: lquit && .T. if we're quitting (public so other objects can check on the way out)
*p: lscreenshot && .T. to take a screen shot
*p: lsetonerror && .T. to set ON ERROR to point to the ErrorHandler method.
*p: lshowdebug && .T. if "debug" should be an option
*p: lsuppresserrors && If .T., an error isn't logged or displayed
*p: lticketcreated && .T. if a ticket was created
*p: lusercansavedialog && .T. if the user can save the error log
*p: ndatasession && The datasession the error occurred in
*p: nlasterror && The index to the last error that occurred in aErrorInfo
*p: nmaxerrors && The maximum number of entries in aErrorInfo; 0 = no limit
*p: nreturncode && The return code for ExitProcess
*p: nsecurityoptions && The SecureSocketOptions setting to use
*p: nsmtpport && The SMTP port to use
*p: nthrottleerrorcount && The number of errors that have to occur within the timeframe specified in nThrottleThreshold to cause error suppression
*p: nthrottlethreshold && The number of seconds nThrottleErrorCount errors must occur within for error suppression to be enabled
*p: nthrottlewindow && How long to wait when error throttling before errors suppression is disabled
*p: tthrottletime && When error suppression started
*a: aerrorinfo[1,0] && An array containing error information; see the SetError method documentation for the structure of this array.
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
PROTECTED ccurrerror,lerrorinfosaved,lerroroccurred,lsuppresserrors
*<PropValue>
calias =
cappname =
cattachments =
cconsoleclass = SFConsoleForm
cconsolelibrary = SFConsole.vcx