FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  MembresMembres  Connexion  
Derniers sujets
» Gestion d'un système client-serveur.
Exploration de dossiers Emptypar Klaus Hier à 17:01

» item_index
Exploration de dossiers Emptypar leclode Hier à 16:36

» Bataille terrestre
Exploration de dossiers Emptypar jjn4 Hier à 15:01

» SineCube
Exploration de dossiers Emptypar Marc Sam 11 Mai 2024 - 12:38

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
Exploration de dossiers Emptypar Marc Sam 11 Mai 2024 - 12:22

» Philharmusique
Exploration de dossiers Emptypar jjn4 Ven 10 Mai 2024 - 13:58

» PANORAMIC V 1
Exploration de dossiers Emptypar papydall Jeu 9 Mai 2024 - 3:22

» select intégrés [résolu]
Exploration de dossiers Emptypar jjn4 Mer 8 Mai 2024 - 17:00

» number_mouse_up
Exploration de dossiers Emptypar jjn4 Mer 8 Mai 2024 - 11:59

» Aide de PANORAMIC
Exploration de dossiers Emptypar jjn4 Mer 8 Mai 2024 - 11:16

» trop de fichiers en cours
Exploration de dossiers Emptypar lepetitmarocain Mer 8 Mai 2024 - 10:43

» Je teste PANORAMIC V 1 beta 1
Exploration de dossiers Emptypar papydall Mer 8 Mai 2024 - 4:17

» bouton dans autre form que 0
Exploration de dossiers Emptypar leclode Lun 6 Mai 2024 - 13:59

» KGF_dll - nouvelles versions
Exploration de dossiers Emptypar Klaus Lun 6 Mai 2024 - 11:41

» @Jack
Exploration de dossiers Emptypar Jack Mar 30 Avr 2024 - 20:40

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mai 2024
LunMarMerJeuVenSamDim
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendrierCalendrier
Le Deal du moment : -28%
Précommande : Smartphone Google Pixel 8a 5G ...
Voir le deal
389 €

 

 Exploration de dossiers

Aller en bas 
AuteurMessage
Yannick




Nombre de messages : 8611
Age : 53
Localisation : Bretagne
Date d'inscription : 15/02/2010

Exploration de dossiers Empty
MessageSujet: Exploration de dossiers   Exploration de dossiers EmptyJeu 4 Juil 2013 - 22:58

Je pense que cela a déjà été fait mais en voulant améliorer "Mon FTP" 
au niveau de l' exploration de fichier, je suis arrivé à çà :

Code:
' ******************************************************************************
'                     EXPLORATION DE FICHIER PAR YGERONIMI
'                       pour insertion dans un programme
' ******************************************************************************

dim obj%,clic%
dim champ%,liste%,bouton%
dim Path$(100),Mon_dossier$,Path_pos%,New_path$
label clic

' ------------------------------------------------------------------------------
font_name 0,"arial"

obj%=obj%+1
O_Alpha(obj%,0,1,10,10,0,0,"Dossier local")

obj%=obj%+1 : Champ%=obj%
O_Edit(obj%,0,1,25,10,0,500,"",0)

obj%=obj%+1 : bouton%=obj%
O_Button(obj%,0,1,24,520,22,22,"...",1)
font_bold obj% :hint bouton%,"choix du dossier de départ"

obj%=obj%+1 : liste%=obj%
O_List(obj%,0,1,50,10,200,530,"",1)
cursor_point obj%

end
' ------------------------------------------------------------------------------
clic:
   clic%=number_click
   if clic%=bouton% :init_path():end_if
   if clic%=liste%  :new_dir(item_index$(liste%)):end_if
return
' ------------------------------------------------------------------------------
sub init_path()
   obj%=obj%+1
   O_Open_Dialog(obj%,champ%,"","",1)
   Path$(0)=file_extract_path$(Text$(champ%))
   clear liste%
   if Path$(0)<>"_" or Path$(0)<>""
      explore()
   else
      message "Aucune sélection !"
   end_if
