I'm not particularly fond of on-the-fly font change (in a running app) causing a table window, and columns, to change size.
Is there a way to force the window and the columns to maintain their original sizes ?
- Founder/Site Admin
- Posts: 261
- Joined: 24 Feb 2017, 09:12
- Location: Gouda, The Netherlands
Form units of top level windows (forms/dialogs) are dependent on the used font. Or better said, it is related to the font metrics (overall width and height of the font).
The relationship is such that when the text displayed in a particular font type and size is fitting in a GUI object (like a button or datafield), it will be still fully displayed when the font metrics change.
This is done automaticaly by resizing the GUI object.
You can take advantage of this to create different GUI sizes for different resolutions. Just by changing the font on top level windows, the complete GUI is resized accordingly so that all texts keep fitting.
The complete form is resized.
You can also implement it such that a form does not change it's size, but the GUI objects do get resized. In that case, keep the form font settings the same and change the fonts of the child objects.
But that can lead into issues that child objects do not fit the form anymore.
Problem with child tables is that the columns and row heights are resized according to the font used. Changing the font changes the table size and the column/row sizes.
You are unable to set a different font without rows being automatically resized in height.
The only size you can programatically change is the column width. So, when you really need this, you can program that when you change the font of the table, first loop through all columns and get the widths.
THen set the font and then loop through the columns again to set the width back to the original size. But this might end up in texts not fitting anymore in the cells.
I must let it all percolate in me old sponge for a stretch.
For now, I've given users a small selection of font choices that work fine applied to child objects on forms.
I'm thinking I'll resize table windows back to original size after applying fonts.
Eventually, I'll allow "custom" choices for fonts, and in those cases apply those custom fonts to the windows and allow all objects concerned to resize themselves accordingly.
Something like that. Time for coffee...
Who is online
Users browsing this forum: Ccbot [Crawler] and 0 guests