Page 7 sur 10

Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)

Publié : mar. 18/mai/2010 22:22
par Le Soldat Inconnu
ça doit marcher :)

Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)

Publié : ven. 21/mai/2010 18:26
par Ar-S
Nouveau soucis pour l'apparition d'une seconde fenêtre.
en cliquant sur le bouton "?", la 1ere fenêtre est censée se cacher pour faire apparaitre la fenêtre FEN2.
Le code seule (code FEN2) fonctionne mais si je l'inclus dans le programme complet, FEN2 refuse de s'ouvrir, j'ai le message d'erreur que j'ai placé (Unable to open about window)

Note : je n'ai pas inclus le fichier pics.pbi car il contient les images en datasections, ça fait plus de 6000 lignes.

Est-ce un bug de la lib ou ai-je oublié quelque chose dans le prog principal ?

FEN2

Code : Tout sélectionner

UsePNGImageDecoder()
IncludeFile("pics.pbi") ; Insertion des images en datasection

img_N2=CatchImage(20, ?normitem)
img_I2=CatchImage(21, ?imgitem)

;-COULEURS FENETRE 2-------------
#C_AFF = $76A46D 
#C_QUIT= $DA4542
;fond
#C_fond2 = $FFFFFF

; -------------------------------------------------
;----PROGRAMME-----
; -------------------------------------------------

