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
| Private Sub Tw_Mousedown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Long, ByVal Y As Long)
'Gérer le click droit de la souris sur un noeud
'Click droit seul : on ouvre un menu contextuel de type utilisateur
'Click droit + Shift : on ouvre un menu contextuel de type configurateur
Dim nodCurrent As Node
Dim Vloc As New ObjVariables
'Si click droit sans SHIFT sur un noeud déclenche le menu Utilisateur
DoEvents
If Button = vbKeyRButton And Shift = 0 Then
Set nodCurrent = Tw.HitTest(X, Y)
Set Tw.DropHighlight = Tw.HitTest(X, Y)
Select Case Vloc.Item("VpTwName")
Case "INFRA" 'Le treeview actif est l'infrastructure générale
'Vérifier qu'un Node est effectivement pointé
If Not (nodCurrent Is Nothing) Then
'Si l'objet pointé est un équipement
If Vloc.Item("VpObjStrType") = "E" Then
Call Contextuel("TwEqpUser", Vloc.Item("VpUserPrivilege"), "-")
End If
Else
'Click droit dans le treeview sans noeud défini
Call Contextuel("TwEqpGen", Vloc.Item("VpUserPrivilege"), "-")
End If
End Select
End If
'Si click droit avec SHIFT sur un noeud déclenche le menu configurateur
If Button = vbKeyRButton And Shift = 1 Then
Set nodCurrent = Tw.HitTest(X, Y)
Select Case Vloc.Item("VpTwName")
Case "INFRA" 'Le treeview actif est l'infrastructure générale
'Vérifier qu'un Node est effectivement pointé
If Not (nodCurrent Is Nothing) Then
Call Contextuel("TwEqpConf", Vloc.Item("VpUserPrivilege"), "-")
End If
End Select
End If
' Set Tw.DropHighlight = Nothing
Set nodCurrent = Nothing
Set Vloc = Nothing
End Sub |
Partager