Previous: 21 Dealing with text
Next: 23 Distributing your application
In this section:
There are things that I don’t like very much about ClearWin+, some things I don’t like very much about FTN95 (not many!), but then there are also things that I don’t like very much about Fortran or even Windows! I expect everybody has their own personal list of things they don’t like or indeed that they find difficult to do using the facilities that they are given. My list is very personal and I do not expect for one moment that it will be the same for anyone else. It would be just a personal indulgence to provide my personal list, and so I will confine myself to listing the things that I find particularly difficult.
I always found it very difficult to write callback routines because I never had any use for EXTERNAL before I started programming with ClearWin+, and I always programmed FUNCTIONs to return a value rather than a success or failure code. After a couple of decades of experience, I can do it, but honestly it isn’t my preferred use of functions. Indeed, with modern Fortran it is possible to return an array from a function, and I have never done that and I’m equally sure that if you wrote a function that did return an array you could mess up WINIO@ in a big way.
It is also pretty difficult generating literally dozens of callback functions for every button and menu item, with the sole saving grace being that the callback functions for a toolbar reuse the functions from the menu system – almost. The sheer prolixity of the required code makes it essential to be organised with your source code, and that can’t be a bad thing (unless you don’t do it, and get in a muddle).
One foible that I find irritating is when I write text to a drawing surface using the default font and I place it with coordinates of its top left-hand corner but if I do anything to change that text, for example by making things italic, bold or underlined (or select a font), then the position point changes to the bottom left-hand corner of the text block. I find it quite hard to position things using the coordinate system for any drawing surface with the y-coordinate increasing downwards, but simplify this because normally I’m dealing with real-world coordinates and therefore have a way of forgetting about the drawing surface coordinate system because my transformation routines take care of it for me. I don’t particularly like statement functions, but they do have a very useful purpose for doing these transformations. It’s very easy to forget what statement functions are, and therefore what they do, but they are compiled inline and therefore using them saves a lot of coding.
I really can’t get on with these format codes although they have a lot in common with the listview (%lv) control (see Chapter 14) that I struggled with for years. Fortunately, I have never really needed them, and haven’t therefore had to spend a lot of time getting to grips with them. The key to understanding all three of the ‘view’ formats is to understand that the formatting and content are all bound up in a character string, and you need to understand how to encode and decode those strings. Once you have mastered that idea, the ‘view’ formats become – if not exactly easy – then at least understandable.
I wish that I could find a good, readable and comprehensible guide to programming OpenGL, as using it instead of the GDI, it is possible to get all manner of superb graphical effects. ClearWin+ can open drawing surfaces that use OpenGL, and so the option is there. Fortunately, it has never been essential in my work.
I have only ever owned one computer that had by default a large font setting, and that was a large screen Acer laptop. The problem with large font settings is that they subtly change the size of the character grid that ClearWin+ relies on for spacing controls. In my case, it messed up the spacing of icons for a toolbar and that caused me a lot of work to resolve. Occasionally, a different font size setting can also mess up alignments in quite simple dialog windows. It is always worth checking your program with at least 125% font size setting.
One thing that really annoyed me was that I had some pop-up dialogs that used no_frame, no_border, no_caption and were volatile. They also used drop_shadow (options in %ww). They looked great in Windows XP. But as Windows advanced from version to version, the drop shadow effect became progressively less pleasing, until I had to do away with it altogether.
Another thing that changes is the default font, and that affects the spacing in dialogs on occasion.
A subtle issue is that over the years, Windows has changed the default keyboard shortcuts for Cut, Copy and Paste, certainly since I learnt it with Windows 1! It is a matter that can still be managed by judicious use of ADD_ACCLERATOR@ etc, However, one of the reasons I stick to my preferred editor instead of using the now far better-developed and infinitely more helpful Plato, is that Plato doesn’t respond by default to the keyboard chords that I still use!15
The final (I hope!) issue lies in the appearance of applications. Up until Vista, a 3D appearance for toolbars etc was the norm, but afterwards, Microsoft moved towards a flat appearance. Once you have drawn several hundred icons in one style for toolbars and all the relevant options (up, down, selected, greyed) it is annoying to have to repeat the exercise just to keep your apps looking up to date. Personally, I preferred the 3D styles. However, be prepared to have a lot of hard work simply dashed by a change of image at Windows’ home. (See Figures 10.6 and 10.7 for examples of older styles).
Some of the examples illustrated in the online help files were created with earlier than current versions of Windows, and you will find this subtle annoyance in your own Help documentation.
Footnotes:
15. PLATO is, of course, configurable to respond pretty much however you want. I do most of my work on my desktop and only rarely on my laptop.
Both installations need to be user-configured the same way if it isn’t to drive you crazy! I recommend that you use PLATO,
and dismiss my preference as simply that of an old dog who can’t (or won’t) learn new tricks. The configurability of PLATO means that you can cope with whatever Microsoft throws at us in the future.
FORTRAN and the ART of Windows Programming, Copyright © Eddie Bromhead, 2023.