Script fenetre svp

Vous débutez et vous avez besoin d'aide ? N'hésitez pas à poser vos questions
Mr_Labiloutte
Messages : 30
Inscription : mer. 05/sept./2007 13:10

Message par Mr_Labiloutte »

Bonjour

je vous remercie d'avoir posté :) , c'est super simpa :D mais ya des bug :(
moi se qui me faudrait c'est le code tout simple pour avoir une page web quand on clique sur le bouton :?


voila sa serat tout pour moi :D merci
Avatar de l’utilisateur
venom
Messages : 3128
Inscription : jeu. 29/juil./2004 16:33
Localisation : Klyntar
Contact :

Message par venom »

Code : Tout sélectionner

;- Window Constants
Enumeration
  #Window_0
  #Window_1
EndEnumeration

;- Gadget Constants
Enumeration
  #Button_0
  #Web_0
EndEnumeration

Procedure Open_Window_1()
  If OpenWindow(#Window_1, 215, 334, 600, 300, "fenetre n°2",  #PB_Window_SystemMenu |  #PB_Window_TitleBar )
    If CreateGadgetList(WindowID(#Window_1))
      WebGadget(#Web_0, 5, 5, 590, 290, "www.google.fr")
      
    EndIf
  EndIf
  
    Repeat
   EventID = WaitWindowEvent()
    If EventID = #PB_Event_Gadget 
      Select EventGadget()
      
      EndSelect
    EndIf
  Until EventID = #PB_Event_CloseWindow
  CloseWindow(#Window_1)
EndProcedure

  If OpenWindow(#Window_0, 216, 0, 600, 300, "fenetre n°1",  #PB_Window_SystemMenu | #PB_Window_TitleBar  )
    If CreateGadgetList(WindowID(#Window_0))
      ButtonGadget(#Button_0, 170, 90, 240, 90, "ouvrir fenetre n°2")
      
    EndIf
  EndIf
  
    Repeat
   EventID = WaitWindowEvent()
    If EventID = #PB_Event_Gadget 
      Select EventGadget()
      
       Case #Button_0
        Open_Window_1()
      
      EndSelect
    EndIf
  Until EventID = #PB_Event_CloseWindow
 End 

@++
Windows 10 x64, PureBasic 5.73 x86 & x64
GPU : radeon HD6370M, CPU : p6200 2.13Ghz
Mr_Labiloutte
Messages : 30
Inscription : mer. 05/sept./2007 13:10

Message par Mr_Labiloutte »

wesh mec je t'aime :oops: , trop cool :D
Mr_Labiloutte
Messages : 30
Inscription : mer. 05/sept./2007 13:10

Message par Mr_Labiloutte »

oula encore un problemme , j'ai deux fenetre et yen à une qui souvre que apres qu'on est ouvert la premiere :?

c'est à dire que ya la fenetre principal et ya deux bouton , ya un bouton qua quand on clique dessus rien ne se passe et quand je clique sur lautre ya la seconde fenetre et apres quand je reclique sur le premier ba la ya enfin la fenetre qui s'ouvre :?

je vous donne le code des deux fenetre :

Code : Tout sélectionner

Open_Window_0()
Repeat ; Start of the event loop
    Event = WaitWindowEvent() ; This line waits until an event is received from Windows
    WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
    GadgetID = EventGadget() ; Is it a gadget event?
    EventType = EventType() ; The event type
    ;You can place code here, and use the result as parameters for the procedures
   
    If Event = #PB_Event_Gadget
        If GadgetID = #Button_1
            Gosub fenetre_3
        EndIf
    EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
End
;

; 2em fenetre
fenetre_3:
OpenWindow(#Window_2, 294, 245, 600, 300, "super site",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_2))
      WebGadget(#Web_1, 5, 5, 590, 290, "http://purebasic.fr/french/viewforum.php?f=1") 
Repeat
    Event2 = WaitWindowEvent() ; This line waits until an event is received from Windows
    WindowID2 = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
    GadgetID2 = EventGadget() ; Is it a gadget event?
    EventType2 = EventType() ; The event type
Until Event2=#PB_Event_CloseWindow
CloseWindow(#Window_2)
Return



Open_Window_0()
EndIf
Repeat ; Start of the event loop
    Event = WaitWindowEvent() ; This line waits until an event is received from Windows
    WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
    GadgetID = EventGadget() ; Is it a gadget event?
    EventType = EventType() ; The event type
    ;You can place code here, and use the result as parameters for the procedures
   
    If Event = #PB_Event_Gadget
        If GadgetID = #Button_3
            Gosub fenetre_2
        EndIf
    EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
End
;

; 2em fenetre
fenetre_2:
OpenWindow(#Window_1, 294, 245, 600, 300, "2eme fenetre",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_1))
      WebGadget(#Web_0, 5, 5, 590, 290, "www.jeuxvideo.com") 
Repeat
    Event2 = WaitWindowEvent() ; This line waits until an event is received from Windows
    WindowID2 = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
    GadgetID2 = EventGadget() ; Is it a gadget event?
    EventType2 = EventType() ; The event type
Until Event2=#PB_Event_CloseWindow
CloseWindow(#Window_1)
Return




EndIf

donc voila , quelq'un pourait m'aranger sa pour que les deux fenetre soit accecible dans n'importe quel ordre svp :oops: :D

merci :wink:
Mr_Labiloutte
Messages : 30
Inscription : mer. 05/sept./2007 13:10

Message par Mr_Labiloutte »

svp ses vraiment urgent :idea:
Avatar de l’utilisateur
venom
Messages : 3128
Inscription : jeu. 29/juil./2004 16:33
Localisation : Klyntar
Contact :

Message par venom »

je ne comprend rien a ton code :? desol pour moi c'est mal organisé tout sa :wink: :

Code : Tout sélectionner

Enumeration
  #Window_0
  #Window_1
  #Window_2
EndEnumeration

Enumeration
#Button_0
#Button_1
#Button_2
#Button_3
EndEnumeration

Procedure Open_Window_1()
  If OpenWindow(#Window_1, 216, 334, 300, 300, "1",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
    If CreateGadgetList(WindowID(#Window_1))
    EndIf
  EndIf
EndProcedure

Procedure Open_Window_2()
  If OpenWindow(#Window_2, 526, 334, 300, 300, "2",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
    If CreateGadgetList(WindowID(#Window_2))
    EndIf
  EndIf
EndProcedure

  If OpenWindow(#Window_0, 216, 0, 610, 300, "0",  #PB_Window_SystemMenu | #PB_Window_TitleBar )
    If CreateGadgetList(WindowID(#Window_0))
     ButtonGadget(#Button_0, 10,  10, 200, 20, "ouvrir fenetre 1")
     ButtonGadget(#Button_1, 400,  10, 200, 20, "ouvrir fenetre 2")
    EndIf
  EndIf
  
  Repeat
   EventID = WaitWindowEvent()
    If EventID = #PB_Event_Gadget 
      Select EventGadget()
      
       Case #Button_0
        Open_Window_1()
       
       Case #Button_1
        Open_Window_2()
      
      EndSelect
    EndIf
  Until EventID = #PB_Event_CloseWindow

@++
Windows 10 x64, PureBasic 5.73 x86 & x64
GPU : radeon HD6370M, CPU : p6200 2.13Ghz
Mr_Labiloutte
Messages : 30
Inscription : mer. 05/sept./2007 13:10

Message par Mr_Labiloutte »

lu

c'est vrai que c'est le foutoire , ton code marche bien mais tu pourait faire la meme chose pour les deux bouton dans les 2 panel pour quil marche tout les deux stp , car yen à que un qui marche :?

tien le code , tu peut le modifier ??stp

Code : Tout sélectionner

;
;                 ABCDEFGHIJKLMOPQRSTUVWXYZ
;
;
;
;
Enumeration
  #Window_0
  #Window_1
  #Window_2
EndEnumeration


Enumeration
  #Web_1
  #Web_0
  #Panel_1


  #Button_1

  #Button_3

EndEnumeration


Global FontID1
FontID1 = LoadFont(1, "Arial", 8, #PB_Font_Bold)
Global FontID2
FontID2 = LoadFont(2, "Arial", 8)
Global FontID3
FontID3 = LoadFont(3, "Arial", 8, #PB_Font_Bold | #PB_Font_Italic)

Procedure Open_Window_0()
  If OpenWindow(#Window_0, 194, 310, 305, 329, "NoelOo tool v1.01",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
    If CreateGadgetList(WindowID(#Window_0))
      
      ;- prog
      PanelGadget(#Panel_1, 0, 0, 320, 330)
      AddGadgetItem(#Panel_1, -1, "rien")


      AddGadgetItem(#Panel_1, -1, "1ere fenetre")
  
      ButtonGadget(#Button_1, 78, 278, 120, 20, "Telecharger le .bat")
      
      
    

      AddGadgetItem(#Panel_1, -1, "2eme fenetre")
      
      
      
      
      
      ButtonGadget(#Button_3, 58, 118, 170, 20, "2eme fenetre")
      
  
     
      CloseGadgetList()
      
      
      
      
      
    

      




     
      
      
      
      
    EndIf
  EndIf
EndProcedure



Open_Window_0()
Repeat ; Start of the event loop
    Event = WaitWindowEvent() ; This line waits until an event is received from Windows
    WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
    GadgetID = EventGadget() ; Is it a gadget event?
    EventType = EventType() ; The event type
    ;You can place code here, and use the result as parameters for the procedures
   
    If Event = #PB_Event_Gadget
        If GadgetID = #Button_1
            Gosub fenetre_3
        EndIf
    EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
End
;

; 2em fenetre
fenetre_3:
OpenWindow(#Window_2, 294, 245, 600, 300, "super site",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_2))
      WebGadget(#Web_1, 5, 5, 590, 290, "http://purebasic.fr/french/viewforum.php?f=1") 
Repeat
    Event2 = WaitWindowEvent() ; This line waits until an event is received from Windows
    WindowID2 = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
    GadgetID2 = EventGadget() ; Is it a gadget event?
    EventType2 = EventType() ; The event type
Until Event2=#PB_Event_CloseWindow
CloseWindow(#Window_2)
Return


Open_Window_0()
EndIf
Repeat ; Start of the event loop
    Event = WaitWindowEvent() ; This line waits until an event is received from Windows
    WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
    GadgetID = EventGadget() ; Is it a gadget event?
    EventType = EventType() ; The event type
    ;You can place code here, and use the result as parameters for the procedures
   
    If Event = #PB_Event_Gadget
        If GadgetID = #Button_3
            Gosub fenetre_2
        EndIf
    EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
End
;

; 2em fenetre
fenetre_2:
OpenWindow(#Window_1, 294, 245, 600, 300, "2eme fenetre",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_1))
      WebGadget(#Web_0, 5, 5, 590, 290, "www.jeuxvideo.com") 
Repeat
    Event2 = WaitWindowEvent() ; This line waits until an event is received from Windows
    WindowID2 = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
    GadgetID2 = EventGadget() ; Is it a gadget event?
    EventType2 = EventType() ; The event type
Until Event =#PB_Event_CloseWindow
CloseWindow(#Window_1)
Return
EndIf

re re re re merci d'avance :oops: :D
Avatar de l’utilisateur
venom
Messages : 3128
Inscription : jeu. 29/juil./2004 16:33
Localisation : Klyntar
Contact :

Message par venom »

voila tu devrez t'en sortir la.

Code : Tout sélectionner

Enumeration
  #Window_0
  #Window_1
  #Window_2
EndEnumeration

Enumeration
#Button_0
#Button_1
#Button_2
#Button_3
#Button_4
EndEnumeration

Procedure Open_Window_1()
  If OpenWindow(#Window_1, 216, 334, 300, 300, "1",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
    If CreateGadgetList(WindowID(#Window_1))
    ButtonGadget(#Button_3, 10,  10, 200, 20, "fenetre 1")
    EndIf
  EndIf
EndProcedure

Procedure Open_Window_2()
  If OpenWindow(#Window_2, 526, 334, 300, 300, "2",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
    If CreateGadgetList(WindowID(#Window_2))
    ButtonGadget(#Button_4, 10,  10, 200, 20, "fenetre 2")
    EndIf
  EndIf
EndProcedure

  If OpenWindow(#Window_0, 216, 0, 610, 300, "0",  #PB_Window_SystemMenu | #PB_Window_TitleBar )
    If CreateGadgetList(WindowID(#Window_0))
     ButtonGadget(#Button_0, 10,  10, 200, 20, "ouvrir fenetre 1")
     ButtonGadget(#Button_1, 400,  10, 200, 20, "ouvrir fenetre 2")
    EndIf
  EndIf
 
  Repeat
   EventID = WaitWindowEvent()
    If EventID = #PB_Event_Gadget
      Select EventGadget()
     
       Case #Button_0
        Open_Window_1()
       
       Case #Button_1
        Open_Window_2()
       
       Case #Button_3
        MessageRequester("info", "vous avez appuier sur le boutton dans la fenetre n°1", 0)
       
       Case #Button_4
        MessageRequester("info", "vous avez appuier sur le boutton dans la fenetre n°2", 0)
     
      EndSelect
    EndIf
  Until EventID = #PB_Event_CloseWindow

@++
Windows 10 x64, PureBasic 5.73 x86 & x64
GPU : radeon HD6370M, CPU : p6200 2.13Ghz
Répondre