end_sub
' ------------------------------------------------------------------------------
sub explore()
   dim_local T_path$,sep%,x%
   T_path$=Path$(0)
   for x%=1 to 100
      sep%=instr(T_path$,"\")
      Path$(x%)=left$(T_path$,sep%-1)
      if len(T_path$)>0
         T_path$=right$(T_path$,len(T_path$)-sep%)
         Path_pos%=x%
         if T_path$=""
            exit_for
         end_if
      else
         exit_for
      end_if
   next x%
   Remplir_liste(Path$(0))
end_sub
' ------------------------------------------------------------------------------
sub Remplir_liste(D$)
   dim_local item$,dep%
   clear liste%
   dir_change D$

   if D$<>Path$(0):dep%=2 :else:dep%=1:end_if
   if dep%=2:item_insert liste%,1,".../...":end_if
   item$=file_extract_name$(file_find_first$)
   if item$<>"_"
      File_or_Dir(item$)
      if ForD%=1:item_add liste%,item$:else:item_insert liste%,dep%,item$ :end_if
      item$=file_extract_name$(file_find_next$)
   end_if
   while item$<>"_"
      if item$<>"_"
         File_or_Dir(item$)
         if ForD%=1:item_add liste%,item$:else:item_insert liste%,dep%,item$ :end_if
         item$=file_extract_name$(file_find_next$)
      end_if
   end_while
   file_find_close
end_sub
' ------------------------------------------------------------------------------
sub File_or_Dir(param$)
   if variable("ForD%")=0 then dim ForD%
   ForD%=0
   dim_local c%,c$,i$
   i$=param$
   for c%=1 to len(i$)
      c$=left$(i$,1)
      if len(i$)>0
         i$=right$(i$,len(i$)-1)
      else
         exit_for
      end_if
      if c$=".":ForD%=1:end_if
   next c%
end_sub
' ------------------------------------------------------------------------------
sub new_dir(ND$)
   dim_local i$,x%
   i$=ND$ : New_path$=""
   if i$=".../..."
      Path_pos%=Path_pos%-1
      Path$(Path_pos%+1)=""
      for x%=1 to path_pos%
         New_path$=New_path$+Path$(x%)+"\"
      next x%
      text champ%,New_path$
      Remplir_liste(New_path$)
   else
      File_or_Dir(i$)
      if ForD%=0
        path_pos%=path_pos%+1
        Path$(Path_pos%)=i$
        for x%=1 to path_pos%
            New_path$=New_path$+Path$(x%)+"\"
        next x%
         text champ%,New_path$
         Remplir_liste(New_path$)
      end_if
   end_if
end_sub
' ______________________________________________________________________________
Sub O_Alpha(No%,P%,V%,T%,L%,H%,W%,C$)
   ALPHA No%
   if P% > 0 then Parent No%,P%
   If V% = 0 Then hide No%
   If H% > 0 Then Height No%,H%
   If W% > 0 Then Width No%,W%
   If T% > 0 Then Top No%,T%
   If L% > 0 Then Left No%,L%
   if C$<>"" then Caption No%,C$
End_Sub
' ------------------------------------------------------------------------------
Sub O_Edit(No%,P%,V%,T%,L%,H%,W%,T$,Ch%)
   EDIT No%
   if P% > 0 then Parent No%,P%
   If V% = 0 Then hide No%
   If H% > 0 Then Height No%,H%
   If W% > 0 Then Width No%,W%
   If T% > 0 Then Top No%,T%
   If L% > 0 Then Left No%,L%
   If T$<>"" Then Text No%,T$
   If Ch%=1  Then On_Change No%,Change
End_Sub
' ------------------------------------------------------------------------------
Sub O_Button(No%,P%,V%,T%,L%,H%,W%,C$,Cl%)
   BUTTON No%
   if P% > 0 then Parent No%,P%
   If V% = 0 Then hide No%
   If H% > 0 Then Height No%,H%
   If W% > 0 Then Width No%,W%
   If T% > 0 Then Top No%,T%
   If L% > 0 Then Left No%,L%
   if C$<>"" then Caption No%,C$
   if Cl%> 0 then on_click No%,Clic
   cursor_point No%
End_Sub
' ______________________________________________________________________________
Sub O_List(No%,P%,V%,T%,L%,H%,W%,F$,Cl%)
   LIST No%
   if P% > 0 then Parent No%,P%
   If V% = 0 Then hide No%
   If H% > 0 Then Height No%,H%
   If W% > 0 Then Width No%,W%
   If T% > 0 Then Top No%,T%
   If L% > 0 Then Left No%,L%
   if F$<>""
   if file_exists F$ then file_load No%,F$
   end_if
   if Cl%> 0 then on_click No%,Clic
End_Sub
' ______________________________________________________________________________
Sub O_Open_Dialog(No%,Out%,DD$,Filtre$,O%)
   dim_local F$
   If Object_Exists(No%)=0
      OPEN_DIALOG No%
   End_if
   if DD$<>"" then Dir_Dialog No%,DD$
   if filtre$<>"" then Filter No%,Filtre$
   F$=File_name$(No%)
   if variable("File$")=0:Dim File$:End_If
   if F$<>"_"
      if O%=1 then text out%,F$
      if O%=2 then Caption Out%,F$
      if O%=3 then item_add Out%,F$
      if O%=4 then file_load Out%,F$
      if O%=5 then File$=F$
   end_if
   Delete No%
End_Sub


Dernière édition par ygeronimi le Ven 5 Juil 2013 - 0:25, édité 1 fois (Raison : Petite modif)
Revenir en haut Aller en bas
 
Exploration de dossiers
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Arborescence des dossiers
» Un sélecteur de dossiers 100 % Panoramic
» Liste des dossiers spéciaux de Windows
» Remplacer espace par tiret dans noms des dossiers / fichiers

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: Vos sources, vos utilitaires à partager-
Sauter vers: