QB64.org Forum

QB64 Team Software => InForm Discussion => Topic started by: LM on March 15, 2021, 09:42:47 pm

Title: Inform editing question
Post by: LM on March 15, 2021, 09:42:47 pm
I have a beginner's question about InForm.  I am using v1.2 build 15.

I am ran InForm Designer (UiEditor.exe).  I made a simple form with some labels and buttons.  I then saved and exited to QB64.  I wrote a few lines of code to respond to events (like mouse entering a control or mouse down on a control).  I then found that I would like to add some additional controls to the form.  I again went to the InForm Designer, loaded my form and added the controls.  Here is my question: Is there a way to save the new form and use it with the code I already wrote without losing it?  I did not immediately see how this is done.  My edited form resulted in a new .bas file without the code I already wrote.  Am I missing something?  Do you have any recommendations?

Thanks!

LM
Title: Re: Inform editing question
Post by: FellippeHeitor on March 16, 2021, 08:49:11 am
When you save an existing project, InForm will save a backup of both the .bas and the .frm files, in the same folder as the originals, with -backup added to their name. You can just rename those and continue using them.

However, in the upcoming version of InForm I've made it a bit smarter about reusing existing code when editing an existing form. If you'd like to test the new feature, enable auto-updates and choose the development channel:

  [ This attachment cannot be displayed inline in 'Print Page' view ]  

You should get a notification prompting you to update InForm. After you're in the latest development build, you will see that editing existing projects will be way smoother.

  [ This attachment cannot be displayed inline in 'Print Page' view ]  
Title: Re: Inform editing question
Post by: FellippeHeitor on March 16, 2021, 08:51:40 am
Now, even without upgrading, if you wish to just edit the .frm file without affecting the .bas file, you can go to the Save dialog (File->Save project as) and check "Don't save .bas project (save .frm only)".

  [ This attachment cannot be displayed inline in 'Print Page' view ]  

If you do that, the .bas file will remain unchanged - but in this case you should manually add the DIM lines for whatever new controls you may have added.

My advice is: get the development build if editing an existing form is something you will be doing often.

Title: Re: Inform editing question
Post by: LM on March 16, 2021, 08:04:27 pm
Thanks!  Much appreciated.  I will try it.

LM