Home › Forums › Konopka Signature VCL Controls (formerly Raize Components) › rzGroupBox 6.2.3: Caption doesn't scale with per-monitor DPI
- This topic has 8 replies, 3 voices, and was last updated 2022-06-15 at 9:59 pm by Ray Konopka.
-
AuthorPosts
-
-
February 18, 2019 at 3:14 pm #1108
On Windows 10 (32 bit), Delphi 10.3 Community Edition, KSVC 6.2.3 behaves as follows:
1. Put a TrzGroupBox onto a form and a label into the group box.
2. Run the program with ‘per monitor v2’ manifest on a system with 2 monitors and
different DPI settings on both.
3. Move the form from one monitor to the next at runtime to try the scaling. This either
works properly or not, depending on the caption settings:
4. If the group box was created with a caption font that is IDENTICAL to the group box
font, the group box’s caption is nicely scaled at runtime.
5. If the group box was created with a caption font that is DIFFERENT from the group box
font (independent of WHAT is different), NO scaling is EVER done at runtime.
6. If one now sets the caption font back to the group box font again (so that it contains
the same settings as in (4), NO scaling is EVER done at runtime.
7. This problem occurs ONLY for the automatic per-monitor scaling. MANUAL form scaling
(e.g., by adding a button that does ‘Form.ScaleBy(2,1);’) works nicely.
8. The label inside the group box is ALWAYS scaled nicely.
9. In order to scale the caption properly, it is necessary to manually write source code
like
PROCEDURE Form.FormAfterMonitorDpiChanged(Sender: TObject; OldDPI,NewDPI: Integer);
BEGIN
rzGroupBox.Caption.Font.Height:=MulDiv(rzGroupBox.Caption.Font.Height,NewDPI,
OldDPI)
END;
Unfortunately, this cannot decently check whether or not the scaling REALLY needs to
be done, because, as seen in (4) and (6), the exactly same font settings sometimes
require a manual scaling and sometimes not.It would be nice if the rzGroupBox caption would ALWAYS be correctly scaled on automatic per-monitor DPI changes.
With best regards,
Andreas Weidner -
February 18, 2019 at 11:08 pm #1110
Hi Andreas,
Yes, I absolutely agree that the control should operate correctly under HighDPI settings. I would strongly encourage you to report this issue to Embarcadero. I will continue to encourage Embarcadero to address issues like this, but it will help if endusers are also reporting the issues.
Ray
-
May 30, 2022 at 10:24 pm #3091
Is this issue fixed?
-
May 31, 2022 at 3:43 pm #3092
Sort of fixed, but not well:
1. The caption font size now DOES correctly scale.
2. Unfortunately, the client area of the rzGroupBox does NOT correctly scale, meaning
that after a rescale, it either overlaps the caption (scaling>1.0), making it
unreadable, or leaves empty space below the caption (scaling <1.0). This is
noticable if you, e.g., put an ugly red client-aligned panel inside the rzGroupBox
and move the form between monitors with different DPIs.
3. In the case of the above client-aligned panel, the remedy is to change its TOP
value. This sounds of course rather stupid and SHOULD not do anything, but it DOES
work and correct the position of the client contents:
PROCEDURE Form.FormAfterMonitorDpiChanged(Sender: TObject; OldDPI,NewDPI: Integer);
BEGIN
Panel1.Top:=Panel1.Top XOR 1
END;
4. Embarcadero’s TGroupBox can now also have a bold caption, and the client area is
always correctly scaled. Unfortunately, ONLY the client area is correctly scaled,
but the bold caption is NOT.With best regards,
Andreas Weidner -
June 4, 2022 at 1:00 pm #3098
Well, sort of – other problems have occurred now:
- Yes, the RzGroupBox caption does scale correctly now.
- But now its client area is scaled incorrectly, messing up the layout. To show this, I put an ugly red client-aligned panel inside, here with four differently styled group boxes:
- Moving this form to a 4K screen with 300% scaling makes the captions of the RzGroupBoxes unreadable, because the client-aligned panels overlap them. Embarcadero’s group boxes have correct client positioning, but screw up font size for bold captions:
- Moving the form back to the original screen makes the RzGroupBoxes complete lose their client areas:
- The messed-up client positioning in RzGroupBox can be easily corrected with the following (seemingly stupid) source code:
procedure TForm1.FormAfterMonitorDpiChanged(Sender: TObject; OldDPI,
NewDPI: Integer);
begin
RedPanel.Top:=ReadPanel.Top xor 1
end; - Of course it would be nicer if the client positioning were done correctly out of the box…
With best regards,
Andreas Weidner -
June 4, 2022 at 1:02 pm #3099
I have now tried twice to reply here, but each time my reply is lost after clicking ‘Submit’…
-
June 4, 2022 at 1:06 pm #3100
(Trying a fourth time, because the last reply was accepted)
Well, sort of – other problems have occurred now:
- Yes, the RzGroupBox caption does scale correctly now.
- But now its client area is scaled incorrectly, messing up the layout. To show this, I put an ugly red client-aligned panel inside, here with four differently styled group boxes:
- Moving this form to a 4K screen with 300% scaling makes the captions of the RzGroupBoxes unreadable, because the client-aligned panels overlap them. Embarcadero’s group boxes have correct client positioning, but screw up font size for bold captions:
- Moving the form back to the original screen makes the RzGroupBoxes complete lose their client areas:
- The messed-up client positioning in RzGroupBox can be easily corrected with the following (seemingly stupid) source code:
procedure TForm1.FormAfterMonitorDpiChanged(Sender: TObject; OldDPI,
NewDPI: Integer);
begin
RedPanel.Top:=ReadPanel.Top xor 1
end; - Of course it would be nicer if the client positioning were done correctly out of the box…
With best regards,
Andreas Weidner -
June 4, 2022 at 1:09 pm #3101
This is my fourth try: Every time I reply with any text longer than a paragraph, or even containing images, the reply vanishes. To which e-mail address can I send my repkly without losing it?
-
June 15, 2022 at 9:59 pm #3119
Hi Andreas,
I’m not sure what happened but some of your messages were marked as spam. I do not know why they were marked as spam. Regardless, I have removed the spam marker and your posts should now appear for everyone.Ray
-
-
AuthorPosts
- You must be logged in to reply to this topic.