Silverfrost Forums

Welcome to our forums

Adding a pivot, perhaps dynamically?

7 May 2021 2:04 #27713

I have been toying with this for some time and am curious if someone has a solution.

Generally, I design my windows to fit a screen less than 80% of 1920x1080 using the windows scaling value of 100%. This allows some scaling, better display on 4K monitors, etc.

However, I am finding that some of my users (and myself) will have trouble with font size even on larger monitors. It is possible, using winclass@() to set the font and scaling for the window default, which should help some users. But, some of my windows may need to be scrolled to do so.

I can add horizontal and vertical scrollbars (%ch[hscrollbar,vscrollbar]). This does two things. It makes the window scrollable, which is nice, but adds additional size to the window to support the scroll bar, whether or not it is actually used which is not nice. So far, I have resisted using this technique for every window I create.

I do not know how other programs (such as Word or Excel, quicken, etc.) dynamically add/remove scrollbars to their windows. I know I am missing something here!

If what those programs do is not possible with ClearWin, is there a method by which the size of a child window can be determined before it is used by the parent in order to use the scrollbar options in the %ch window? Or, are there alternatives I should consider instead?

Always up for learning! Bill

7 May 2021 2:55 #27714

Bill

You can change the default font by calling winclass@. If you want users to have control of this then you could provide a dialog that asks the user to select a font size, save the result in an ini file or the registry and then prompt the user to restart the app (reading back the new font size).

There are two ways to use scrollbars. Sometimes they are built into the control that you are using. A Microsoft edit control is one exampe of this. You can see the behaviour in Notepad or in %re. Typically (at least in Notepad) the scrollbar is always present but goes grey when not needed.

In ClearWin+ you can use %vx and %hx to create scrollbars as independent controls. In theory at least you can then show/hide or create/destroy at will.

7 May 2021 9:50 #27716

Paul, thanks for the tips. I had been planning to use winclass@() as an option for my users, but to do so will require reworking the windows a bit, adding the scrollbars. I did it as an experiment with winclass@ font and sizing and was pleased to have the level of control, but then it became obvious I needed to incorporate scrollbars when the window became un-clickable, extending off the visible desktop!

So some more work!

Bill

Please login to reply.