TsCheckListBox uses wrong font for Header

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #68863
    HeDiBo
    Participant

    This is a very old bug. I hit upon it just recently.
    If an item in a TsCheckListBox is marked as a Header, the font is wrong (default Tahoma 8 pt), That’s because the line is written from a TBitmap in which the Canvas.Font property was not initialized.
    The following code fixes this:

    Module sChackListBox, line 461:

    
    (******* Preserve Font Info *********************) (** DB **)
    bmp.Canvas.Font.Assign(Font);                      (** DB **)
    (************************************************) (** DB **)
    
    if (HeaderSkin <> '') and SkinData.Skinned then begin
    .
    .

    While you’re at it, it might be a nice addition to introduce a HeaderFont property, to enable, for instance, italic text in headers.

    • This topic was modified 4 years, 6 months ago by HeDiBo.
    • This topic was modified 4 years, 6 months ago by HeDiBo.
    #68881
    Support
    Keymaster

    Thank you, this code will be added in the nearest release.

    #68883
    HeDiBo
    Participant

    Can you also add a bit of code to change the Header font?

    #68885
    Support
    Keymaster

    I will think which properties should be added.
    If the HeaderFont property exists, but not used by developer then it should be synchronized with standard Font property after each Font changing. If Font property is changed then HeaderFont should be changed too? Need to think.

    #69011
    HeDiBo
    Participant

    Just add a property ParentHeaderFont, which works the same as the general ParentFont property. If true, the HeaderFont is the same as the Font of the TsCheckListBox and changes with changes in it. If false, HeaderFont maintains its own settings. Upon creation the ParentHeaderFont property is initialized to True.

    #69462
    HeDiBo
    Participant

    You did a good job in the HeaderFont area. Thank you. 🎶
    You can close this topic now.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘TsCheckListBox uses wrong font for Header’ is closed to new replies.