Tutorial: events handling with the Form Designer

You need some new stunning features ? Tell us here.
Fred
Administrator
Administrator
Posts: 16616
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Tutorial: events handling with the Form Designer

Post by Fred »

This 'create event loop" flag will be removed in the next PB version as it's not useful but very confusing. It should be always uncheked to use the form designer properly.
User avatar
TI-994A
Addict
Addict
Posts: 2512
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Tutorial: events handling with the Form Designer

Post by TI-994A »

newtheogott wrote:...i have to disable the "create Event Loop" in the Form Designer and do that manually in an include file, then i can write my Form-initialization just in front of that.
Yes. The preferred approach would be to disable the Generate event loop option altogether; just as Fred has said in the preceding post.

The form file would then contain purely form code, while all executable code would reside in external code files, including the main event processing loop.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
newtheogott
Enthusiast
Enthusiast
Posts: 120
Joined: Sat Apr 26, 2003 2:52 pm
Location: Germany, Karlsruhe
Contact:

Re: Tutorial: events handling with the Form Designer

Post by newtheogott »

I would really like a system, where the Form Designer generates all the code.
Including all the Event-Procedures. This is normally the Standard.

Thats only possible, if all the Form-Data is stored in a separate file (such files are known from VB).
Then the Form Designer can always "regenerate" the code from this file.
No matter what changes the user did in the code.

As a help, the Form-Designer could use comments in the code-file to find each item-line.
For example:

Code: Select all

;###FD:Gadget 021 Begin
... (Code that was generated)
;###FD:Gadget 021 End

And between these blocks the user could do what he wants.
Otherwise "Newbies" like me will not be able to make a usable form without first studying the manual.
And - in case of many buttons - have a lot of typing work that could easily be automated by somebody who really knows how to use the underlying system.
--Theo Gottwald
-----------------------------------------
http://www.it-berater.org * http://www.fa2.de * http://www.smart-package.com
User avatar
falsam
Enthusiast
Enthusiast
Posts: 630
Joined: Wed Sep 21, 2011 9:11 am
Location: France
Contact:

Re: Tutorial: events handling with the Form Designer

Post by falsam »

Fred wrote:This 'create event loop" flag will be removed in the next PB version as it's not useful but very confusing. It should be always uncheked to use the form designer properly.
100% agree.

➽ Windows 11 64-bit - PB 6.0 x64 - AMD Ryzen 7 - NVIDIA GeForce GTX 1650 Ti

Sorry for my bad english and the Dunning–Kruger effect.
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Tutorial: events handling with the Form Designer

Post by Marc56us »

cpat wrote: If I do not use the IncludeFile statement, ...
... then you can't use form designer :)

Look here (at bottom) « Using the form designer in real world projects »
https://www.purebasic.com/documentation ... _form.html

PS. A very good option of the form designer is the Image manager
Check Catch Image and Relative path and the FD write all the complicated code for including images 8)

:wink:

('create event loop' flag (checkbock) is removed since 5.50)
Mindphazer
Enthusiast
Enthusiast
Posts: 340
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: Tutorial: events handling with the Form Designer

Post by Mindphazer »

Marc56us wrote: Check Catch Image and Relative path and the FD write all the complicated code for including images 8)
100% agree 8)
MacBook Pro 14" M1 Pro - 16 Gb - MacOS 14 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
Post Reply