fenetre2=CreateSkinWindow(0, #PB_Ignore, #PB_Ignore, "About MD5 File Controler", #PB_Window_ScreenCentered|#PB_Window_Invisible, 0, 20, 0, 0, 0, 0, 21, 0, 0, 0)
If fenetre2 
  HideSkinWindow(0, 0) ; On affiche la seconde
  SkinItemMoveWindow(#C_fond2, 1)
  StickyWindow(0,1)
  EditorGadget(2,SkinItemX(#C_AFF),SkinItemY(#C_AFF),SkinItemWidth(#C_AFF),SkinItemHeight(#C_AFF),#PB_Editor_ReadOnly)
  RetourAuto(2)
  SetGadgetText(2,"This program has been coded by Cyrille Landivier / LDV MULTIMEDIA"+Chr(10)+"To create a MD5 list, just drag and drop your files on the main window"+Chr(10)+"To check MD5 from a list, click the check list button. Note that the Md5 list have to be in the same folder as the file to check."+Chr(10)+"If you like my work, please make a small donation."+Chr(10)+"Thank you for using this software."+Chr(10)+"Discover more freewares at http://ldvmultimedia.com")
  FermeAbout=0
  
  Repeat
    
    event = WaitSkinWindowEvent()
    
    If GetActiveSkinWindow() = 0
      DisableSkinWindow(0,0)
    Else
      DisableSkinWindow(0,1)
    EndIf  
    
    Select EventSkinWindow()
      Case 0
        Select EventSkinItem() 
            
          Case #C_QUIT
            FermeAbout=1
            
        EndSelect
    EndSelect  
  Until FermeAbout=1
  CloseSkinWindow(fenetre2)
  End
  HideSkinWindow(0,0) ; On Ré Affiche la denêtre 1
Else
  MessageRequester("Error","Unable to open about window",#MB_ICONERROR)
EndIf


Programme Entier

Code : Tout sélectionner

UsePNGImageDecoder()

IncludeFile("pics.pbi") ; Insertion des images en datasection

img_Normal=CatchImage(10, ?n_png)
img_Select=CatchImage(11, ?s_png)
img_Item=CatchImage(12, ?i_png)

;-COULEURS FENETRE 1-------------
;boutons interface
#C_ABOUT = $0000FF
#C_DON = $00FF00
#C_LEAVE=$00F6FF
#C_String = $00AEFF
#C_LIST = $4B7A43
;fond
#C_Fond =$FFFFFF

img_N2=CatchImage(20, ?normitem)
img_I2=CatchImage(21, ?imgitem)

;-COULEURS FENETRE 2-------------
#C_AFF = $76A46D 
#C_QUIT= $DA4542
;fond
#C_fond2 = $FFFFFF


Global RepList$
Global filtre$="MD5 List (*.ldv)|*.ldv"
Global NewList fichier.s()
Global NewList MD5.s()
Global NewList ErreurMD5.s()
Global v$="2.0"
Global titre$="MD5 file Controler "+v$

Procedure Wait()
  SetGadgetText(1,"Please Wait")
  SetGadgetColor(1,#PB_Gadget_BackColor,RGB(0,255,0))
EndProcedure

Procedure Normal()
  SetGadgetColor(1,#PB_Gadget_BackColor,$FFFFFF)
EndProcedure
; -------------------------------------------------
;----PROGRAMME-----
; -------------------------------------------------

If CreateSkinWindow(0, #PB_Ignore, #PB_Ignore, titre$, #PB_Window_ScreenCentered|#PB_Window_Invisible, 0, 10, 11, 11, 11, 10, 12, 0, 0, 0) 
  StickyWindow(0,1)
  SkinItemMoveWindow(#C_Fond, 1)
  HideSkinWindow(0, 0)
  
  StringGadget(1,SkinItemX(#C_String),SkinItemY(#C_String),SkinItemWidth(#C_String),SkinItemHeight(#C_String),"Welcome !",#PB_String_BorderLess|#ES_CENTER)
  EnableWindowDrop(0,#PB_Drop_Files,#PB_Drag_Copy)
  
  Repeat
    
    event = WaitSkinWindowEvent()
    
    If GetActiveSkinWindow() = 0
      DisableSkinWindow(0,0)
    Else
      DisableSkinWindow(0,1)
    EndIf  
    
    Select EventSkinWindow()
      Case 0 
        Select EventSkinItem() 
            
          Case #C_ABOUT
            Fen2=CreateSkinWindow(1, #PB_Ignore, #PB_Ignore, "About MD5 File Controler", #PB_Window_ScreenCentered|#PB_Window_Invisible, 1, 20, 0, 0, 0, 0, 21, 0, 0, 0)
            If Fen2 
              HideSkinWindow(0,1) ; On cache la première fenêtre
              HideSkinWindow(1, 0) ; On affiche la seconde
              SkinItemMoveWindow(#C_fond2, 1)
              StickyWindow(1,1)
              EditorGadget(2,SkinItemX(#C_AFF),SkinItemY(#C_AFF),SkinItemWidth(#C_AFF),SkinItemHeight(#C_AFF),#PB_Editor_ReadOnly)
              RetourAuto(2)
              SetGadgetText(2,"This program has been coded by Cyrille Landivier / LDV MULTIMEDIA"+Chr(10)+"To create a MD5 list, just drag and drop your files on the main window"+Chr(10)+"To check MD5 from a list, click the check list button. Note that the Md5 list have to be in the same folder as the file to check."+Chr(10)+"If you like my work, please make a small donation."+Chr(10)+"Thank you for using this software."+Chr(10)+"Discover more freewares at http://ldvmultimedia.com")
              FermeAbout=0
              
              Repeat
                event = WaitSkinWindowEvent()
                If GetActiveSkinWindow() = 0
                  DisableSkinWindow(1,0)
                Else
                  DisableSkinWindow(1,1)
                EndIf  
                
                Select EventSkinWindow()
                  Case 1
                    Select EventSkinItem() 
                        
                      Case #C_QUIT
                        FermeAbout=1
                        
                    EndSelect
                EndSelect  
              Until FermeAbout=1
              CloseSkinWindow(Fen2)
              HideSkinWindow(0,0) ; On Ré Affiche la fenêtre 1
            Else
              MessageRequester("Error","Unable to open about window",#MB_ICONERROR)
            EndIf
          
          Case #C_LEAVE
            End
        EndSelect
    EndSelect
    
    Select EventWindow()
      Case 0
        If event=#PB_Event_WindowDrop
          Wait()
        EndIf
    EndSelect
  Until event = #PB_Event_CloseWindow
  
Else
  MessageRequester("Error","Unable to open the main window",#MB_ICONERROR)
  End
EndIf

Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)

Publié : jeu. 27/mai/2010 12:58
par Ar-S
LSI toujours pas testé ?

Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)

Publié : jeu. 27/mai/2010 21:26
par Le Soldat Inconnu
pas encore eu le temps, désolé, je fais 36 choses à la fois en ce moment

Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)

Publié : jeu. 27/mai/2010 21:50
par Le Soldat Inconnu
Testé, ça fonctionne. J'ai juste fais une correction sur la fonction CLoseSkinWindow(

voir exemple 4, en appuyant sur le bouton 4 5 ou 6, ça ouvre une autre fenêtre

Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)

Publié : jeu. 27/mai/2010 21:52
par Ar-S
Donc faut que je re récupe la lib ?

Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)

Publié : jeu. 27/mai/2010 22:40
par Ar-S
J'ai modifié le programme, cela fonctionne mais une seule fois 8O
si j'appuye sur ? j'ai bien ma fenêtre about qui s'ouvre, si je clique sur la croix, elle se ferme et la fenetre 1 réapparait, et si je clique à nouveau sur ?, j'ai mon message d'erreur.
je suis perdu dans mes Case, Select, if Endif sur ce coup... je vois pas d'ou ça vient.

Code : Tout sélectionner

; -------------------------------------------------
;----PROGRAMME-----
; -------------------------------------------------

If CreateSkinWindow(0, #PB_Ignore, #PB_Ignore, titre$, #PB_Window_ScreenCentered|#PB_Window_Invisible, 0, 10, 11, 11, 11, 10, 12, 0, 0, 0) 
  StickyWindow(0,1)
  SkinItemMoveWindow(#C_Fond, 1)
  HideSkinWindow(0, 0)
  StringGadget(1,SkinItemX(#C_String),SkinItemY(#C_String),SkinItemWidth(#C_String),SkinItemHeight(#C_String),"Welcome !",#PB_String_BorderLess|#ES_CENTER)
  EnableWindowDrop(0,#PB_Drop_Files,#PB_Drag_Copy)
  
  Repeat
    event = WaitSkinWindowEvent()
    
    If GetActiveSkinWindow() = 0
      DisableSkinWindow(0,0)
    Else
      DisableSkinWindow(0,1)
    EndIf  
    
    Select EventSkinWindow()
      Case 0 
        Select EventSkinItem() 
          Case #C_DON
            
          Case #C_LEAVE
            End
            
          Case #C_LIST
  
          Case #C_ABOUT
            If CreateSkinWindow(1, #PB_Ignore, #PB_Ignore, "About MD5 File Controler", #PB_Window_ScreenCentered|#PB_Window_Invisible, 0, 20, 0, 0, 0, 0, 21, 0, 0, 0)
              HideSkinWindow(0,1) ; On cache la première fenêtre
              HideSkinWindow(1, 0) ; On affiche la seconde
              SkinItemMoveWindow(#C_fond2, 1)
              StickyWindow(1,1)
              EditorGadget(2,SkinItemX(#C_AFF),SkinItemY(#C_AFF),SkinItemWidth(#C_AFF),SkinItemHeight(#C_AFF),#PB_Editor_ReadOnly)
              SetGadgetText(2,"About")

            Else
              MessageRequester("Error","Unable to open about window",#MB_ICONERROR)
            EndIf
            
        EndSelect
        
        Select event
          Case #PB_Event_Timer
						Select EventTimer()
              Case 0
								RemoveWindowTimer(0, 0)
								DisableSkinWindow(0, 0)
            EndSelect
        EndSelect
        
        ;------------------------------- FENETRE 2 -------------------------------
      Case 1
        Select EventSkinItem() 
          Case #C_QUIT
            CloseSkinWindow(1) 
            HideSkinWindow(0,0)
        EndSelect  
    EndSelect
    
    ;---- GLISSER DEPOSER--------------
    
    Select EventWindow()
      Case 0
        If event=#PB_Event_WindowDrop
          StickyWindow(0,0)
          MessageRequester(" ","DEPOT")
          StickyWindow(0,1)
        EndIf
        
    EndSelect
    
  Until event = #PB_Event_CloseWindow 
  
  
Else
  MessageRequester("Error","Unable to open the main window",#MB_ICONERROR)
  End
EndIf

Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)

Publié : ven. 28/mai/2010 9:47
par Le Soldat Inconnu
est-ce que tu utilises les mêmes couleurs pour les items ?

il faut faire attention, c'est comme pour les numéros de gadget, jamais 2 fois la même couleur, pour toutes les fenêtres que tu veux ouvrir.

Je vais le verrouiller.

Et ajouter un retour d'erreur à la fonction CreateSkinWindow(, genre GetSkinWindowLastError(

Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)

Publié : ven. 28/mai/2010 12:53
par Ar-S
Je n'utilise la même couleur que pour le fond des 2 skins. Peut-être que ça vient de là ? Mais bizarre que ça marche 1 fois et pas 2..
Je n'ai pas le temps de regarder, je pars en week end dans 1heure.
On verra ça la semaine prochaine.
Bon week end à tous.

Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)

Publié : ven. 28/mai/2010 16:41
par Le Soldat Inconnu
Bug trouvé :mrgreen: , je mets la correction en ligne ce soir

Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)

Publié : dim. 30/mai/2010 12:29
par Le Soldat Inconnu
Je viens de corriger un gros bug suite à la dernière mise à jour.

Nouvelle version en ligne

Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)

Publié : dim. 30/mai/2010 15:57
par Ar-S
Me voilà de retour,
Nouveaux tests, nouveau bug..

Maintenant lorsque je clique sur "?" j'ai la fenêtre 2 qui s'ouvre, ensuite je ferme la fenêtre 2, la première réapparait bien.
Je reclique sur "?" et boom, je n'ai que le contour de al skin de la fenêtre 2.

J'ai pourtant changé la couleur de fond de l'item2 exprès pour qu'il ni ai pas de confusion.

Voilà ce que ça donne en image.

Image

Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)

Publié : dim. 30/mai/2010 17:07
par Le Soldat Inconnu
vu, j'ai corrigé le bug, fait un nouvel essai.

Et regardes le retour de CreateSkinWindowError() si ta fenêtre ne s'ouvre pas, voir l'aide pour plus d'info. Car à la vue de tes images, tu vas avoir un retour d'erreur ce coup-ci :mrgreen: (je viens de l'ajouter en voyant ton image)

Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)

Publié : dim. 30/mai/2010 19:32
par Ar-S
J'ai ajouté un debug CreateSkinWindowError() si la fenêtre ne s'ouvre pas ET même si la fenêtre s'ouvre.
je n'ai que des 0 en résultat car elles s'ouvrent bien. Encore une fois la fenêtre 2 s'ouvre correctement la 1ere fois mais la seconde on ne voit encore que le contour comme l'image de mon post précédent :|

Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)

Publié : dim. 30/mai/2010 20:28
par Le Soldat Inconnu
je t'envois un MP