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
| ' ===============================
' DEB - Popup
Private Sub popup_Liste(ByVal obj As Object)
Dim strEquipe As String
strEquipe = obj.Caption
Dim NumInter As Long
Dim FinInter As String
Dim trouveEquipe As String
Dim foundFlag As Boolean
Dim bar As CommandBar
foundFlag = False
For Each bar In CommandBars
If Not bar.BuiltIn And bar.Name = "cbInter" & strEquipe Then
foundFlag = True
bar.Delete
End If
Next
If Not foundFlag Then
'Set moCBInterventions = Application.CommandBars.Add("cbImage" & strEquipe, msoBarPopup, , True)
'CommandBars("moCBInterventions").Visible = True
End If
'Add the parent command bar popup
Set moCBInterventions = Application.CommandBars.Add("cbInter" & strEquipe, msoBarPopup, , True)
With moCBInterventions
.Name = "cbInter" & strEquipe
.Enabled = True
End With
If MesBoutons.BackStyle = 1 Then ' Gestion du statut "EN PAUSE"
Dim oCBBilan As Office.CommandBarButton
Set oCBBilan = moCBInterventions.Controls.Add(msoControlButton, 1, "9990", , True)
With oCBBilan
.Caption = "Nouvelle intervention"
.Enabled = True
.FaceId = 3732 'Open folder bitmap resource image
.OnAction = "'btLogAdd """ & CStr(obj.Name) & """'"
'.OnAction = Obj.Name & "_Click"
.Style = msoButtonIconAndCaption
.Visible = True
End With
Dim oCBInter As Office.CommandBarButton
With Worksheets("Chrono")
Dim l As Long
l = 5
Set oCBInter = moCBInterventions.Controls.Add(msoControlButton, 1, 0, , True)
With oCBInter
.BeginGroup = True
.Enabled = False
.Height = 1
'.Caption = "Interventions :"
End With
While .Range("B" & l).value <> ""
trouveEquipe = CStr(.Range("B" & l).value)
NumInter = .Range("D" & l).value
FinInter = CStr(.Range("G" & l).value)
If NumInter > 0 And FinInter = "" And trouveEquipe = strEquipe Then
Set oCBInter = moCBInterventions.Controls.Add(msoControlButton, 1, NumInter, , True)
With oCBInter
'.BeginGroup = True
.Caption = "Victime N°" & NumInter
.Enabled = True
.FaceId = 1758 'Open folder bitmap resource image
.OnAction = "'FicheInterShow """ & CStr(strEquipe) & """,""" & CInt(NumInter) & """'"
.Style = msoButtonIconAndCaption
.Visible = True
End With
Debug.Print "SitacBoutons popup_Liste() Créer lien FicheInterShow Equipe " & strEquipe & " NumInter " & NumInter
End If
l = l + 1
Wend
End With ' FIN - Worksheets("Chrono")
End If
If obj.BackColor = RGB(0, 255, 0) Then
Set oCBBilan = moCBInterventions.Controls.Add(msoControlButton, 1, "9990", , True)
With oCBBilan
.Caption = IIf(obj.BackStyle = 1, "En pause", "Fin de pause")
.Enabled = True
.FaceId = IIf(obj.BackStyle = 1, 342, 343) 'Pause - ampoule : allumée / éteinte
.OnAction = "'btPause """ & CStr(obj.Name) & """'"
.Style = msoButtonIconAndCaption
.Visible = True
.BeginGroup = True
End With
End If
End Sub
' FIN - Popup |
Partager