1 (edited by papafrankc 2022-07-18 01:06:50)

Topic: TableGrid width

Hi All,

When doing some final testing of my program I've run into something strange.
-
I'm testing my program on 2 different PC's.  #1 - 1920 pixels wide and #2 - 1366 pixels wide.
-
My program was written and seems to work fine at 1920 pixels.
However when I test on a 1366 pixel PC the TableGrids do not adjust to the screen width.  They become quite wide.  The horizontal scroll bar does appear and I can see everything when I scroll left and right, but I don't understand why the TableGrids don't seem to change with my screen size?
-
I check for the screen size with this code:
...else if screen.Width = 1366 then
    begin
      vscale := 120;
    end

.
All of my forms on the 1366 PC fit OK on the screen.  It's just the TableGrids that don't seem to change with the forms.
.
UPDATE: I just noticed that the TableGrid box does change in size according to the size of the PC.  It seems that the individual cells in the TableGrid do not change according to the screen size.  I do see that if I use the vertical bars in between the cells to change the width of each cell, then I can make it all fit in the TableGrid box.  And everything seems to look OK.
-
So I'm thinking that I might just have to tell my users to use the vertical bars to adjust the cells to fit their screen??
-
Your comments will be appreciated as always.
-
Thanks
Frank

Re: TableGrid width

Hi Frank

Alternatively, you can enter the values of the width of the columns in the script,
depending on the width of the screen. For columns containing a Date or a sequence
of up to 10 digits (as an example), leave auto-width. For text columns, set the values in the script.
You can try to enable line wrapping in the most necessary text cells of the table and auto line height.
In some cases, you can turn off the visibility of some currently unnecessary columns using
the CheckBox on the form and turn it on if necessary.

Re: TableGrid width

AHoy Frank, Hi Sparrow,
Seems like we've been here before and never really cracked it.
I don't know why the tablegrids don't get scaled in the same way as other components but it is what it is and is unlikely to change.
I was wondering if you could take a more data-driven approach, specifically to address the tablegrids (please see attached).
1.  Use a standalone table to hold monitor sizes.
2.  When the application starts, get the monitor width, check the monitorsizes table and get the appropriate monitor factor.
3.  Resize the tablegrid(s) by the appropriate factor.
Big advantage to this approach is probably that it caters for any monitor resolution you throw at it without having to go into the code - just add a new line in the monitorsize table. 
The other benefit is that you should be able to see the different effects even if you've only got one monitor to test it on - LOL!
Setting the monitor factor to the correct value might be a bit 'trial and error' but I guess you've already been down that road anyway.
Hope this gives you some ideas.
Derek.

Post's attachments

Attachment icon frank width.zip 338.06 kb, 145 downloads since 2022-07-18 

Re: TableGrid width

Hi Derek,

Yes Derek you are right too. And Frank needs to find the best option for himself.
Yes, all this is true, but the size of the width of the cells still needs to be adjusted.
Depending on the resulting scaling factor, both the sizes and the font will change.
Initially, in development, I use the minimum screen resolution that I expect.
To increase is not to decrease.
A separate issue other than resolution is the magnification scale in Windows.
Here the problems are still growing. The one who makes the program counts on
the maximum information in the table on the screen. In fact, some columns can
be either hidden or reduced. And if you can fit everything in a small volume, then
in a large resolution this will no longer be a problem.
So start small. )
Unfortunately, there is no universal tool for scaling. But in my opinion, if you start
with a smaller resolution, then for a larger one everything is easier to solve.