Thinking laterally about form design

In this category you can exchange your programming questions and solutions.
Post Reply
RacingDog
Posts: 4
Joined: Thu Jan 10, 2019 11:32 pm

Thinking laterally about form design

Post: # 1322Post RacingDog
Tue Feb 02, 2021 1:11 pm

I was thinking about how we go about designing forms. One thing seemed clear, the benchmark for form designers are the IDEs for C++ Builder, Delphi and Lazarus (I'll call them CDL!). Such a shame we can't use them, especially as there are free versions of all of those. That's when I went off at a tangent. What, I wondered, if we could use them? If you look at the text form of the form files for those IDEs (.dfm or .lfm) you can't help but notice that most of the content looks not too dissimilar to FNX object declarations. If something is not too dissimilar then ones programmer's brain says, well maybe it's possible to build a translator!

So, I set out on that happy course of action and very soon realised that, yes, you could do a lot by just reforming individual lines as I'd hoped, but there were two categories of "it's not that simple"! The first and biggest of those two categories none the less yielded to slightly more complex reformatting. However, the second category turned out to be impossible to convert due to the completely different way the items are implemented between the CDL IDEs and FNX. However, as this was a fairly small part of the overall data set, I decided to put the tool on my web site as freeware in case anybody could find a use for it.

The way I use it is to design a form using the form designers of CDL, but keeping in mind that there is no point using something that FNX doesn't support, and that my tool doesn't support. Then a couple of mouse clicks on my gadget produces the FNX object declarations in an include (.inc) file. For initial creation, or later testing, the gadget can optionally also produce a .bas file which references the .inc file and also includes stub SUBs for any Events you specified at form design time.

What is supported? All the FNX objects that are Windowed and can have a Parent plus WinTimer. What is not supported? Mainly it is graphics. Objects which contain graphics are supported, it is just the graphical Properties that can't be translated. Have a look at a .dfm or .lfm file and you'll soon see why! There are similar problems with the design time data content of Listviews and Treeviews. Again, those objects are supported, it is just the data Properties which are not.

So if you want to play around with it, it is called FNX Forms Port and can be found at racingdog.hostfree.pw/Freeware which only contains my own few programs.

Cheers,
Derek

RacingDog
Posts: 4
Joined: Thu Jan 10, 2019 11:32 pm

Re: Thinking laterally about form design

Post: # 1324Post RacingDog
Tue Mar 02, 2021 7:10 pm

Will the brave soul that has downloaded this please note that I have made one very very minor correction. So if you want to get it permanently can you please download the setup file again and re-install.

If you want to do it by hand, run an instance of Notepad as an Administrator. Look in the folder where the program is installed and open Form.txt. After the line ModalResult, insert a new line containing the single word Position. Close Notepad. That's all it is!

Post Reply