lbOwnerDrawFixed listbox problem

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #58958
    Support
    Keymaster

      Thank you for the demo.

      This issue will be solved in the nearest release, I think.

      #58971
      JM-DG
      Participant
        'Support' wrote:

        Thank you for the demo.

        This issue will be solved in the nearest release, I think.

        sListBox.pas line +/-512 in procedure TsCustomListBox.WMPaint(var Message: TWMPaint)

        After a quick investigation, I think the problem is that a font always gets assigned to the canvas even when there is already one assigned.

        It seems like simply adding this condition does the trick.

        Code:
        if (assigned(Canvas.Font) = false) then
        Canvas.Font.Assign(Font);
        #58984
        JM-DG
        Participant

          o/

          There seems to still have an issue with the listbox on the latest version: 14.14.

          Code:
          Canvas.Font.OnChange := nil;

          doesn't seem to do the trick 100%.

          In the demo I provided, I believe the selected item is supposed to have a black font color (with the graphite skin, at least). See demo in first post.

          The selected item seems to lose its color on repaint.

          See gif.

          3c30e2c18bce3879e622254631325ad6.gif

          However,

          Code:
          if(Assigned(Canvas.Font) = false) then
          Canvas.Font.Assign(Font);

          seems to behave correctly.

          Also, while doing some other tests, I realised that I was losing my selection color (multiselect) when scrolling down to select more items & a repaint seem to paint back the background.

          See gif.

          ddd166c3228f22f383fb6cf7d63fe03d.gif

          Thank you for your time. 🙂

          #58990
          Support
          Keymaster

            I will check it soon.

            #59007
            Support
            Keymaster

              I have added your checking there, but it doesn't work.

              It's strange that this code did a trick on your side.

              “Assign(Font)” doesn't create a new TFont, this method just assigns font properties like Size, Color, etc..

              I will research more your demo.

              #59008
              JM-DG
              Participant
                'Support' wrote:

                I have added your checking there, but it doesn't work.

                It's strange that this code did a trick on your side.

                “Assign(Font)” doesn't create a new TFont, this method just assigns font properties like Size, Color, etc..

                I will research more your demo.

                Huh. Odd. Maybe my “fix” is more a hack which only works in Delphi 7? That's what I'm using.

                #59014
                Support
                Keymaster

                  Look the PM, I have sent you the patched file.

                Viewing 7 posts - 1 through 7 (of 7 total)
                • You must be logged in to reply to this topic.