ContainerGadget

Vous débutez et vous avez besoin d'aide ? N'hésitez pas à poser vos questions
Avatar de l’utilisateur
omega
Messages : 633
Inscription : sam. 26/nov./2011 13:04
Localisation : Alger

ContainerGadget

Message par omega »

Bonsoir à tous

Je ne comprends pas pourquoi le containerGadget ne s'affiche pas comme prévu. Ci-dessous, la partie du code simplifié pour vous faciliter la lecture.
Merci de m'éclairer

Code : Tout sélectionner

Enumeration
#WinMenu

#Conteneur
  #bouletable
  #linktable
  
  #boulestock
  #linkstock
  
  #boulefb
  #linkfb
  
  #boulebc
  #linkbc
  
  #bouletres
  #linktres
  
  #bouleJl
  #linkJl
  
  #bouletool
  #linktool
  
  #bouleexit
  #linkexit
  
EndEnumeration


UseJPEGImageDecoder()

;C'est une petite boule qui apparait à gauche du texte de chaque lien du menu....
 
catchImage(10, ?imgboule)

DataSection
imgboule:
IncludeBinary "images/boule.jpg"
EndDataSection

ExitMenu=0
ExamineDesktops()
Wlargeur=DesktopWidth(0)
Whauteur=DesktopHeight(0)
OpenWindow(#WinMenu, 0,0, Wlargeur, Whauteur, "test conteneur",#PB_Window_SystemMenu |#PB_Window_ScreenCentered | #PB_Window_TitleBar |#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget)
SetWindowColor(#WinMenu,RGB(255, 255, 255))
If CreateMenu(0, WindowID(#WinMenu))
   MenuItem( 01, "rien")
   MenuItem( 99, "Fin de session")
EndIf

wcol=20 : wtop=100
ContainerGadget(#Conteneur, 10,wtop,200,500, #PB_Container_Flat) 
SetGadgetColor(#Conteneur,#PB_Gadget_BackColor,RGB(2, 2,2))      
wtop=wtop+20
ImageGadget(#BouleTable,wcol,wtop,0,0,ImageID(10))
HyperLinkGadget(#LinkTable,wcol+30, wtop,130,40,"Tables", RGB(255,255,255), #PB_Font_Underline)
SetGadgetColor(#LinkTable,#PB_Gadget_FrontColor,RGB(240, 169, 111))      
SetGadgetFont(#LinkTable,FontID(21))
wtop=wtop+40
ImageGadget(#Boulestock,wcol,wtop,0,0,ImageID(10))
HyperLinkGadget(#Linkstock,wcol+30, wtop,130,40,"Stock", RGB(255,255,255), #PB_Font_Underline)
SetGadgetColor(#Linkstock,#PB_Gadget_FrontColor,RGB(240, 169, 111))      
SetGadgetFont(#Linkstock,FontID(21))
wtop=wtop+40
ImageGadget(#Boulefb,wcol,wtop,0,0,ImageID(10))
HyperLinkGadget(#Linkfb,wcol+30, wtop,130,40,"Fiches brigades", RGB(255,255,255), #PB_Font_Underline)
SetGadgetColor(#Linkfb,#PB_Gadget_FrontColor,RGB(240, 169, 111))      
SetGadgetFont(#Linkfb,FontID(21))
wtop=wtop+40
ImageGadget(#Boulebc,wcol,wtop,0,0,ImageID(10))
HyperLinkGadget(#Linkbc,wcol+30, wtop,130,40,"Bons de commande", RGB(255,255,255), #PB_Font_Underline)
SetGadgetColor(#Linkbc,#PB_Gadget_FrontColor,RGB(240, 169, 111))      
SetGadgetFont(#Linkbc,FontID(21))
wtop=wtop+40
ImageGadget(#Bouletres,wcol,wtop,0,0,ImageID(10))
HyperLinkGadget(#Linktres,wcol+30, wtop,130,40,"Trésorerie", RGB(255,255,255), #PB_Font_Underline)
SetGadgetColor(#Linktres,#PB_Gadget_FrontColor,RGB(240, 169, 111))      
SetGadgetFont(#Linktres,FontID(21))
wtop=wtop+40
ImageGadget(#BouleJl,wcol,wtop,0,0,ImageID(10))
HyperLinkGadget(#LinkJl,wcol+30, wtop,130,40,"Journaux", RGB(255,255,255), #PB_Font_Underline)
SetGadgetColor(#LinkJl,#PB_Gadget_FrontColor,RGB(240, 169, 111))      
SetGadgetFont(#LinkJl,FontID(21))
wtop=wtop+40
ImageGadget(#Bouletool,wcol,wtop,0,0,ImageID(10))
HyperLinkGadget(#Linktool,wcol+30, wtop,130,40,"Utilitaires", RGB(255,255,255), #PB_Font_Underline)
SetGadgetColor(#Linktool,#PB_Gadget_FrontColor,RGB(240, 169, 111))      
SetGadgetFont(#Linktool,FontID(21))
wtop=wtop+40
ImageGadget(#BouleExit,wcol,wtop,0,0,ImageID(10))
HyperLinkGadget(#LinkExit,wcol+30, wtop,130,40,"Sortie", RGB(255,255,255), #PB_Font_Underline)
SetGadgetColor(#LinkExit,#PB_Gadget_FrontColor,RGB(240, 169, 111))      
SetGadgetFont(#LinkExit,FontID(21))
CloseGadgetList() 

ExitMenu=0

Repeat

EventId=WaitWindowEvent()
If EventID = #PB_Event_CloseWindow
   CloseWindow(#WinMenu) 
   ExitMenu=1
EndIf

Until  ExitMenu=1
End
Win7 (x64) 64 bits Pb 5.72
Avatar de l’utilisateur
Ar-S
Messages : 9540
Inscription : dim. 09/oct./2005 16:51
Contact :

Re: ContainerGadget

Message par Ar-S »

Vu qu'il manque les fonts et surtout les images je vais dire ça comme ça.
Ton ContainerGadget s'affiche comme il faut, c'est à dire à 10px du bord gauche et 100 px du haut (le wtop=100). Il fait bien 200x500
En gros tout ce que tu as inscrit. C'est quoi ton soucis ? parce que sans les fichiers datas je n'ai pas de soucis d'affichage.
~~~~Règles du forum ~~~~
⋅.˳˳.⋅ॱ˙˙ॱ⋅.˳Ar-S ˳.⋅ॱ˙˙ॱ⋅.˳˳.⋅
W11x64 PB 6.x
Section HORS SUJET : ICI
LDV MULTIMEDIA : Dépannage informatique & mes Logiciels PB
UPLOAD D'IMAGES : Uploader des images de vos logiciels
Marc56
Messages : 2198
Inscription : sam. 08/févr./2014 15:19

Re: ContainerGadget

Message par Marc56 »

Pas vu de problème non plus dans cette partie de code.

Ne pas oublier que le container est un ensemble d'objets, et qu'il faut donc indiquer au programme quel ensemble doit être utilisé lors d'une action, cela veut dire utiliser: UseGadgetList() CloseGadgetList() OpenGadgetList() car des objets peuvent parfois de recouvrir.

:wink:

Edit: "car des objets peuvent parfois se recouvrir."
Dernière modification par Marc56 le mer. 09/janv./2019 15:17, modifié 1 fois.
Avatar de l’utilisateur
Ar-S
Messages : 9540
Inscription : dim. 09/oct./2005 16:51
Contact :

Re: ContainerGadget

Message par Ar-S »

Marc56 a écrit :car des objets peuvent parfois de recouvrir.
Je viens de perdre 4250 neuronnes, tu peux corriger :)
~~~~Règles du forum ~~~~
⋅.˳˳.⋅ॱ˙˙ॱ⋅.˳Ar-S ˳.⋅ॱ˙˙ॱ⋅.˳˳.⋅
W11x64 PB 6.x
Section HORS SUJET : ICI
LDV MULTIMEDIA : Dépannage informatique & mes Logiciels PB
UPLOAD D'IMAGES : Uploader des images de vos logiciels
Répondre