Zebuddi.

https://github.com/ChrisRfr/SweetyVD
The newer versions of the form designer have removed the option for generating the event loop, freeing the programmer to process events at their discretion. This is a very minor change that only requires the main event loop to be included in an external file.franb wrote:I am trying the demo version 5.6 in Windows. In my Form preferences there is no option to automatically generate an event loop in the Form Designer.
Code: Select all
XIncludeFile "MyForm.pbf"
Procedure buttonEvent(eventType.i)
;get the text from the text box (identifier = String_0)
text$ = GetGadgetText(String_0)
;and place it in the label (identifier = Text_0)
SetGadgetText(Text_0, text$)
EndProcedure
Code: Select all
XIncludeFile "MyForm.pbf"
Procedure buttonEvent(eventType.i)
;get the text from the text box (identifier = String_0)
text$ = GetGadgetText(String_0)
;and place it in the label (identifier = Text_0)
SetGadgetText(Text_0, text$)
EndProcedure
;ADDITION #1: call to the main window procedure
OpenWindow_0()
;ADDITION #2: the main event loop
Repeat
event = WaitWindowEvent()
Until Window_0_Events(event) = #False
It's one of the negative points of PB Form, It would be really nice to have a revision on these 2 points.TI-994A wrote:franb wrote: Now, simply add the call to the main window procedure and include the main event loop
That is not necessary, as any changes could be saved as regular source files before switching back to design view. But that's not the intended implementation of these form files. They are meant to be used as standalone user interface files that are included and called by the main program. All event processing should be performed within the main program and not in these reusable form files.ChrisR wrote:It is tiring to have to copy the code into a new tab to be able to add those changes.
Not impossible, but the parser would have to work overtime.ChrisR wrote:...it would be good to be able to add codes without being destroyed during the Code/Form flip-flop.
Code: Select all
[IncludeFile]
[enumeration]
Line01=#MyFont
[Declare]
[Procedure]
Line01=LoadFont(#MyFont, "Verdana", 8)
[Initialisation]
[EventLoop]
[Exit]
Technically, form files are purely intended for the design and layout of user interfaces. It is the same with Visual Studio's form designer, Android Studio's layout editor, and even XCode's interface builder; all the forms comprise of static code purely for the creation of the UI and nothing more. They have to be linked to external code modules for event processing.ChrisR wrote:...it would be good to have OpenWindows writen in source and the event loop reviewed To be able to run Out Of the Box, after copying the source in a new Tab.