Page 1 of 1

visualDesigner output

Posted: Mon Jun 22, 2009 5:15 am
by vmars
I am starting to be impressed with this PureBasic stuff!

Ok! I had some success with vDesign, able to get it into pB, saved it as pbv and pb.
I get one warning error for deprecated gadget. But it compiles and Runs.
I get this msg: "Program execution has finished"

But the pgm doesn't actuall display anything.
Can someone please tell me what is missing from pgm below? It seems it should at least show the window.
Thanks! ...Vern

Code: Select all

; PureBasic Visual Designer v3.95 build 1485 (PB4Code)


;- Window Constants
;
Enumeration
  #Window_0
EndEnumeration

;- Gadget Constants
;
Enumeration
  #Button_0
  #ScrollArea_0
  #Editor_0
  #Container_0
  #Panel_0
  #Panel_1
  #Panel_2
  #Button_1
EndEnumeration


Procedure Open_Window_0()
  If OpenWindow(#Window_0, 212, 2, 611, 474, "New window ( 0 )",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
    If CreateGadgetList(WindowID(#Window_0))
      ButtonGadget(#Button_0, 270, 220, 260, 30, "")
      EditorGadget(#Editor_0, 0, 300, 600, 170)
      
      ;-
      ScrollAreaGadget(#ScrollArea_0, 250, 180, 350, 100, 700, 200, 10)
      CloseGadgetList()
      
      ;-
      ContainerGadget(#Container_0, 0, 220, 260, 50)
      CloseGadgetList()
      
      ;- Panel2
      PanelGadget(#Panel_0, 20, 30, 570, 180)
      AddGadgetItem(#Panel_0, -1, "Tab 1")
      
      ;- Panel4
      PanelGadget(#Panel_1, 48, -22, 520, 180)
      AddGadgetItem(#Panel_1, -1, "Tab 1")
      
      ;- Panel6
      PanelGadget(#Panel_2, 48, -22, 470, 180)
      AddGadgetItem(#Panel_2, -1, "Tab 1")
      ButtonGadget(#Button_1, 28, 28, 70, 60, "")
      CloseGadgetList()
      CloseGadgetList()
      CloseGadgetList()
      
    EndIf
  EndIf
EndProcedure

Posted: Mon Jun 22, 2009 5:49 am
by Fangbeast
G'day Vmars. A couple of things.

To make it easier to read your code, when you post it to the forum, higlight all of your text and select the 'CODE' button. it will indent and format the code to make it more readable.

Your code doesn't run as the window procedure isn't called.

And there is no event checking loop to do anything on that windows.

There is an option in the visual designer to 'create event loop' which will call that procedure and create a loop to check for events on that window.

This is available when you elect to export/save the generated code.

That will fix your problem.

In the visual designer, go to PROJECT, PROJECT OPTIONS, and tick CREATE EVENT LOOP.

Posted: Mon Jun 22, 2009 9:50 pm
by vmars
That did it. Thanks!