Re: Librairie SkinWindow (Fenêtres et gadgets skinnés)
Publié : mar. 18/mai/2010 22:22
ça doit marcher 

Forums PureBasic - Français
https://www.purebasic.fr/french/
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
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
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