rzGroupBox 6.2.3: Caption doesn't scale with per-monitor DPI

Home Forums Konopka Signature VCL Controls (formerly Raize Components) rzGroupBox 6.2.3: Caption doesn't scale with per-monitor DPI

Viewing 8 reply threads
  • Author
    Posts
    • #1108
      Andreas Weidner
      Participant

        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

      • #1110
        Ray Konopka
        Keymaster

          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

        • #3091
          Vlad Tsikhotskyy
          Participant

            Is this issue fixed?

             

          • #3092
            Andreas Weidner
            Participant

              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

            • #3098
              Andreas Weidner
              Participant

                Well, sort of – other problems have occurred now:

                1. Yes, the RzGroupBox caption does scale correctly now.
                2. 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:
                3. 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:
                4. Moving the form back to the original screen makes the RzGroupBoxes complete lose their client areas:
                5. 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;
                6. Of course it would be nicer if the client positioning were done correctly out of the box…

                With best regards,
                Andreas Weidner

              • #3099
                Andreas Weidner
                Participant

                  I have now tried twice to reply here, but each time my reply is lost after clicking ‘Submit’…

                • #3100
                  Andreas Weidner
                  Participant

                    (Trying a fourth time, because the last reply was accepted)

                    Well, sort of – other problems have occurred now:

                    1. Yes, the RzGroupBox caption does scale correctly now.
                    2. 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:
                    3. 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:
                    4. Moving the form back to the original screen makes the RzGroupBoxes complete lose their client areas:
                    5. 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;
                    6. Of course it would be nicer if the client positioning were done correctly out of the box…

                    With best regards,
                    Andreas Weidner

                  • #3101
                    Andreas Weidner
                    Participant

                      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?

                    • #3119
                      Ray Konopka
                      Keymaster

                        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

                    Viewing 8 reply threads
                    • You must be logged in to reply to this topic.