updated Freeform 4.50 --> 4.51
Nov 21, 2020 18:47:59 GMT -5
Chris Iverson, ntech, and 1 more like this
Post by grimblefritz on Nov 21, 2020 18:47:59 GMT -5
I had a need to drag out LB for the first time in years in order to do some updates on a project that I did a very long time ago. I figured it had been replaced long before now, but lo and behold it (along with a few other apps I did prior to this century!) was still chugging away.
As I wanted to turn the thing over to the latest young sys admin (who can do shell scripting and that's about all) I decided to fix a few of the things about Freeform that bothered me and make his lot easier. My primary objective, besides a bit of clean up work, was to move Freeform closer to not requiring code changes after using Produce Code (+Outline). It's still not 100%, but much closer.
The full source is attached. Here is the change summary:
No clue how many still use FF, or if there are other branches from 4.50 out there. This is just what I came up with from the most recent LB 4.51 package.
Enjoy!
As I wanted to turn the thing over to the latest young sys admin (who can do shell scripting and that's about all) I decided to fix a few of the things about Freeform that bothered me and make his lot easier. My primary objective, besides a bit of clean up work, was to move Freeform closer to not requiring code changes after using Produce Code (+Outline). It's still not 100%, but much closer.
The full source is attached. Here is the change summary:
'##################### BEGIN SMISCO 22 Nov 2020 ######################
'
'Updates by SMISCO <scott@smisco.net>
'
'In this version of FreeForm 4.51 I changed references to lbasic450.ini
'to lbasic451.ini. The user ini file is now also fixed to the name of
'ffrmuser.ini. There are code tweaks to support both changes.
'
'Cleaned up a lot of blank lines, indenting, etc. If running a diff of
'this versus the prior version, I recommend to ignore blank lines and
'whitespace (especially at the beginning of lines.)
'
'Individual changes:
'
' + added vars false=0 and true=not(false)
' + added [breakpoint] for use in debugging freeform itself
' + added ffAppname$, ffVersion$, ffRelease$ for identifiers
' * reworked how app title is built (using above vars)
' * reworked several "Freeform" literal strings to use ffAppname$ etc
' * changed FF user ini file to ffrmuser.ini
' + added nl$, cr$, and sq$ (newline, carriage return, single quote)
' + added Ctrl-L to pull up the List All Controls dialog
' * fixed minor alignment issue on a couple of toolbar buttons
' * changed "array$(" to "array$()" in several control dialogs
' * enlarged code output window from 450x330 to 640x480
' + MAJOR CHANGE added code import for object 1 (main window - see below)
' * refactored code to do imports into [printImportedCode]
' + MAJOR CHANGE to how mulitBranch objects are built (see below)
' * dummy lines in .ffa files now say "DummyN" where N=1..25
' * fixed typos of displayColtrolList to displayControlList
' * tweaked inspectControl dialog (probably needs complete refactor)
' * moved code to create controlList array, into gosub routine
' * MAJOR CHANGE to List All Controls dialog (see below)
'
'
'IMPROVED CODE IMPORT - OBJECT 1
'
'During code generation it is now possible to import (aka, include) code
'for the main window (object 1) at three times:
'
' 1. Before ANY other code is generated
' 2. After object 1 is generated, but before any "outline" code
' 3. After all outline code has been generated
'
'To accomplish this, an "Import" field was added to object 1. Whatever
'this file is called, that is what is imported in stage 1 above. Let us
'assume this file is named "main.inc". Here is what happens at each stage:
'
' 1. main.inc is imported
' 2. if found, main.inc2 is imported
' 3. if found, main.inc3 is imported
'
'For many simple projects, this allows Freeform to manage all code and
'to execute all that is needed is to paste the output (with outline) into
'a new LB instance and click Run.
'
'IMPROVED MULTIBRANCH OBJECTS
'
'These objects have two branch targets. Previously, these were generated
'with "enter your own code" comments. If you did provide an import file
'for the control, it wouldn't really work out unless additional manual
'tweaks were made in the generated code.
'
'To address this, the code generator now outputs something like this:
'
' [firstBranch]
' goto [firstBranch.action]
' wait
'
' [secondBranch]
' goto [secondBranch.action]
' wait
'
'If using an import file on this control, then define the code for both
'action branches. Those labels will not be added to the generated code.
'
'On the other hand, if not using an import file, then the two actions
'are added to the generated code as follows:
'
' [firstBranch.action]
' 'Insert your own code here
' wait
'
' [secondBranch.action]
' 'Insert your own code here
' wait
'
'
'IMPROVED LIST ALL CONTROLS DIALOG
'
'First, this dialog can be accessed now with Ctrl-L.
'
'Second, added command bar at the bottom of the dialog for:
'
' 1. Move selected object up or down in the list
' 2. Close the dialog
'
'Moving an object up or down changes its position in the arrays that
'hold the controls in memory. This does not have a visible effect in
'Freeform (other than getting to see the object move up/down in the
'list!) What is does is control the order in which objects are:
'
' 1. Generated by the Produce Code options
' 2. Written out to the .ffa file
'
'In a more practical sense, it allows control over the tabbing order
'of the controls since (without a lot of extra code) controls are added
'to the Windows tabindex in the order they are created.
'
'This is a lot easier (and safer) than manually editing the order in
'the .ffa file!
'
'###################### END SMISCO 22 Nov 2020 #######################
No clue how many still use FF, or if there are other branches from 4.50 out there. This is just what I came up with from the most recent LB 4.51 package.
Enjoy!