Page 2 of 2

Posted: Fri Feb 22, 2008 9:46 am
by yoxola
I use PB's own VD as its simplisity.

Well I don't want a app with loads of encryption protection, that's why I leave PureVision although I think it's feature rich.

A side note...

If you can make a version for BlitzMax with cross-platform capability(just don't use Win32API....), it should sell as BlitzMax need such thing.

Posted: Fri Feb 22, 2008 9:49 am
by BriceManuel
yoxola wrote:If you can make a version for BlitzMax with cross-platform capability(just don't use Win32API....), it should sell as BlitzMax need such thing.
BMax needs a usable GUI system before you worry about making a GUI designer for it :lol:

Posted: Fri Feb 22, 2008 1:02 pm
by yoxola
I'd say it has enough gadget for usage and all available commands are corss-platform, like making a Map Editor etc.

If you want Win32 only, check LogicGui fo BlitzMax.

While making app things I'd choose PB, it depends on projects tho.

Posted: Fri Feb 22, 2008 10:15 pm
by BriceManuel
yoxola wrote:I'd say it has enough gadget for usage and all available commands are corss-platform,
Wasn't referring to features, I was referring to usability/stability. Buggier than hell on OSX, bad with Linux, semi-usable on Windows.

Chris writing a VD for BM wouldn't help as the code generated would still be using the native BM GUI commands.

Posted: Fri Feb 22, 2008 11:34 pm
by garretthylltun
BriceManuel wrote:
yoxola wrote:If you can make a version for BlitzMax with cross-platform capability(just don't use Win32API....), it should sell as BlitzMax need such thing.
BMax needs a usable GUI system before you worry about making a GUI designer for it :lol:
BlitzMax has MaxGUI which dearly needs a good VD for it. In fact, I kind of stopped using Blitz because of the lack of a good VD.

Posted: Sun Feb 24, 2008 12:08 am
by Rook Zimbabwe
I use one of the beta versions of the VD because I like the way it sets up the program loop. I think it is more structured that way and easier for the compiler to optimize the ASM, using the other format actually added 25% to the size of my program... when comparing the stack of elseifs in the original program loop.

basic window code with 1 button, as an example:

Code: Select all


Enumeration
  #Window_0
EndEnumeration

Enumeration
  #Text_0
  #Button_1
  #Button_0
EndEnumeration

Structure VisualDesignerGadgets
  Gadget.l
  EventFunction.l
EndStructure

Global NewList EventProcedures.VisualDesignerGadgets()

Procedure Text_0_Event(Window, Event, Gadget, Type)
  Debug "#Text_0"
EndProcedure

Procedure Button_1_Event(Window, Event, Gadget, Type)
  Debug "#Button_1"
  SetGadgetText(#Text_0, "BUTTON ONE HAS BEEN PUSHED!")
EndProcedure

Procedure Button_0_Event(Window, Event, Gadget, Type)
  Debug "#Button_0"
  SetGadgetText(#Text_0, "BUTTON ZERO HAS BEEN PUSHED!")
EndProcedure

Procedure RegisterGadgetEvent(Gadget, *Function)
  
  If IsGadget(Gadget)
    AddElement(EventProcedures())
    EventProcedures()\Gadget        = Gadget
    EventProcedures()\EventFunction = *Function
  EndIf
  
EndProcedure

Procedure CallEventFunction(Window, Event, Gadget, Type)
  
  ForEach EventProcedures()
    If EventProcedures()\Gadget = Gadget
      CallFunctionFast(EventProcedures()\EventFunction, Window, Event, Gadget, Type)
      LastElement(EventProcedures())
    EndIf
  Next
  
EndProcedure

Procedure Open_Window_0()
  
  If OpenWindow(#Window_0, 5, 5, 318, 155, "Window EXAMPLE",  #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_TitleBar )
    If CreateGadgetList(WindowID(#Window_0))
    
      ButtonGadget(#Button_0, 15, 55, 280, 35, "SET TEXT 0")
      RegisterGadgetEvent(#Button_0, @Button_0_Event())
      ButtonGadget(#Button_1, 15, 100, 280, 35, "SET TEXT 1")
      RegisterGadgetEvent(#Button_1, @Button_1_Event())
      
      TextGadget(#Text_0, 15, 15, 280, 20, "NADA", #PB_Text_Center | #PB_Text_Border)
      RegisterGadgetEvent(#Text_0, @Text_0_Event())
      
    EndIf
  EndIf
EndProcedure

Open_Window_0()

Repeat
  
  Event  = WaitWindowEvent()
  Gadget = EventGadget()
  Type   = EventType()
  Window = EventWindow()
  
  Select Event
    Case #PB_Event_Gadget
      CallEventFunction(Window, Event, Gadget, Type)
      
  EndSelect
  
Until Event = #PB_Event_CloseWindow

End
While the organization and benefit are at a minimum in a tiny program like this... my POS Application has over 1000 buttons all told on 9 screens. Organization like this is mind numbingly easy at t hat point.

the other way:

Code: Select all

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

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


;- Window Constants
;
Enumeration
  #Window_0
EndEnumeration

;- Gadget Constants
;
Enumeration
  #Text_0
  #Button_0
  #Button_1
EndEnumeration


Procedure Open_Window_0()
  If OpenWindow(#Window_0, 216, 0, 335, 160, "Window EXMAPLE 2",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
    If CreateGadgetList(WindowID(#Window_0))
      TextGadget(#Text_0, 12, 18, 312, 18, "", #PB_Text_Center | #PB_Text_Border)
      ButtonGadget(#Button_0, 12, 48, 312, 36, "SET TEXT ZERO")
      ButtonGadget(#Button_1, 12, 96, 312, 36, "SET TEXT ONE")
      
    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_0
      SetGadgetText(#Text_0, "BUTTON ZERO PRESSED!")
    ElseIf GadgetID = #Button_1  ; the elseif go on and on and on if you have a lot of buttons!!! 
                                                        ; better To have a Procedure For each
      SetGadgetText(#Text_0, "BUTTON ONE PUSHED!")
    EndIf
    
  EndIf
  
Until Event = #PB_Event_CloseWindow ; End of the event loop

End
;
Is looser, and if you have a lot of buttons you have a stack of ElseIfs running amuck in your program loop...

I think it is messy.

And with a lot of controls can be cumbersome. 8)

Posted: Sun Feb 24, 2008 12:12 am
by Rook Zimbabwe
BlitzMax has MaxGUI which dearly needs a good VD for it. In fact, I kind of stopped using Blitz because of the lack of a good VD.
It could be written in BMax... If anyone really wanted to write one! As I recall there were some attempts before I left... At a VD for BMax, but they wanted you to pay for them! :shock:

Posted: Sun Feb 24, 2008 12:31 am
by BriceManuel
and if you have a lot of buttons you have a stack of ElseIfs running amuck in your program loop..
I take it you are like me and prefer to create your own CF?