Page 1 of 1

ExplorerListGadget OFF

Posted: Thu Aug 08, 2024 6:23 pm
by SPH
Hi,

After a long time without coding, I lost my touch.
Here is a minimalistic code that I hope is complete.
Is it?
Another question: why don't I have the list of files in ExplorerListGadget?

Code: Select all

If OpenWindow(0, 0, 0, 760,480, "ExplorerTreeGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) 
  ExplorerTreeGadget(1, 11, 73, 230, 280, Repertoire$, #PB_Explorer_NoFiles)
  ExplorerListGadget(2, 247,73,490,280, "*.*", #PB_Explorer_NoFolders|#PB_Explorer_NoParentFolder)
  SendMessage_(GadgetID(2),#LVM_SETCOLUMNWIDTH,0,188) ; largeur colonne
  SendMessage_(GadgetID(2),#LVM_SETCOLUMNWIDTH,1,80)  ; largeur colonne
  Repeat
    Select EventGadget()
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; menu contextuel  
      Case 1 ; Afficher les fichiers du répertoire sélectionné
        Select type
          Case #PB_EventType_LeftClick
        EndSelect
    EndSelect
  Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf 

Re: ExplorerListGadget OFF

Posted: Thu Aug 08, 2024 7:24 pm
by jacdelad
Your loop is crooked:" type" is not defined nor ever gets a value assigned and after klicking an item in the left list, you do...nothing.

Code: Select all

If OpenWindow(0, 0, 0, 760,480, "ExplorerTreeGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) 
  ExplorerTreeGadget(1, 11, 73, 230, 280, Repertoire$, #PB_Explorer_NoFiles)
  ExplorerListGadget(2, 247,73,490,280, "*.*", #PB_Explorer_NoFolders|#PB_Explorer_NoParentFolder)
  SendMessage_(GadgetID(2),#LVM_SETCOLUMNWIDTH,0,188) ; largeur colonne
  SendMessage_(GadgetID(2),#LVM_SETCOLUMNWIDTH,1,80)  ; largeur colonne
  Repeat
    Select EventGadget()
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; menu contextuel  
      Case 1 ; Afficher les fichiers du répertoire sélectionné
        Select EventType()
          Case #PB_EventType_LeftClick
            SetGadgetText(2,GetGadgetText(1))
        EndSelect
    EndSelect
  Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf 

Re: ExplorerListGadget OFF

Posted: Thu Aug 08, 2024 7:29 pm
by SPH
Thanks :idea:

Re: ExplorerListGadget OFF

Posted: Thu Aug 08, 2024 8:12 pm
by infratec

Code: Select all

EnableExplicit
:!:

Re: ExplorerListGadget OFF

Posted: Thu Aug 08, 2024 8:48 pm
by SPH
But be aware that a codes which worked on PB 5.73_x64 no longer work on PB 6.x_x64 :idea:

Re: ExplorerListGadget OFF

Posted: Fri Aug 09, 2024 12:58 pm
by jacdelad
SPH wrote: Thu Aug 08, 2024 8:48 pm But be aware that a codes which worked on PB 5.73_x64 no longer work on PB 6.x_x64 :idea:
I wouldn't generalize it that way...

Re: ExplorerListGadget OFF

Posted: Fri Aug 09, 2024 2:46 pm
by Quin
SPH wrote: Thu Aug 08, 2024 8:48 pm But be aware that a codes which worked on PB 5.73_x64 no longer work on PB 6.x_x64 :idea:
It sounds like you may have some .l's that are supposed to be .i or similar ;-)
Make sure all your pointers are stored in integers. 6.10 enabled a security feature that makes memory-based attacks more difficult, but the result is that the addresses are now quite often larger than the 32-bit range.