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.
@ Silverman  Emptypar Klaus Ven 17 Mai 2024 - 14:02

» item_index(résolu)
@ Silverman  Emptypar jjn4 Mar 14 Mai 2024 - 19:38

» Bataille terrestre
@ Silverman  Emptypar jjn4 Lun 13 Mai 2024 - 15:01

» SineCube
@ Silverman  Emptypar Marc Sam 11 Mai 2024 - 12:38

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

» Philharmusique
@ Silverman  Emptypar jjn4 Ven 10 Mai 2024 - 13:58

» PANORAMIC V 1
@ Silverman  Emptypar papydall Jeu 9 Mai 2024 - 3:22

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

» number_mouse_up
@ Silverman  Emptypar jjn4 Mer 8 Mai 2024 - 11:59

» Aide de PANORAMIC
@ Silverman  Emptypar jjn4 Mer 8 Mai 2024 - 11:16

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

» Je teste PANORAMIC V 1 beta 1
@ Silverman  Emptypar papydall Mer 8 Mai 2024 - 4:17

» bouton dans autre form que 0(résolu)
@ Silverman  Emptypar leclode Lun 6 Mai 2024 - 13:59

» KGF_dll - nouvelles versions
@ Silverman  Emptypar Klaus Lun 6 Mai 2024 - 11:41

» @Jack
@ Silverman  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 : -14%
Apple MacBook Air (2020) 13,3″ Puce Apple M1 ...
Voir le deal
799 €

 

 @ Silverman

Aller en bas 
2 participants
AuteurMessage
Yannick




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

@ Silverman  Empty
MessageSujet: @ Silverman    @ Silverman  EmptyMar 13 Aoû 2019 - 13:28

@ Silverman,

Tu nous avez fait une procédure pour modifier la couleur d'un objet
Progress_bar.
J' ai voulu m' en servir il y a quelques jours et elle provoquait une erreur. Sad

Pourrais tu y jeter un oeil et éventuellement la réparer ?

Code:
' colorer la barre de l'objet 'progress_bar'
  dim x%,l%,red%,green%,blue%
  label clic,change
 
  l%=5
  for x%=1 to 3
    spin x% : width x%,60 : top x%,20 : left x%,l% : min x%,0 : max x%,255 : on_change x%,change
    l% = l%+width(x%)+5
  next x%

  progress_bar 4 : top 4,50 : left 4,5 : width 4,200

  min 4,0
  max 4,100
  position 4,0
 
  button 5 : left 5,left(4)+width(4)+10 : top 5,top(4) : caption 5,"Lancer"
  on_click 5,clic
 
  picture 6 : height 6,height(1) : width 6,22 : top 6,top(1) : left 6,l%

END

clic:
  color_progress_bar(4,red%,green%,blue%)
  position 4,0
  for x%=1 to 100
      position 4,position(4)+1
      pause 50
  next x%
  pause 2000
  position 4,0
return


change:
  if number_change =1
      red%=position(1)
      color 6,red%,green%,blue%
      return
  end_if
 
  if number_change =2
      green%=position(2)
      color 6,red%,green%,blue%
      return
  end_if
 
  if number_change =3
      blue%=position(3)
      color 6,red%,green%,blue%
      return
  end_if
return


sub COLOR_PROGRESS_BAR(nb%,r%,g%,b%)
 dim_local i,j,k%,my_library$,my_dll$,found%
 ' verifie si "user32" existe:
 my_dll$="user32"
  '
  i=0
  k%=0
  found%=0
  my_dll$=lower$(my_dll$)
  j=instr(my_dll$,".") : if j>0 then my_dll$=left$(my_dll$,j-1)
  '
  repeat
      k%=k%+1
  until library$(k%)="_"

  repeat
      i=i+1
        my_library$=lower$(library$(i))
        j=instr(my_library$,".") : if j>0 then my_library$=left$(my_library$,j-1)
        '
        if my_library$=my_dll$
            found%=1
            exit_repeat
        end_if
  until i=32
  '
  ' charge la librairie et cré la commande si nécessaire
  if found%=0
      library k%,my_dll$
'      print k%," : not found ",library$(k%)  :' debug
      command "pb_color","SendMessageA",k%,"IIII","stdcall"
  else
'      print i," : found ",library$(i)  :' debug
  end_if
  '
  ' colore la progress_bar
  pb_color handle(nb%),1033,0,(b%*65536)+(g%*256)+r%
end_sub

@ Silverman  Captur50
Revenir en haut Aller en bas
silverman

silverman


Nombre de messages : 968
Age : 51
Localisation : Picardie
Date d'inscription : 18/03/2015

@ Silverman  Empty
MessageSujet: Re: @ Silverman    @ Silverman  EmptyMar 13 Aoû 2019 - 13:48

Bonjour Yannick

Il s'agit d'un bug de panoramic. Voici la démo corrigé:
Code:
' colorer la barre de l'objet 'progress_bar'

  progress_bar 1:left 1,5:width 1,200
  color_progress_bar(1,255,0,255)   :' mauve
  position 1,50
  
  progress_bar 2:left 2,5:width 2,200:top 2,100
  color_progress_bar(2,255,0,0)   :' rouge
  position 2,50


END
' sub non fonctionnelle car la version actuelle de panoramique (0.9.29i8) est boguée pour les commandes de library  
sub COLOR_PROGRESS_BAR2(nb%,r%,g%,b%)
 dim_local i,j,k%,my_library$,my_dll$,found%
 ' verifie si "user32" existe:
 my_dll$="user32"
   '
   i=0
   k%=0
   found%=0
   my_dll$=lower$(my_dll$)
   j=instr(my_dll$,".") : if j>0 then my_dll$=left$(my_dll$,j-1)
   '
   repeat
      k%=k%+1
   until library$(k%)="_"

   repeat
      i=i+1
         my_library$=lower$(library$(i))
         j=instr(my_library$,".") : if j>0 then my_library$=left$(my_library$,j-1)
         '
         if my_library$=my_dll$
            found%=1
            exit_repeat
         end_if
   until i=32
   '
   ' charge la librairie et cré la commande si nécessaire
   if found%=0
      library k%,my_dll$
'      print k%," : not found ",library$(k%)   :' debug
      command "pb_color","SendMessageA",k%,"IIII","stdcall"
   else
'      print i," : found ",library$(i)   :' debug
   end_if
   ' message k%
   '
   ' colore la progress_bar
   pb_color handle(nb%),1033,0,(b%*65536)+(g%*256)+r%
end_sub


' sub fonctionnelle
sub COLOR_PROGRESS_BAR(nb%,r%,g%,b%)
 dim_local i%
   dll_on "user32.dll"
      i%=dll_call4("SendMessageA",handle(nb%),1033,0,(b%*65536)+(g%*256)+r%)
   dll_off
end_sub
Revenir en haut Aller en bas
Yannick




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

@ Silverman  Empty
MessageSujet: re   @ Silverman  EmptyMar 13 Aoû 2019 - 19:23

cheers Merci Silverman !

Pour la correction et pour la réactivité. Laughing
Revenir en haut Aller en bas
Contenu sponsorisé





@ Silverman  Empty
MessageSujet: Re: @ Silverman    @ Silverman  Empty

Revenir en haut Aller en bas
 
@ Silverman
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» @ Silverman
» Bienvenu Silverman
» Question de Silverman sur le forum FreeBASIC

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: A l'aide!-
Sauter vers: