One time is not usual, it's me who give a little tips

I have searched several weeks to modify dynamically an ExplorerGadget.
The most of time with complicated things : CallBack, SubClassing, ... without succes (Normal way, for KCC)

And in fact, the solution is very simple

The main problem is the LeftDoubleClic, not recognized by the ExplorerGadget for the folders


Obviously...if you have better...i'm not jealous...i keep

Code: Select all
#ExpListG = 0
Global Dim TabloItems.s(0)
Procedure ChangeName()
Dim TabloItems.s(10000)
MaxIndex = CountGadgetItems(#ExpListG)
For i = 0 To MaxIndex - 1
TabloItems(i) = GetGadgetItemText(#ExpListG, i, 0)
SetGadgetItemText(#ExpListG, i, "Kcc_" + TabloItems(i), 0)
Next
ReDim TabloItems(MaxIndex)
EndProcedure
If OpenWindow(0,0,0,400,300, "File Selection", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ExplorerListGadget(#ExpListG, 10, 10, 380, 180, "Kcc VirtualXplorer", #PB_Explorer_MultiSelect|#PB_Explorer_AlwaysShowSelection|#PB_Explorer_FullRowSelect)
ChangeName()
Repeat
Event = WaitWindowEvent()
If EventType() = #PB_EventType_LeftClick
Start = GetTickCount_()
GetAsyncKeyState_(#VK_LBUTTON)
Repeat : Until GetAsyncKeyState_(#VK_LBUTTON) <> 0 Or GetTickCount_() - Start > GetDoubleClickTime_()
If GetTickCount_() - Start < GetDoubleClickTime_() ; Double Click
Index = GetGadgetState(#ExpListG)
If Index <> - 1
Item$ = GetGadgetItemText(#ExpListG, Index)
Chemin$ = GetGadgetText(#ExpListG)
If Item$ <> "Kcc_.."
NouveauChemin$ = Chemin$ + TabloItems(Index)
If Right(NouveauChemin$,1)<>"\" : NouveauChemin$+"\":EndIf
Else
MaxSlash = CountString(Chemin$, "\")
NouveauChemin$ = ""
For i = 1 To MaxSlash - 1
NouveauChemin$ + StringField(Chemin$, i, "\") + "\"
Next
EndIf
SetGadgetText(#ExpListG, NouveauChemin$)
ChangeName()
EndIf
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
EndIf