Form Sizer
~~~~~~~~~~

An OmniDesk Utility
by Richard G. Hallas

Form Sizer gives information about template files. When writing desktop applications, it is useful to know how much memory to reserve for window definitions, but this information is difficult to work out. However, Form Sizer tells you exactly how much space is needed for both the windows themselves and the data they contain.

Dragging a template file into the Form Sizer window (or onto the icon bar icon) results in information being displayed on each window in the template file. This consists of the following:

(1) 'Global template block size' indicates the maximum size needed to hold any window in the file. Note that this is NOT the size of all the windows put together: rather, it is the size of the largest window in the file. The reason for this is that it is not usually necessary to retain window definitions once they have been created by your program. If you simply reserve enough space for the largest window definition, you can then use the same storage area for each window in turn as you create it, which is much more economical than loading all the windows at once.

(2) 'Total indirected data size' indicates the total size of all indirected data in all the windows. Note that this IS the total size of all indirected data in the file, since your program does need to retain this data.

(3) For each window in the file, the following information is displayed in the white area at the bottom of the window:
    (a) Window identifier;
    (b) Size of the window's definition;
    (c)	Size of the window's indirected data;
    so you can reserve memory on a window-by-window basis if you prefer.

The 'Dec/Hex' button will switch the Form Sizer display between decimal and hexadecimal numbers. This also affects the numeric contents of the template statistics file available from the save window.

Clicking Menu over the Form Sizer window presents the main utility menu:

'Info' leads to a standard information window.

'Clear statistics' will clear out any template file currently loaded, and release the memory it used.

'Window position' leads to a window which lets you determine where the Form Sizer window appears on the screen. This corresponds to an invisible grid, and when you change screen mode the window will snap to this grid. (This feature can be disabled by clicking Adjust on the small window icon, which makes it disappear.)

'Save statistics' lets you save out a text file of detailed information about the loaded templates. This includes all the information shown in the Form Sizer window, and in addition there is information about the type and contents of all the icons in each window.

'Save settings' will save the screen location of the Form Sizer window, along with the state of the 'Dec/Hex' button.
