-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRibbon.ctl
1216 lines (1160 loc) · 40.3 KB
/
Ribbon.ctl
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
Begin VB.UserControl Ribbon
Alignable = -1 'True
BackColor = &H00404040&
ClientHeight = 3000
ClientLeft = 0
ClientTop = 0
ClientWidth = 7095
ControlContainer= -1 'True
ScaleHeight = 3000
ScaleWidth = 7095
Begin VB.Label ButMouse
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 990
Index = 0
Left = 2040
TabIndex = 4
ToolTipText = "çlll"
Top = 1800
Visible = 0 'False
Width = 375
End
Begin VB.Image Glip_on
Height = 60
Index = 0
Left = 2280
Top = 1560
Visible = 0 'False
Width = 75
End
Begin VB.Image Glip_off
Height = 60
Index = 0
Left = 2160
Top = 1560
Visible = 0 'False
Width = 75
End
Begin VB.Image Button_left_over
Height = 990
Index = 0
Left = 2520
Top = 1800
Visible = 0 'False
Width = 45
End
Begin VB.Image Button_center_over
Height = 990
Index = 0
Left = 2640
Stretch = -1 'True
Top = 1800
Visible = 0 'False
Width = 735
End
Begin VB.Image Button_right_over
Height = 990
Index = 0
Left = 3480
Top = 1800
Visible = 0 'False
Width = 45
End
Begin VB.Image Cat_Dlg_over
Height = 210
Index = 0
Left = 4080
Top = 1320
Visible = 0 'False
Width = 225
End
Begin VB.Image Cat_Dlg_on
Height = 210
Index = 0
Left = 3840
Top = 1320
Visible = 0 'False
Width = 225
End
Begin VB.Image Cat_Dlg
Height = 210
Index = 0
Left = 3600
Top = 1320
Visible = 0 'False
Width = 225
End
Begin VB.Image Button_Icon
Appearance = 0 'Flat
Height = 495
Index = 0
Left = 1320
Top = 1920
Visible = 0 'False
Width = 615
End
Begin VB.Label Button_Caption
Alignment = 2 'Center
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "Label1"
BeginProperty Font
Name = "Verdana"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 240
Index = 0
Left = 1380
TabIndex = 5
Top = 2520
Visible = 0 'False
Width = 630
End
Begin VB.Image Button_right
Height = 990
Index = 0
Left = 1920
Top = 1800
Visible = 0 'False
Width = 45
End
Begin VB.Image Button_center
Height = 990
Index = 0
Left = 1080
Stretch = -1 'True
Top = 1800
Visible = 0 'False
Width = 735
End
Begin VB.Image Button_left
Height = 990
Index = 0
Left = 960
Top = 1800
Visible = 0 'False
Width = 45
End
Begin VB.Label TabMouse
Height = 360
Index = 0
Left = 2520
TabIndex = 1
Top = 120
Visible = 0 'False
Width = 735
End
Begin VB.Label Tab_caption
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Aba 01"
BeginProperty Font
Name = "Verdana"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 240
Index = 0
Left = 840
TabIndex = 0
Top = 180
Visible = 0 'False
Width = 690
End
Begin VB.Image Tab_right
Height = 360
Index = 0
Left = 2280
Top = 120
Visible = 0 'False
Width = 150
End
Begin VB.Image Tab_center
Height = 360
Index = 0
Left = 1920
Stretch = -1 'True
Top = 120
Visible = 0 'False
Width = 270
End
Begin VB.Image Tab_left
Height = 360
Index = 0
Left = 1680
Top = 120
Visible = 0 'False
Width = 150
End
Begin VB.Image Tab_left_over
Height = 360
Index = 0
Left = 1680
Top = 600
Visible = 0 'False
Width = 150
End
Begin VB.Image Tab_center_over
Height = 360
Index = 0
Left = 1920
Stretch = -1 'True
Top = 600
Visible = 0 'False
Width = 270
End
Begin VB.Image Tab_right_over
Height = 360
Index = 0
Left = 2280
Top = 600
Visible = 0 'False
Width = 150
End
Begin VB.Label CatMouse
Height = 1350
Index = 0
Left = 4560
TabIndex = 3
Top = 150
Visible = 0 'False
Width = 375
End
Begin VB.Label Cat_Caption
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Label1"
BeginProperty Font
Name = "Verdana"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 240
Index = 0
Left = 5040
TabIndex = 2
Tag = "sadf"
Top = 1200
Visible = 0 'False
Width = 630
End
Begin VB.Image Cat_Right_on
Height = 1335
Index = 0
Left = 6120
Top = 150
Visible = 0 'False
Width = 75
End
Begin VB.Image Cat_Center_on
Height = 1335
Index = 0
Left = 5880
Stretch = -1 'True
Top = 150
Visible = 0 'False
Width = 60
End
Begin VB.Image Cat_Left_on
Height = 1335
Index = 0
Left = 5760
Top = 150
Visible = 0 'False
Width = 60
End
Begin VB.Image Cat_Right_off
Height = 1335
Index = 0
Left = 5400
Top = 150
Visible = 0 'False
Width = 75
End
Begin VB.Image Cat_Left_off
Height = 1335
Index = 0
Left = 5040
Top = 150
Visible = 0 'False
Width = 60
End
Begin VB.Image Cat_Center_off
Height = 1335
Index = 0
Left = 5160
Stretch = -1 'True
Top = 150
Visible = 0 'False
Width = 75
End
Begin VB.Image BarraLeft
Height = 2130
Left = 0
Top = 0
Width = 165
End
Begin VB.Image BarraRight
Height = 2130
Left = 480
Top = 0
Width = 165
End
Begin VB.Image Barra2
Height = 2130
Left = 0
Stretch = -1 'True
Top = 0
Width = 405
End
End
Attribute VB_Name = "Ribbon"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "PropPageWizardRun" ,"Yes"
Private Declare Function GetTempFileName Lib "Kernel32" Alias "GetTempFileNameA" (ByVal lpszPath As String, ByVal lpPrefixString As String, ByVal wUnique As Long, ByVal lpTempFileName As String) As Long
Private Declare Function GetTempPath Lib "Kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Const MAX_PATH = 260
Private Const FORMAT_MESSAGE_ALLOCATE_BUFFER = &H100
Private Const FORMAT_MESSAGE_ARGUMENT_ARRAY = &H2000
Private Const FORMAT_MESSAGE_FROM_HMODULE = &H800
Private Const FORMAT_MESSAGE_FROM_STRING = &H400
Private Const FORMAT_MESSAGE_FROM_SYSTEM = &H1000
Private Const FORMAT_MESSAGE_IGNORE_INSERTS = &H200
Private Const FORMAT_MESSAGE_MAX_WIDTH_MASK = &HFF
Private Declare Function FormatMessage Lib "Kernel32" Alias "FormatMessageA" (ByVal dwFlags As Long, lpSource As Any, ByVal dwMessageId As Long, ByVal dwLanguageId As Long, ByVal lpBuffer As String, ByVal nSize As Long, Arguments As Long) As Long
Dim TotalButton As Integer
Dim TotalTabs As Integer
Dim TotalCats As Integer
Dim TabSelected As String
Dim TabID(30) As String
Dim TabC(30) As String
Dim CatsID(30) As String
Dim CatsC(30) As String
Dim CatsT(30) As String
Dim CatsD(30) As Boolean
Dim TopBuID(90) As String
Dim TopBuS(90) As String
Dim TopBuC(90) As String
Dim TopBuI(90) As Picture
Dim TopBuT(90) As String
Dim TopBuG(90) As Boolean
Dim ms As Boolean
Dim Mx, My As Integer
Event TabClick(ByVal ID As String, ByVal Caption As String)
Event CatClick(ByVal ID As String, ByVal Caption As String)
Event ButtonClick(ByVal ID As String, ByVal Caption As String)
Const m_def_Theme = 0
Const m_def_BC = False
Dim m_Theme As Variant
Dim m_BC As Boolean
Dim zImg As ImageList
Dim TAB_NORMAL
Dim TAB_SELECTED
Sub TabNone(Optional Index As Integer = -1)
If Index <> -1 Then
For i = 0 To Index - 1
If Tab_center_over(i).Visible = True Then
Tab_center_over(i).Visible = False
Tab_left_over(i).Visible = False
Tab_right_over(i).Visible = False
End If
Next
If Tab_center(Index).Visible = False Then
Tab_center_over(Index).Visible = True
Tab_left_over(Index).Visible = True
Tab_right_over(Index).Visible = True
End If
For i = Index + 1 To TabMouse.UBound
If Tab_center_over(i).Visible = True Then
Tab_center_over(i).Visible = False
Tab_left_over(i).Visible = False
Tab_right_over(i).Visible = False
End If
Next
Else
For i = 0 To TabMouse.UBound
If Tab_center_over(i).Visible = True Then
Tab_center_over(i).Visible = False
Tab_left_over(i).Visible = False
Tab_right_over(i).Visible = False
End If
Next
End If
End Sub
Private Sub CatNone(Optional Index As Integer = -1)
If Index <> -1 Then
For i = 0 To Index - 1
If Cat_Center_on(i).Visible = True Then
Cat_Center_on(i).Visible = False
Cat_Left_on(i).Visible = False
Cat_Right_on(i).Visible = False
If Cat_Dlg(i).Visible = True Then
Cat_Dlg_on(i).Visible = False
Cat_Dlg_over(i).Visible = False
End If
End If
Next
Cat_Center_on(Index).Visible = True
Cat_Left_on(Index).Visible = True
Cat_Right_on(Index).Visible = True
If Cat_Dlg(Index).Visible = True Then
Cat_Dlg_on(Index).Visible = True
Cat_Dlg_over(Index).Visible = False
End If
For i = Index + 1 To CatMouse.UBound
If Cat_Center_on(i).Visible = True Then
Cat_Center_on(i).Visible = False
Cat_Left_on(i).Visible = False
Cat_Right_on(i).Visible = False
If Cat_Dlg(i).Visible = True Then
Cat_Dlg_on(i).Visible = False
Cat_Dlg_over(i).Visible = False
End If
End If
Next
Else
For i = 0 To CatMouse.UBound
If Cat_Center_on(i).Visible = True Then
Cat_Center_on(i).Visible = False
Cat_Left_on(i).Visible = False
Cat_Right_on(i).Visible = False
If Cat_Dlg(i).Visible = True Then
Cat_Dlg_on(i).Visible = False
Cat_Dlg_over(i).Visible = False
End If
End If
Next
End If
End Sub
Private Sub ButNone(Optional Index As Integer = -1)
If Index <> -1 Then
For KL = 0 To Index - 1
If Button_center(KL).Visible = True Then
Button_left(KL).Visible = False
Button_right(KL).Visible = False
Button_center(KL).Visible = False
If Glip_off(i).Visible = True Then
Glip_on(i).Visible = False
End If
End If
Next
If Button_left(Index).Visible = False Then
Button_left(Index).Visible = True
Button_center(Index).Visible = True
Button_right(Index).Visible = True
If Glip_off(Index).Visible = True Then
Glip_on(Index).Visible = True
End If
End If
For KL = Index + 1 To ButMouse.UBound
If Button_center(KL).Visible = True Then
Button_left(KL).Visible = False
Button_right(KL).Visible = False
Button_center(KL).Visible = False
If Glip_off(i).Visible = True Then
Glip_on(i).Visible = False
End If
End If
Next
Else
For KL = 0 To ButMouse.UBound
If Button_center(KL).Visible = True Then
Button_left(KL).Visible = False
Button_right(KL).Visible = False
Button_center(KL).Visible = False
If Glip_off(i).Visible = True Then
Glip_on(i).Visible = False
End If
End If
Next
End If
End Sub
Private Sub Barra2_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
TabNone
CatNone
ButNone
End Sub
Private Sub BarraLeft_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
TabNone
CatNone
ButNone
End Sub
Private Sub BarraRight_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
TabNone
CatNone
ButNone
End Sub
Private Sub ButMouse_Click(Index As Integer)
RaiseEvent ButtonClick(ButMouse(Index).Tag, Button_Caption(Index).Caption)
End Sub
Private Sub ButMouse_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
Button_left_over(Index).Visible = True
Button_center_over(Index).Visible = True
Button_right_over(Index).Visible = True
End Sub
Private Sub ButMouse_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
TabNone
CatNone Button_center(Index).Tag
ButNone Index
End Sub
Private Sub ButMouse_MouseUp(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
Button_left_over(Index).Visible = False
Button_center_over(Index).Visible = False
Button_right_over(Index).Visible = False
End Sub
Private Sub Cat_Dlg_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
TabNone
CatNone Index
ButNone
End Sub
Private Sub Cat_Dlg_on_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
TabNone
CatNone Index
ButNone
Cat_Dlg_over(Index).Visible = True
End Sub
Private Sub Cat_Dlg_over_Click(Index As Integer)
RaiseEvent CatClick(Cat_Caption(Index).Tag, Cat_Caption(Index).Caption)
End Sub
Private Sub CatMouse_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
TabNone
CatNone Index
ButNone
End Sub
Private Sub TabMouse_Click(Index As Integer)
TabNone
For i = 0 To Index - 1
Tab_center(i).Visible = False
Tab_left(i).Visible = False
Tab_right(i).Visible = False
Tab_caption(i).ForeColor = TAB_NORMAL
Next
Tab_caption(Index).ForeColor = TAB_SELECTED
Tab_center(Index).Visible = True
Tab_left(Index).Visible = True
Tab_right(Index).Visible = True
For i = Index + 1 To TabMouse.UBound
Tab_center(i).Visible = False
Tab_left(i).Visible = False
Tab_right(i).Visible = False
Tab_caption(i).ForeColor = TAB_NORMAL
Next
TabSelected = TabID(Index)
CatsUpdate
RaiseEvent TabClick(TabID(Index), TabC(Index))
End Sub
Private Sub TabMouse_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
TabNone Index
CatNone
ButNone
End Sub
Private Sub UserControl_Initialize()
Barra2.Top = -(26 * 15)
BarraLeft.Top = Barra2.Top
BarraRight.Top = Barra2.Top
UserControl.Height = Barra2.Height
Barra2.Width = 2048 * 15
TotalTopButton = 0
TotalButton = 0
TotalTabs = 0
TotalCats = 0
TabSelected = ""
TabMouse(0).BackStyle = 0
CatMouse(0).BackStyle = 0
ButMouse(0).BackStyle = 0
End Sub
Private Sub TabsUpdate()
On Error Resume Next
For i = 1 To (TotalTabs - 1)
Unload Tab_caption(i)
Unload Tab_left(i)
Unload Tab_center(i)
Unload Tab_right(i)
Unload Tab_left_over(i)
Unload Tab_center_over(i)
Unload Tab_right_over(i)
Unload TabMouse(i)
Next
For i = 0 To (TotalTabs - 1)
If i <> 0 Then
Load Tab_caption(i)
Load Tab_left(i)
Load Tab_center(i)
Load Tab_right(i)
Load Tab_left_over(i)
Load Tab_center_over(i)
Load Tab_right_over(i)
Load TabMouse(i)
Tab_left(i).Left = Tab_right(i - 1).Left + Tab_right(i).Width
Else
Tab_left(0).Left = 90
End If
TabMouse(i).Left = Tab_left(i).Left
Tab_caption(i).Top = 0 + 60
Tab_center(i).Top = 0
Tab_left(i).Top = 0
Tab_right(i).Top = 0
Tab_center_over(i).Top = 0
Tab_left_over(i).Top = 0
Tab_right_over(i).Top = 0
TabMouse(i).Top = 0
Tab_caption(i) = TabC(i)
Tab_center(i).Width = Tab_caption(i).Width
Tab_center(i).Left = Tab_left(i).Left + Tab_left(i).Width
Tab_caption(i).Left = Tab_center(i).Left
Tab_right(i).Left = Tab_center(i).Left + Tab_center(i).Width
Tab_center_over(i).Width = Tab_center(i).Width
Tab_center_over(i).Left = Tab_center(i).Left
Tab_left_over(i).Left = Tab_left(i).Left
Tab_right_over(i).Left = Tab_right(i).Left
TabMouse(i).Width = Tab_left(i).Width + Tab_right(i).Width + Tab_center(i).Width
Tab_caption(i).ForeColor = TAB_NORMAL
Tab_caption(i).Visible = True
If i = 0 Then
Tab_center(i).Visible = True
Tab_left(i).Visible = True
Tab_right(i).Visible = True
Tab_caption(i).ForeColor = TAB_SELECTED
End If
TabMouse(i).Visible = True
Tab_center(i).ZOrder 0
Tab_left(i).ZOrder 0
Tab_right(i).ZOrder 0
Tab_center_over(i).ZOrder 0
Tab_left_over(i).ZOrder 0
Tab_right_over(i).ZOrder 0
Tab_caption(i).ZOrder 0
TabMouse(i).ZOrder 0
Next
End Sub
Private Sub CatsUpdate()
On Error Resume Next
ztopo = 360
Cat_Center_off(0).Top = ztopo
Cat_Center_on(0).Top = ztopo
Cat_Left_off(0).Top = ztopo
Cat_Left_on(0).Top = ztopo
Cat_Right_off(0).Top = ztopo
Cat_Right_on(0).Top = ztopo
CatMouse(0).Top = ztopo
Cat_Caption(0).Top = 1400
Dim TotalCatsT As Integer
Dim CatsIDT(30) As String
Dim CatsCT(30) As String
Dim CatsTT(30) As String
Dim CatsDT(30) As Boolean
TotalCatsT = 0
For i = 0 To TotalCats
If CatsT(i) = TabSelected And TabSelected <> "" And CatsT(i) <> "" Then
CatsIDT(TotalCatsT) = CatsID(i)
CatsTT(TotalCatsT) = CatsT(i)
CatsCT(TotalCatsT) = CatsC(i)
CatsDT(TotalCatsT) = CatsD(i)
TotalCatsT = TotalCatsT + 1
End If
Next
For i = 1 To CatMouse.UBound
Unload Cat_Left_off(i)
Unload Cat_Left_on(i)
Unload Cat_Right_off(i)
Unload Cat_Right_on(i)
Unload Cat_Center_off(i)
Unload Cat_Center_on(i)
Unload Cat_Caption(i)
Unload CatMouse(i)
Unload Cat_Dlg(i)
Unload Cat_Dlg_on(i)
Unload Cat_Dlg_over(i)
Next
For i = 1 To Button_center.UBound
Unload Button_left(i)
Unload Button_center(i)
Unload Button_right(i)
Unload Button_left_over(i)
Unload Button_center_over(i)
Unload Button_right_over(i)
Unload Button_Caption(i)
Unload Button_Icon(i)
Unload Glip_on(i)
Unload Glip_off(i)
Unload ButMouse(i)
Next
Button_left(0).Visible = False
Button_center(0).Visible = False
Button_right(0).Visible = False
Button_Caption(0).Visible = False
Button_Icon(0).Visible = False
ButMouse(0).Visible = False
Cat_Left_off(0).Visible = False
Cat_Left_on(0).Visible = False
Cat_Right_off(0).Visible = False
Cat_Right_on(0).Visible = False
Cat_Center_off(0).Visible = False
Cat_Center_on(0).Visible = False
Cat_Caption(0).Visible = False
CatMouse(0).Visible = False
Cat_Dlg(0).Visible = False
Cat_Dlg_on(0).Visible = False
Cat_Dlg_over(0).Visible = False
For i = 0 To (TotalCatsT - 1)
If i <> 0 Then
Load Cat_Left_off(i)
Load Cat_Left_on(i)
Load Cat_Right_off(i)
Load Cat_Right_on(i)
Load Cat_Center_off(i)
Load Cat_Center_on(i)
Load Cat_Caption(i)
Load CatMouse(i)
Load Cat_Dlg(i)
Load Cat_Dlg_on(i)
Load Cat_Dlg_over(i)
Cat_Left_off(i).Left = Cat_Right_off(i - 1).Left + Cat_Right_off(i).Width
Else
Cat_Left_off(i).Left = 120
End If
CatMouse(i).Left = Cat_Left_off(i).Left
Cat_Caption(i).Caption = CatsCT(i)
Cat_Caption(i).Tag = CatsIDT(i)
Cat_Center_off(i).Left = Cat_Left_off(i).Left + Cat_Left_off(i).Width
BUTSIZE = ButtonsUpdate(CatsIDT(i), Cat_Center_off(i).Left, i + 0)
If CatsDT(i) = True Then
Cat_Center_off(i).Width = Cat_Caption(i).Width + Cat_Dlg(i).Width
Else
Cat_Center_off(i).Width = Cat_Caption(i).Width
End If
If Cat_Center_off(i).Width < BUTSIZE Then
Cat_Center_off(i).Width = BUTSIZE
Cat_Caption(i).Left = Cat_Center_off(i).Left + ((Cat_Center_off(i).Width - Cat_Caption(i).Width) / 2)
Else
Cat_Caption(i).Left = Cat_Center_off(i).Left
End If
Cat_Right_off(i).Left = Cat_Center_off(i).Left + Cat_Center_off(i).Width
Cat_Center_on(i).Width = Cat_Center_off(i).Width
Cat_Center_on(i).Left = Cat_Center_off(i).Left
Cat_Left_on(i).Left = Cat_Left_off(i).Left
Cat_Right_on(i).Left = Cat_Right_off(i).Left
CatMouse(i).Width = Cat_Left_off(i).Width + Cat_Right_off(i).Width + Cat_Center_off(i).Width
Cat_Caption(i).Visible = True
Cat_Center_off(i).Visible = True
Cat_Left_off(i).Visible = True
Cat_Right_off(i).Visible = True
CatMouse(i).Visible = True
Cat_Center_off(i).ZOrder 0
Cat_Left_off(i).ZOrder 0
Cat_Right_off(i).ZOrder 0
Cat_Center_on(i).ZOrder 0
Cat_Left_on(i).ZOrder 0
Cat_Right_on(i).ZOrder 0
Cat_Caption(i).ZOrder 0
CatMouse(i).ZOrder 0
Cat_Dlg(i).Left = (Cat_Right_off(i).Left - Cat_Dlg(i).Width) + 15
Cat_Dlg(i).Top = (Cat_Right_off(i).Top + Cat_Right_off(i).Height) - (Cat_Dlg(i).Height + 60)
Cat_Dlg_on(i).Left = Cat_Dlg(i).Left
Cat_Dlg_over(i).Left = Cat_Dlg(i).Left
Cat_Dlg_on(i).Top = Cat_Dlg(i).Top
Cat_Dlg_over(i).Top = Cat_Dlg(i).Top
Cat_Dlg_on(i).Visible = False
Cat_Dlg_over(i).Visible = False
If CatsDT(i) = True Then
Cat_Dlg(i).Visible = True
End If
Cat_Dlg(i).ZOrder 0
Cat_Dlg_on(i).ZOrder 0
Cat_Dlg_over(i).ZOrder 0
Next
DoEvents
For KL = 0 To ButMouse.UBound
Button_left(KL).Visible = False
Button_left(KL).ZOrder 0
Button_right(KL).Visible = False
Button_right(KL).ZOrder 0
Button_center(KL).Visible = False
Button_center(KL).ZOrder 0
Button_left_over(KL).Visible = False
Button_left_over(KL).ZOrder 0
Button_right_over(KL).Visible = False
Button_right_over(KL).ZOrder 0
Button_center_over(KL).Visible = False
Button_center_over(KL).ZOrder 0
Button_Icon(KL).ZOrder 0
Button_Caption(KL).ZOrder 0
Glip_off(KL).ZOrder 0
Glip_on(KL).ZOrder 0
ButMouse(KL).ZOrder 0
Next
End Sub
Private Sub UserControl_Resize()
'On Error Resume Next
UserControl.Height = Barra2.Height - (26 * 15)
'UserControl.Width = UserControl.ParentControls.Item(0).ScaleWidth
'BarraRight.Left = UserControl.Width - BarraRight.Width
End Sub
Public Sub Refresh()
Attribute Refresh.VB_Description = "Forces a complete repaint of a object."
UserControl_Resize
TabsUpdate
CatsUpdate
End Sub
Private Sub UserControl_InitProperties()
m_Theme = m_def_Theme
m_BC = m_def_BC
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
m_Theme = PropBag.ReadProperty("Theme", m_def_Theme)
m_BC = PropBag.ReadProperty("ButtonCenter", m_def_BC)
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("Theme", m_Theme, m_def_Theme)
Call PropBag.WriteProperty("ButtonCenter", m_BC, m_def_BC)
Call PropBag.WriteProperty("BackColor", UserControl.BackColor, &H464646)
Call PropBag.WriteProperty("ForeColor", UserControl.ForeColor, &HFFFFFF)
End Sub
Public Function AddTab(zID As String, zCaption As String) As Boolean
TotalTabs = TotalTabs + 1
TabID(TotalTabs - 1) = zID
zCaption = Replace(zCaption, vbNewLine, " ")
TabC(TotalTabs - 1) = zCaption
If TabSelected = "" Then
TabSelected = zID
End If
End Function
Public Function AddCat(zID As String, zTab As String, zCaption As String, zDlgButton As Boolean) As Boolean
TotalCats = TotalCats + 1
CatsID(TotalCats - 1) = zID
CatsT(TotalCats - 1) = zTab
zCaption = Replace(zCaption, vbNewLine, " ")
CatsC(TotalCats - 1) = zCaption
CatsD(TotalCats - 1) = zDlgButton
End Function
Public Function AddButton(zID As String, zSubCat As String, zCaption As String, zPicture As Integer, Optional zMore As Boolean = False, Optional zToolTip As String) As Boolean
On Error Resume Next
TotalButton = TotalButton + 1
TopBuID(TotalButton - 1) = zID
TopBuS(TotalButton - 1) = zSubCat
TopBuC(TotalButton - 1) = zCaption
If zToolTip = "" Or zToolTip = Null Then
If InStr(zCaption, vbNewLine) Then
zCaption = Replace(zCaption, vbNewLine, " ")
End If
TopBuT(TotalButton - 1) = zCaption
Else
zToolTip = Replace(zToolTip, vbNewLine, " ")
TopBuT(TotalButton - 1) = zToolTip
End If
Set TopBuI(TotalButton - 1) = zImg.ListImages.Item(zPicture).Picture
TopBuG(TotalButton - 1) = zMore
End Function
Private Function ButtonsUpdate(SubCat As String, PosIni As Integer, CatID As Integer) As Integer
On Error Resume Next
Dim TotalButtonT As Integer
Dim TopBuIDT(90) As String
Dim TopBuST(90) As String
Dim TopBuCT(90) As String
Dim TopBuIT(90) As Picture
Dim TopBuTT(90) As String
Dim TopBuGT(90) As Boolean
TotalSize = 0
TotalButtonT = 0
For i = 0 To TotalButton
If TopBuS(i) = SubCat Then
TopBuIDT(TotalButtonT) = TopBuID(i)
TopBuST(TotalButtonT) = TopBuS(i)
TopBuCT(TotalButtonT) = TopBuC(i)
TopBuTT(TotalButtonT) = TopBuT(i)
Set TopBuIT(TotalButtonT) = TopBuI(i)
TopBuGT(TotalButtonT) = TopBuG(i)
TotalButtonT = TotalButtonT + 1
End If
Next
Button_left(0).Visible = False
Button_center(0).Visible = False
Button_right(0).Visible = False
Button_Caption(0).Visible = True
Button_Icon(0).Visible = True
ButMouse(0).Visible = True
xt = ButMouse.UBound + 1
For i = xt To (TotalButtonT - 1) + xt
If i <> 0 Then
Load Button_left(i)
Load Button_center(i)
Load Button_right(i)
Load Button_left_over(i)
Load Button_center_over(i)
Load Button_right_over(i)
Load Button_Caption(i)
Load Button_Icon(i)
Load Glip_on(i)
Load Glip_off(i)
Load ButMouse(i)
End If
ButMouse(i).Tag = TopBuIDT(i - xt)
Button_center(i).Tag = CatID
ButMouse(i).Top = Cat_Left_off(0).Top + 60
Button_left(i).Top = ButMouse(i).Top
Button_center(i).Top = ButMouse(i).Top
Button_right(i).Top = ButMouse(i).Top
Button_left_over(i).Top = ButMouse(i).Top
Button_center_over(i).Top = ButMouse(i).Top
Button_right_over(i).Top = ButMouse(i).Top
If i = xt Then
posatu = PosIni
Else
posatu = ButMouse(i - 1).Left + ButMouse(i - 1).Width + 30
End If
ButMouse(i).Left = posatu
Button_left(i).Left = ButMouse(i).Left
Button_left_over(i).Left = Button_left(i).Left
Button_center(i).Left = Button_left(i).Left + Button_left(i).Width
Button_center_over(i).Left = Button_center(i).Left
Button_Caption(i).Caption = TopBuCT(i - xt)
Set Button_Icon(i) = TopBuIT(i - xt)
If m_BC = True Then
ESP = Button_center(i).Height - (Button_Icon(i).Height + Button_Caption(i).Height)
If TopBuGT(i - xt) = True Then
Button_Icon(i).Top = Button_center(i).Top + ((ESP - (Button_Caption(i).Height / 2)) / 2)
Else
Button_Icon(i).Top = Button_center(i).Top + ((ESP) / 2)
End If
Else
Button_Icon(i).Top = Button_center(i).Top + 90
End If
Button_Caption(i).Top = Button_Icon(i).Top + Button_Icon(i).Height
Glip_off(i).Top = Button_Caption(i).Top + Button_Caption(i).Height + ((Button_Caption(i).Height - Glip_off(i).Height) / 2)
Glip_on(i).Top = Glip_off(i).Top
If Button_Caption(i).Width > Button_Icon(i).Width Then