-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathAddProcedure.frm
1310 lines (1158 loc) · 41.7 KB
/
AddProcedure.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.1#0"; "MSCOMCTL.OCX"
Begin VB.Form frmAddNewProcedure
BorderStyle = 4 'Fixed ToolWindow
Caption = "Add Procedure Assistant"
ClientHeight = 5610
ClientLeft = 45
ClientTop = 285
ClientWidth = 5070
Icon = "AddProcedure.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5610
ScaleWidth = 5070
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.Frame frameTab
ForeColor = &H00800000&
Height = 4215
Index = 3
Left = 2160
TabIndex = 40
Top = 600
Visible = 0 'False
Width = 4575
Begin VB.CheckBox chkHidden
Alignment = 1 'Right Justify
Caption = "Hidden procedure"
Height = 255
Left = 120
TabIndex = 27
ToolTipText = "Is this an hidden procedure?"
Top = 2040
Width = 1640
End
Begin VB.TextBox tbHelpContextID
Height = 285
Left = 1560
TabIndex = 26
Text = "Text1"
ToolTipText = "don't forget his context ID :)"
Top = 1560
Width = 1095
End
Begin VB.TextBox tbDescription
Height = 1005
Left = 120
ScrollBars = 2 'Vertical
TabIndex = 25
Text = "Text1"
ToolTipText = "Set the description for this new procedure..."
Top = 480
Width = 4335
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "&Help Context ID :"
Height = 195
Left = 120
TabIndex = 42
Top = 1605
Width = 1215
End
Begin VB.Label Label2
Caption = "&Description :"
Height = 255
Left = 120
TabIndex = 41
Top = 240
Width = 855
End
End
Begin VB.CommandButton cmdOk
Caption = "&Ok"
Default = -1 'True
Height = 615
Left = 3000
Picture = "AddProcedure.frx":27A2
Style = 1 'Graphical
TabIndex = 23
ToolTipText = "Generate the code"
Top = 4920
Width = 855
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "E&xit"
Height = 615
Left = 3960
Picture = "AddProcedure.frx":28EC
Style = 1 'Graphical
TabIndex = 24
ToolTipText = "Oops, forget it..."
Top = 4920
Width = 855
End
Begin VB.Frame frameTab
Height = 4215
Index = 2
Left = 1560
TabIndex = 34
Top = 1320
Visible = 0 'False
Width = 4575
Begin VB.CommandButton cmdMoveDown
Caption = "Move &Down"
Height = 495
Left = 120
Style = 1 'Graphical
TabIndex = 22
ToolTipText = "move this argument to the next place"
Top = 3480
Width = 735
End
Begin VB.CommandButton cmdMoveUp
Caption = "Move &Up"
Height = 495
Left = 120
Style = 1 'Graphical
TabIndex = 21
ToolTipText = "Move this argument to the previous place"
Top = 3000
Width = 735
End
Begin VB.CommandButton cmdRemoveArgument
Caption = "Remove"
Height = 495
Left = 120
Style = 1 'Graphical
TabIndex = 20
ToolTipText = "Remove the selected argument"
Top = 2520
Width = 735
End
Begin VB.CommandButton cmdAddArgument
Caption = "Add"
Height = 495
Left = 120
Style = 1 'Graphical
TabIndex = 18
ToolTipText = "Add this new argument"
Top = 2040
Width = 735
End
Begin VB.ListBox lstParameters
Height = 2010
Left = 960
TabIndex = 19
ToolTipText = "List of all created argument"
Top = 2040
Width = 3375
End
Begin VB.Frame Frame6
Caption = "Create a new argument"
ForeColor = &H00800000&
Height = 1815
Left = 120
TabIndex = 35
Top = 120
Width = 4335
Begin VB.TextBox tbDefaultValue
Height = 285
Left = 1200
TabIndex = 17
Text = "Text1"
ToolTipText = "Does it have a default value?"
Top = 1430
Width = 3015
End
Begin VB.CheckBox chkOptional
Caption = "&Optional"
ForeColor = &H00000080&
Height = 255
Left = 2280
TabIndex = 16
ToolTipText = "Is it optional?"
Top = 1080
Width = 1095
End
Begin VB.CheckBox chkByValue
Caption = "By &Value"
ForeColor = &H00000080&
Height = 255
Left = 120
TabIndex = 14
ToolTipText = "Do you pass it by value? "
Top = 1080
Width = 1095
End
Begin VB.CheckBox chkArray
Caption = "&Array"
ForeColor = &H00000080&
Height = 255
Left = 1200
TabIndex = 15
ToolTipText = "Is this an array?"
Top = 1080
Width = 1095
End
Begin VB.ComboBox cbDatatype
Height = 315
Left = 960
Sorted = -1 'True
TabIndex = 13
Text = "Combo1"
ToolTipText = "What kind of argument it is?"
Top = 680
Width = 3255
End
Begin VB.TextBox tbNameArgument
Height = 285
Left = 960
TabIndex = 12
Text = "Text1"
ToolTipText = "Give the name of the new argument"
Top = 320
Width = 3255
End
Begin VB.Label lbDefaultValue
AutoSize = -1 'True
Caption = "&Default Value :"
Height = 195
Left = 120
TabIndex = 38
Top = 1470
Width = 1050
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "Data type :"
Height = 195
Left = 120
TabIndex = 37
Top = 720
Width = 780
End
Begin VB.Label Label3
Caption = "&Name :"
Height = 255
Left = 120
TabIndex = 36
Top = 360
Width = 855
End
End
End
Begin VB.Frame frameTab
ForeColor = &H00800000&
Height = 4215
Index = 1
Left = 240
TabIndex = 28
Top = 480
Width = 4575
Begin VB.CheckBox chkAddEnhancedError
Alignment = 1 'Right Justify
Caption = "Add Enhanced Error handler"
ForeColor = &H00000080&
Height = 255
Left = 120
TabIndex = 39
ToolTipText = "Add the enhanced error handler"
Top = 3315
Width = 2415
End
Begin VB.CheckBox chkAddStandardError
Alignment = 1 'Right Justify
Caption = "Add Standard Error handler"
ForeColor = &H00000080&
Height = 255
Left = 120
TabIndex = 11
ToolTipText = "Add the standard error handler"
Top = 2955
Width = 2415
End
Begin VB.CheckBox chkAddProcedureHeader
Alignment = 1 'Right Justify
Caption = "Add Procedure Header"
ForeColor = &H00000080&
Height = 255
Left = 120
TabIndex = 10
ToolTipText = "Add the procedure header"
Top = 2595
Value = 1 'Checked
Width = 2415
End
Begin VB.ComboBox cbType
Enabled = 0 'False
Height = 315
Left = 1200
Sorted = -1 'True
TabIndex = 9
Text = "Combo1"
ToolTipText = "Set the return type for the functions"
Top = 2160
Width = 3255
End
Begin VB.Frame frameProperty
Caption = "Property"
Enabled = 0 'False
ForeColor = &H00008000&
Height = 1455
Left = 3000
TabIndex = 32
ToolTipText = "In case of property, read/only?"
Top = 600
Width = 1455
Begin VB.CheckBox chkWrite
Caption = "&Write"
Height = 195
Left = 120
TabIndex = 8
Top = 720
Value = 1 'Checked
Width = 1215
End
Begin VB.CheckBox chkRead
Caption = "&Read"
Height = 195
Left = 120
TabIndex = 7
Top = 360
Value = 1 'Checked
Width = 1215
End
End
Begin VB.Frame frameScope
Caption = "Scope"
ForeColor = &H00000080&
Height = 1455
Left = 1560
TabIndex = 31
ToolTipText = "Set the scope for your new procedure..."
Top = 600
Width = 1335
Begin VB.OptionButton optScope
Caption = "&Private"
Height = 195
Index = 0
Left = 120
TabIndex = 4
Top = 360
Value = -1 'True
Width = 1095
End
Begin VB.OptionButton optScope
Caption = "P&ublic"
Height = 195
Index = 1
Left = 120
TabIndex = 5
Top = 720
Width = 1095
End
Begin VB.OptionButton optScope
Caption = "Fr&iend"
Height = 195
Index = 2
Left = 120
TabIndex = 6
Top = 1080
Width = 1095
End
End
Begin VB.Frame frameType
Caption = "Type"
ForeColor = &H00800000&
Height = 1455
Left = 120
TabIndex = 30
ToolTipText = "Is this a procedure, function or property?"
Top = 600
Width = 1335
Begin VB.OptionButton optType
Caption = "&Property"
Height = 195
Index = 2
Left = 120
TabIndex = 3
Top = 1080
Width = 1095
End
Begin VB.OptionButton optType
Caption = "&Function"
Height = 195
Index = 1
Left = 120
TabIndex = 2
Top = 720
Width = 1095
End
Begin VB.OptionButton optType
Caption = "&Sub"
Height = 195
Index = 0
Left = 120
TabIndex = 1
Top = 360
Value = -1 'True
Width = 1095
End
End
Begin VB.TextBox tbNameProcedure
Height = 285
Left = 840
TabIndex = 0
Text = "Text1"
ToolTipText = "Set the name of the procedure/function/property"
Top = 210
Width = 3615
End
Begin VB.Label lbType
AutoSize = -1 'True
Caption = "Return type :"
Enabled = 0 'False
Height = 195
Left = 120
TabIndex = 33
Top = 2205
Width = 915
End
Begin VB.Label Label1
Caption = "&Name :"
Height = 255
Left = 120
TabIndex = 29
Top = 240
Width = 855
End
End
Begin MSComctlLib.TabStrip TabStrip
Height = 4695
Left = 120
TabIndex = 43
Top = 120
Width = 4815
_ExtentX = 8493
_ExtentY = 8281
TabWidthStyle = 2
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 3
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "General"
Key = "General"
Object.ToolTipText = "General infos about the procedure creation"
ImageVarType = 2
EndProperty
BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Arguments"
Key = "Arguments"
Object.ToolTipText = "Set the arguments for the procedure"
ImageVarType = 2
EndProperty
BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Description"
Key = "Description"
Object.ToolTipText = "Set the description and other attributes of the procedure"
ImageVarType = 2
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmAddNewProcedure"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 09/11/1999
' * Time : 10:26
' * Module Name : frmAddNewProcedure
' * Module Filename : AddProcedure.frm
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Option Explicit
Private clsTooltips As New class_Tooltips
Private mnCurFrame As Integer
Private Sub chkAddEnhancedError_Click()
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 09/11/1999
' * Time : 12:40
' * Module Name : frmAddNewProcedure
' * Module Filename : AddProcedure.frm
' * Procedure Name : chkAddEnhancedError_Click
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
If (chkAddStandardError.Value = vbChecked) And (chkAddEnhancedError.Value = vbChecked) Then chkAddStandardError.Value = vbUnchecked
End Sub
Private Sub chkAddstandardError_Click()
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 09/11/1999
' * Time : 12:41
' * Module Name : frmAddNewProcedure
' * Module Filename : AddProcedure.frm
' * Procedure Name : chkAddstandardError_Click
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
If (chkAddStandardError.Value = vbChecked) And (chkAddEnhancedError.Value = vbChecked) Then chkAddEnhancedError.Value = vbUnchecked
End Sub
Private Sub cmdAddArgument_Click()
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 09/11/1999
' * Time : 14:42
' * Module Name : frmAddNewProcedure
' * Module Filename : AddProcedure.frm
' * Procedure Name : cmdAddArgument_Click
' * Parameters :
' **********************************************************************
' * Comments :
' * Add the parameter to the list
' *
' **********************************************************************
' #VBIDEUtilsERROR#
On Error GoTo ERROR_cmdAddArgument_Click
Dim sTmp As String
sTmp = ""
If Trim$(tbNameArgument.Text) = "" Then Exit Sub
If chkOptional.Value = vbChecked Then sTmp = sTmp & "Optional "
If chkByValue.Value = vbChecked Then sTmp = sTmp & "ByVal "
sTmp = sTmp & Trim$(tbNameArgument.Text)
If chkArray.Value = vbChecked Then
sTmp = sTmp & "() "
Else
sTmp = sTmp & " "
End If
If Trim$(cbDatatype.Text) <> "" Then sTmp = sTmp & "As " & Trim$(cbDatatype.Text) & " "
If chkOptional.Value = vbChecked And Trim$(tbDefaultValue.Text) <> "" Then
Select Case UCase$(Trim$(cbDatatype.Text))
Case "STRING":
sTmp = sTmp & "= """ & Trim$(tbDefaultValue.Text) & """ "
Case Else:
sTmp = sTmp & "= " & Trim$(tbDefaultValue.Text) & " "
End Select
End If
lstParameters.AddItem sTmp
EXIT_cmdAddArgument_Click:
tbNameArgument.Text = ""
chkByValue.Value = vbUnchecked
chkOptional.Value = vbUnchecked
cbDatatype.Text = "Variant"
Exit Sub
' #VBIDEUtilsERROR#
ERROR_cmdAddArgument_Click:
' Select Case MsgBoxTop(Me.hwnd, "Error " & Err.number & ": " & Err.Description & vbCrLf & "in cmdAddArgument_Click", vbAbortRetryIgnore + vbCritical, "Error")
' Case vbAbort
' Screen.MousePointer = vbDefault
' Resume EXIT_cmdAddArgument_Click
' Case vbRetry
' Resume
' Case vbIgnore
' Resume Next
' End Select
Resume EXIT_cmdAddArgument_Click
End Sub
Private Sub cmdCancel_Click()
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 09/11/1999
' * Time : 14:42
' * Module Name : frmAddNewProcedure
' * Module Filename : AddProcedure.frm
' * Procedure Name : cmdCancel_Click
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Call UnloadEffect(Me)
Unload Me
End Sub
Private Sub cmdMoveDown_Click()
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 09/11/1999
' * Time : 14:51
' * Module Name : frmAddNewProcedure
' * Module Filename : AddProcedure.frm
' * Procedure Name : cmdMoveDown_Click
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim sTmp As String
Dim nI As Long
On Error Resume Next
If (lstParameters.ListIndex = -1) Or (lstParameters.ListIndex = lstParameters.ListCount - 1) Then Exit Sub
nI = lstParameters.ListIndex
sTmp = lstParameters.List(nI)
lstParameters.RemoveItem nI
lstParameters.AddItem sTmp, nI + 1
lstParameters.ListIndex = nI + 1
End Sub
Private Sub cmdMoveUp_Click()
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 09/11/1999
' * Time : 14:50
' * Module Name : frmAddNewProcedure
' * Module Filename : AddProcedure.frm
' * Procedure Name : cmdMoveUp_Click
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim sTmp As String
Dim nI As Long
On Error Resume Next
If lstParameters.ListIndex < 1 Then Exit Sub
nI = lstParameters.ListIndex
sTmp = lstParameters.List(nI)
lstParameters.RemoveItem nI
lstParameters.AddItem sTmp, nI - 1
lstParameters.ListIndex = nI - 1
End Sub
Private Sub cmdOK_Click()
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 09/11/1999
' * Time : 12:00
' * Module Name : frmAddNewProcedure
' * Module Filename : AddProcedure.frm
' * Procedure Name : cmdOk_Click
' * Parameters :
' **********************************************************************
' * Comments :
' * Generate the created procedure
' *
' **********************************************************************
' #VBIDEUtilsERROR#
On Error GoTo ERROR_cmdOk_Click
Dim nI As Long
Dim sTmp As String
Dim prjProject As VBProject
Dim cpCodePane As CodePane
Dim nProcKind As vbext_ProcKind
Dim nNbrPass As Integer
If Trim$(tbNameProcedure.Text) = "" Then Exit Sub
On Error Resume Next
' *** Get the active project
Set prjProject = VBInstance.ActiveVBProject
' *** If we couldn't get it, quit
If prjProject Is Nothing Then
'Call MsgBoxTop(Me.hwnd, "Could not identify current project", vbExclamation + vbOKOnly + vbDefaultButton1, "Indentify the project")
Exit Sub
End If
' *** Try to find the active code pane
Set cpCodePane = VBInstance.ActiveCodePane
' *** If we couldn't get it, quit
If cpCodePane Is Nothing Then
'Call MsgBoxTop(Me.hwnd, "Could not identify current module", vbExclamation + vbOKOnly + vbDefaultButton1, "Indentify the module")
Exit Sub
End If
nNbrPass = 0
If optType(2).Value Then
If chkRead.Value = vbChecked Then nNbrPass = nNbrPass + 1
If chkWrite.Value = vbChecked Then nNbrPass = nNbrPass + 1
End If
If nNbrPass = 0 Then
If optType(2).Value Then chkRead.Value = vbChecked
nNbrPass = 1
End If
sTmp = vbCrLf
Next_Pass:
' *** Select scope
If optScope(0).Value Then sTmp = sTmp & "Private "
If optScope(1).Value Then sTmp = sTmp & "Public "
If optScope(2).Value Then sTmp = sTmp & "Friend "
' *** Select type
If optType(0).Value Then
sTmp = sTmp & "Sub "
nProcKind = vbext_pk_Proc
End If
If optType(1).Value Then
sTmp = sTmp & "Function "
nProcKind = vbext_pk_Proc
End If
If optType(2).Value Then
sTmp = sTmp & "Property "
If chkRead.Value = vbChecked Then
nProcKind = vbext_pk_Get
sTmp = sTmp & "Get "
chkRead.Value = vbUnchecked
' *** Clear the parameters
lstParameters.Clear
ElseIf chkWrite.Value = vbChecked Then
nProcKind = vbext_pk_Let
sTmp = sTmp & "Let "
chkWrite.Value = vbUnchecked
' *** Add the parameter
lstParameters.Clear
lstParameters.AddItem "NewValue As " & cbType.Text
End If
End If
' *** Add the name
sTmp = sTmp & tbNameProcedure.Text & "("
' *** Add the parameters
For nI = 0 To lstParameters.ListCount - 1
sTmp = sTmp & lstParameters.List(nI) & ", "
Next
If right(sTmp, 2) = ", " Then sTmp = left$(sTmp, Len(sTmp) - 2)
sTmp = sTmp & ") "
' *** Add the return
If cbType.Text <> "" Then
If optType(2).Value Then
If nProcKind <> vbext_pk_Let Then
sTmp = sTmp & "As " & cbType.Text
End If
ElseIf optType(1).Value Then
sTmp = sTmp & "As " & cbType.Text
End If
End If
sTmp = sTmp & vbCrLf
sTmp = sTmp & vbCrLf
' *** Add the End Sub
If optType(0).Value Then sTmp = sTmp & "End Sub "
If optType(1).Value Then sTmp = sTmp & "End Function "
If optType(2).Value Then sTmp = sTmp & "End Property "
' *** Add this procedure
cpCodePane.CodeModule.AddFromString sTmp
nI = cpCodePane.CodeModule.ProcBodyLine(tbNameProcedure.Text, nProcKind)
cpCodePane.SetSelection nI, 1, nI, 1
cpCodePane.CodeModule.members(1).Description = tbDescription.Text
cpCodePane.CodeModule.members(1).HelpContextID = tbHelpContextID.Text
cpCodePane.CodeModule.members(1).Hidden = IIf(chkHidden.Value = vbChecked, True, False)
' *** Add the procedure Header
If chkAddProcedureHeader.Value = vbChecked Then Call InsertProcedureHeader
' *** Add the standard error handler
If chkAddStandardError.Value = vbChecked Then Call InsertProcedureError
' *** Add the enhanced error handler
If chkAddEnhancedError.Value = vbChecked Then Call InsertEnhancedProcedureError
If nNbrPass > 1 Then
nNbrPass = nNbrPass - 1
sTmp = ""
GoTo Next_Pass
End If
EXIT_cmdOk_Click:
Call InitAll
Call cmdCancel_Click
Exit Sub
' #VBIDEUtilsERROR#
ERROR_cmdOk_Click:
' Select Case MsgBoxTop(Me.hwnd, "Error " & Err.number & ": " & Err.Description & vbCrLf & "in cmdOk_Click", vbAbortRetryIgnore + vbCritical, "Error")
' Case vbAbort
' Screen.MousePointer = vbDefault
' Resume EXIT_cmdOk_Click
' Case vbRetry
' Resume
' Case vbIgnore
' Resume Next
' End Select
Resume EXIT_cmdOk_Click
End Sub
Private Sub cmdRemoveArgument_Click()
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 09/11/1999
' * Time : 14:48
' * Module Name : frmAddNewProcedure
' * Module Filename : AddProcedure.frm
' * Procedure Name : cmdRemoveArgument_Click
' * Parameters :
' **********************************************************************
' * Comments :
' * Remove the selected parameter
' *
' **********************************************************************
On Error Resume Next
If lstParameters.ListIndex = -1 Then Exit Sub
lstParameters.RemoveItem lstParameters.ListIndex
End Sub
Private Sub optType_Click(index As Integer)
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 09/11/1999
' * Time : 12:01
' * Module Name : frmAddNewProcedure
' * Module Filename : AddProcedure.frm
' * Procedure Name : optType_Click
' * Parameters :
' * Index As Integer
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Select Case index
Case 0:
' *** Procedure
frameScope.Enabled = True
optScope(2).Enabled = True
frameProperty.Enabled = False
cbType.Text = ""
lbType.Enabled = False
cbType.Enabled = False
Case 1:
' *** Function
frameScope.Enabled = True
optScope(2).Enabled = True
frameProperty.Enabled = False
lbType.Enabled = True
cbType.Enabled = True
Case 2:
' *** Property, disable friend and enable property
If optScope(2).Value = True Then optScope(1).Value = True
optScope(2).Enabled = False
frameScope.Enabled = True
frameProperty.Enabled = True
lbType.Enabled = True
cbType.Enabled = True
End Select
End Sub
Private Sub tabstrip_Click()
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 04/11/1999
' * Time : 16:51
' * Module Name : frmAddNewProcedure
' * Module Filename : AddProcedure.frm
' * Procedure Name : tabstrip_Click
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
On Error Resume Next
If TabStrip.SelectedItem.index = mnCurFrame Then Exit Sub ' No need to change frame.
' *** Otherwise, hide old frame, show new.
frametab(TabStrip.SelectedItem.index).left = 240
frametab(TabStrip.SelectedItem.index).top = 480
frametab(TabStrip.SelectedItem.index).Visible = True
frametab(mnCurFrame).Visible = False
frametab(TabStrip.SelectedItem.index).ZOrder
' *** Set mnCurFrame to new value.
mnCurFrame = TabStrip.SelectedItem.index
End Sub
Private Sub InitAll()
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 09/11/1999
' * Time : 11:48
' * Module Name : frmAddNewProcedure
' * Module Filename : AddProcedure.frm
' * Procedure Name : InitAll
' * Parameters :
' **********************************************************************
' * Comments :