Form Designer 5.10
Re: Form Designer 5.00 beta 3
And as I replied on the french forum, if you check "Caption is a variable" it'll be treated as a variable...
Again, if you want to use enumeration, just uncheck #PB_Any (gadget per gadget or in preferences)
Again, if you want to use enumeration, just uncheck #PB_Any (gadget per gadget or in preferences)
Re: Form Designer 5.00 beta 3
To make sure everyone is using the latest version I've quickly compiled a new one:
http://www.gdpcomputing.co.uk/formdesigner.html
http://www.gdpcomputing.co.uk/formdesigner.html
Re: Form Designer 5.00 beta 3
But you should always use the same namePolo wrote:To make sure everyone is using the latest version I've quickly compiled a new one:

Windows: FormDesigner.exe, Form Designer.exe and Visuell Designer.exe

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Re: Form Designer 5.00 beta 3
Polo wrote:And as I replied on the french forum, if you check "Caption is a variable" it'll be treated as a variable...
Again, if you want to use enumeration, just uncheck #PB_Any (gadget per gadget or in preferences)

I'm really a dumb : 3 options could sink me

Sorry about annoyance

By the way, how to use the EventProcedure field (the list is empty) ? I would to add some action like below...
Code: Select all
Procedure Window_0_Events(event)
Select event
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
Case #PB_Event_SizeWindow
ResizeGadgetsWindow_0()
EndSelect
EndProcedure
InitWindow_0()
Repeat
event = WaitWindowEvent(20)
Window_0_Events(event)
Until event = #PB_Event_CloseWindow
Re: Form Designer 5.00 beta 3
I downloaded the latest version. I believe there is a problem with gadget positions when there is the toolbar (at least in windows):
[img]
http://s10.postimage.org/41m595qax/test.jpg
[/img]
Code: Select all
Global Window_1
Global Panel_0
Global Img_0, Img_1
Enumeration #PB_Compiler_EnumerationValue
#Toolbar_0
#Toolbar_1
EndEnumeration
UsePNGImageDecoder()
Img_0 = LoadImage(#PB_Any,"C:\ZZZZ_Ardi_Go\Explorer\16x16-free-toolbar-icons\png\73.png")
Img_1 = LoadImage(#PB_Any,"C:\ZZZZ_Ardi_Go\Explorer\16x16-free-toolbar-icons\png\25.png")
Procedure InitWindow_1()
Window_1 = OpenWindow(#PB_Any, 0, 0, 600, 400, "", #PB_Window_SystemMenu)
CreateToolbar(0, WindowID(Window_1))
ToolBarImageButton(#Toolbar_0,ImageID(Img_0))
ToolBarImageButton(#Toolbar_1,ImageID(Img_1))
Panel_0 = PanelGadget(#PB_Any, 10, 0, 580, 370)
AddGadgetItem(Panel_0, -1, "Tab 1")
CloseGadgetList()
EndProcedure
Procedure Window_1_Events(event)
Select event
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
EndProcedure
InitWindow_1()
Repeat
event = WaitWindowEvent()
Window_1_Events(event)
ForEver
http://s10.postimage.org/41m595qax/test.jpg
[/img]
Re: Form Designer 5.00 beta 3
Fixed, thanks.
Re: Form Designer 5.00 beta 3
Probably would be beneficial to add the #PB_Event_CloseWindow event to your event loop. Plus the "generate event loop" option should remove this procedure when its not checked. As it is part of the event loop. This way if people only decide to design the form in the designer they don't end up with a piece of the event loop.
Code: Select all
Procedure Window_0_Events(event)
Select event
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
Case #PB_Event_CloseWindow
End
EndSelect
EndProcedure
Its Not A Bug, Its An Undocumented Feature!
Relax Its All Just Ones And Zeros
There Is No Place Like 127.0.0.1 Except ::1
I do things TO my computer, not WITH my computer... I am a nerd.
Relax Its All Just Ones And Zeros
There Is No Place Like 127.0.0.1 Except ::1
I do things TO my computer, not WITH my computer... I am a nerd.
Re: Form Designer 5.00 beta 3
Another option would be to let the event procedure return true / false.
That way you can repeat until Window_0_Events(event) = #True and still do some cleanup or closing of files afterwards.
Code: Select all
Procedure Window_0_Events(event)
Select event
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
Case #PB_Event_CloseWindow
ProcedureReturn #True
EndSelect
ProcedureReturn #False
EndProcedure
Re: Form Designer 5.00 beta 3
That would not work, as the #PB_Event_CloseWindow is to represent the close program event. It should be a simple End, what you are referring to is a custom event that only pertains to your use. Usually when everyone uses the #PB_Event_CloseWindow flag its usually followed by a End. Especially for GUI applications, the only way it would return a value is if Polo added in code prediction for applications that don't even exist yet, for example a application that I will code tomorrow, or maybe next week. He will need to know the exact structure of your code with all data types etc. Its impossible for him to know code that doesn't exist, let alone write this tool to predict future code its 100% impossible to do. So it would end up staying the way it is before it would ever return a value. Tho if he adds the proper End to it, all you would have to do is change it out with a procedurereturn. Instead of having to type the case flag, and then what to do. The idea is to structure the event loop properly, not structure it to one persons needs.wilbert wrote:Another option would be to let the event procedure return true / false.That way you can repeat until Window_0_Events(event) = #True and still do some cleanup or closing of files afterwards.Code: Select all
Procedure Window_0_Events(event) Select event Case #PB_Event_Gadget Select EventGadget() EndSelect Case #PB_Event_CloseWindow ProcedureReturn #True EndSelect ProcedureReturn #False EndProcedure
Last edited by Warmonger on Tue Sep 25, 2012 5:57 am, edited 1 time in total.
Its Not A Bug, Its An Undocumented Feature!
Relax Its All Just Ones And Zeros
There Is No Place Like 127.0.0.1 Except ::1
I do things TO my computer, not WITH my computer... I am a nerd.
Relax Its All Just Ones And Zeros
There Is No Place Like 127.0.0.1 Except ::1
I do things TO my computer, not WITH my computer... I am a nerd.
Re: Form Designer 5.00 beta 3
Wilberts version works well indeed, that is a template that I've been using for years.
Just doing 'End' with no cleaning up, flushing data to disks from arrays and lists etc. could be bad.
In general: I would recommend a single shutdown code instead of having uncontrolled End's all over.
Just doing 'End' with no cleaning up, flushing data to disks from arrays and lists etc. could be bad.
In general: I would recommend a single shutdown code instead of having uncontrolled End's all over.
The best preparation for tomorrow is doing your best today.
Re: Form Designer 5.00 beta 3
Like stated above it would be a up-most terrible idea to have it return a value not everyone is going to use. Take a look at this code and tell me how it would not work for you.KJ67 wrote:Wilberts version works well indeed, that is a template that I've been using for years.
Just doing 'End' with no cleaning up, flushing data to disks from arrays and lists etc. could be bad.
In general: I would recommend a single shutdown code instead of having uncontrolled End's all over.
Code: Select all
Procedure Window_0_Events(event)
Select event
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
Case #PB_Event_CloseWindow
CleanUp() ;Add Your Cleanup
End
EndSelect
EndProceduree
Its Not A Bug, Its An Undocumented Feature!
Relax Its All Just Ones And Zeros
There Is No Place Like 127.0.0.1 Except ::1
I do things TO my computer, not WITH my computer... I am a nerd.
Relax Its All Just Ones And Zeros
There Is No Place Like 127.0.0.1 Except ::1
I do things TO my computer, not WITH my computer... I am a nerd.
Re: Form Designer 5.00 beta 3
For me the loop before the GUI would look something like;
The use of End would risk causing lost data. Any application that handles more complicated data will have to consider the use of a shutdown & save function - not just pull the plug.
Code: Select all
InitCode()
InitWindow_0()
Repeat:Until Window_0_Events(WaitWindowEvent()) = #True
;CloseWindow(XYZ)
ShutDownGracefully()
The best preparation for tomorrow is doing your best today.
Re: Form Designer 5.00 beta 3
True, but almost never immediately.Warmonger wrote:Tho one thing is for sure once you click the exit control, you intend for the program to eventually end.
Both the PureBasic IDE and the Form Designer are coded using PureBasic itself. Assume you did a lot of hard work on the project you are working on, forget to save the changes and hit the close button. Most people would be very unhappy if it just exists without asking if the modified files need to be saved.
As for your other comment, what's wrong with returning a value if not everybody is using it. A procedure like ButtonGadget returns a value but most users just ignore it.
Re: Form Designer 5.00 beta 3
So your suggesting he code in support for everyone's own cleanup functions? You do understand they are different with every single program that was ever written. Like posted before you just call your cleanup before the end. The end is universal among every single application, as it will look exactly the same in every program any of you will write. An example how is this...wilbert wrote:True, but almost never immediately.Warmonger wrote:Tho one thing is for sure once you click the exit control, you intend for the program to eventually end.
Both the PureBasic IDE and the Form Designer are coded using PureBasic itself. Assume you did a lot of hard work on the project you are working on, forget to save the changes and hit the close button. Most people would be very unhappy if it just exists without asking if the modified files need to be saved.
As for your other comment, what's wrong with returning a value if not everybody is using it. A procedure like ButtonGadget returns a value but most users just ignore it.
Code: Select all
Procedure CleanUp()
;Do Some Stuff
End
EndProcedure
Procedure Window_0_Events(event)
Select event
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
Case #PB_Event_CloseWindow
CleanUp() ;Add Your Cleanup
EndSelect
EndProcedure
Code: Select all
Procedure CleanUp()
;Do Some Stuff
EndProcedure
Procedure Window_0_Events(event)
Select event
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
Case #PB_Event_CloseWindow
CleanUp() ;Add Your Cleanup
End
EndSelect
EndProcedure

Its Not A Bug, Its An Undocumented Feature!
Relax Its All Just Ones And Zeros
There Is No Place Like 127.0.0.1 Except ::1
I do things TO my computer, not WITH my computer... I am a nerd.
Relax Its All Just Ones And Zeros
There Is No Place Like 127.0.0.1 Except ::1
I do things TO my computer, not WITH my computer... I am a nerd.