Re: Soucis de double click
Publié : lun. 17/juin/2013 15:12
				
				Si on remplace #PB_EventType_LeftDoubleClick par le nombre 768, ça marche  
 
Mais je ne sais pas pourquoi
 
Mesa
			Mais je ne sais pas pourquoi
Code : Tout sélectionner
Debug #PB_EventType_LeftDoubleClick
UseJPEGImageEncoder()
UseJPEGImageDecoder()
UsePNGImageEncoder()
UsePNGImageDecoder()
UseTGAImageDecoder()
UseTIFFImageDecoder()
; UseJPEG2000ImageDecoder()
; UseJPEG2000ImageEncoder()
Declare Affiche()
Enumeration
  #ARS
EndEnumeration
Enumeration
  #Panel
  #ROOT
  #EXP
  #CANVAS
EndEnumeration
Enumeration
  #TOUCHE_ESC
EndEnumeration
Enumeration 
  #T ; Timer
EndEnumeration
Structure Info
  ID.i
  imgID.i
  IDpic.i
  IDmin.i
  imgIDpic.q
  imgIDmin.q
  Name.s
  Path.s
  L.i
  H.i
  
  Poids.q
  
EndStructure
Global.b Quite, ThreadLIST
Global NewMap img.info()
Global.i Hbarre, Lwin, Hwin, Lmin, Hmin, Lexp, Lcanvas, Hcanvas, LminPic, HminPic
Global.s RepEnCours, RepSelect, rep, OldROOT, Root, ROOTex
Global.s IMGpath  
;-----------------------------
; A MODIFIER
IMGpath.s = "F:\"
; -----------------------------
Lexp = 300 ; largeur de l'explorer
Quite = 0
ThreadLIST = 0      
; --------------------------------------------------------------------------------------------
; ----------- PROCE ------------ LISTAGE DES IMAGES
; --------------------------------------------------------------------------------------------
Procedure.i ListPics(*ZBOUB)
  
EndProcedure
; --------------------------------------------------------------------------------------------
; ----------- PROCE ------------ AFFICHAGE DES MINIATURES
; --------------------------------------------------------------------------------------------
Procedure Affiche()
  
EndProcedure
; --------------------------------------------------------------------------------------------
; ----------- PROCE ------------ FENETRE PRINCIPALE
; --------------------------------------------------------------------------------------------
If OpenWindow(#ARS, #PB_Ignore, #PB_Ignore, #PB_Ignore, #PB_Ignore, "Ar-S VISIONEUSE test ",#PB_Window_BorderLess) = 0;
  End
EndIf    
SetWindowState(#ars, #PB_Window_Maximize)
Lwin = WindowWidth(#ars, #PB_Window_InnerCoordinate)
Hwin = WindowHeight(#ars, #PB_Window_InnerCoordinate)
Debug "fenêtre : " + Str(Lwin) + " x " +Str(Hwin)
PanelGadget(#Panel, 0, 0, Lwin, Hwin)
LCanvas = (GadgetWidth(#panel)) 
HCanvas =  GadgetHeight(#panel) 
; Tab #1
AddGadgetItem(#Panel, -1, "Choix du dossier")
ExplorerComboGadget(#ROOT,0,0, Lexp,25, "F:\",#PB_Explorer_DrivesOnly)
ExplorerListGadget(#EXP, 0, 25, Lexp, Hwin-25, IMGpath.s , #PB_Explorer_NoFiles |#PB_Explorer_AutoSort|#PB_Explorer_FullRowSelect|#PB_Explorer_GridLines)
RepEnCours.s = GetGadgetText(#EXP)
Debug "RepEnCours : " + RepEnCours
CanvasGadget(#CANVAS, Lexp, 0, LCanvas-Lexp, Hcanvas)
CloseGadgetList()
AddKeyboardShortcut(#ARS, #PB_Shortcut_Escape, #TOUCHE_ESC)   
AddWindowTimer(#ARS, #T, 50)
; --------------------------------------------------------------------------------------------
; ----------- BOUCLE ------------ PRINCIPALE
; --------------------------------------------------------------------------------------------
Repeat
  
  Event = WaitWindowEvent(20) 
  ; 			EventType   = #Null  ; On ne sait pas encore 
  ; 		EventGadget = #Null  ; On ne sait pas encore 
  ;EventType   = EventType()   ; appel au bon moment
  
  ;If Event
  
  Select Event
      ; --------------------------------------------------------------------------------------------
      ; ----------- EVENT ------------ WINDOW + dbleclic
      ; --------------------------------------------------------------------------------------------
      
    Case #PB_Event_LeftDoubleClick
      Debug "double clic dans fenetre"
      
      ; --------------------------------------------------------------------------------------------
      ; ----------- EVENT ------------  GADGETS
      ; --------------------------------------------------------------------------------------------
    Case #PB_Event_Gadget
      EventGadget = EventGadget() ; appel au bon moment
      ;EventType   = EventType()   ; appel au bon moment
      
      Select EventGadget
          
          
        Case #EXP 
          ;Debug "#EXP"
          EventType   = EventType()   ; appel au bon moment
          ;Debug EventType ;-> donne 768 ?
         
          Select EventType 
            Case 768;#PB_EventType_LeftDoubleClick
              
              Debug "DOUBLE CLIC !"
              
          EndSelect 
          
          
          
        Case #ROOT
          
          OldROOT.s = GetGadgetText(#ROOT)
          If Left(GetGadgetText(#EXP),1) <> Left(GetGadgetText(#ROOT),1)
            SetGadgetText(#EXP, GetGadgetText(#ROOT))
          EndIf
          
          ;EndIf                 
      EndSelect
      ; --------------------------------------------------------------------------------------------
      ; ----------- EVENT ------------ MENU (raccourcis clavier)
      ; --------------------------------------------------------------------------------------------
    Case #PB_Event_Menu
      Select EventMenu()
        Case #TOUCHE_ESC
          
          Quite = 1
          Break
      EndSelect           
      
  EndSelect
  ;EndIf 
  
ForEver
RemoveKeyboardShortcut(#ARS, #TOUCHE_ESC)
CloseWindow(#ARS)
End
;
;}