Form Designer Code -> Visual Update
Form Designer Code -> Visual Update
I honestly think the Form Designer needs to be able to update the current project when switching from the code view back to the design view. This way you can do "advanced" edits to the code and the designer will automatically inherit the updated code. All you should need to do is make it re-parse the code before going back to the design mode and update the visual layout (pretty much what happens when you load a saved project). This way we can add in our own code by hand without it constantly reverting back to the original generated code.
Re: Form Designer Code -> Visual Update
This is already the way it works. It actually reparse the code and update the form - only what the form designer understand is kept. If it doesnt work that way then there's a bug somewhere.Opcode wrote:All you should need to do is make it re-parse the code before going back to the design mode and update the visual layout (pretty much what happens when you load a saved project). This way we can add in our own code by hand without it constantly reverting back to the original generated code.
Re: Form Designer Code -> Visual Update
Hello Opcode. Polo's right; any changes to the form layout or events that have been generated by Form Designer can be modified programmatically, and such changes will be preserved and even visually updated in the form view. However, additions of gadgets or events via code are not recognised or honoured, although that would be nice too.Opcode wrote:I honestly think the Form Designer needs to be able to update the current project when switching from the code view back to the design view. This way you can do "advanced" edits to the code and the designer will automatically inherit the updated code.
In any case, all other variables, constants, events, and code in general, should be processed and handled by the main program, with the .pbf code acting only as a "ready-made plugin" of the pre-designed form. This is similar to the model employed by VB6, which hides its form code from view altogether, allowing additions and modifications to the form only via the object view of its IDE.
Alternatively, you could simply use Form Designer to generate the initial template of your form, along with the event handlers if you wish, and then save it as a normal PureBasic .pb source file, which you can then directly code into. However, you'd lose the ability to visually edit the form further, or, if you attempted to revert it back to a Form Designer .pbf file, you'd lose all your added code.
Just some options, to be exercised with great care!

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 

Re: Form Designer Code -> Visual Update
The form designer doesn't use an extra file to store information, all is parsed from the source. So you can add a gadget manually if you want but you have to respect the form designer syntax.
Re: Form Designer Code -> Visual Update
You're right Fred. I've been so used to Form Designer wiping out my additional code, that I've never actually noticed that it allows gadgets to be added manually. However, the parser still seems to wipe out code that has been manually added to the events loop.Fred wrote:...you can add a gadget manually if you want but you have to respect the form designer syntax.

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 

Re: Form Designer Code -> Visual Update
This feature has the main advantage of copy-pasting some code from old projects to modify it with the designer (with a few modifications if necessary).
It does, only the code in the OpenWindow() procedure should be modified manually.TI-994A wrote:You're right Fred. I've been so used to Form Designer wiping out my additional code, that I've never actually noticed that it allows gadgets to be added manually. However, the parser still seems to wipe out code that has been manually added to the events loop.
Re: Form Designer Code -> Visual Update
And this should be in the manual so you can direct everyone to RTFM!Polo wrote:It does, only the code in the OpenWindow() procedure should be modified manually.

Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)