MessageDlg: text is hard to read with some skins

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #36135
    Jeremy©JTECH
    Participant

    When using the standard Vcl.Dialogs.MessageDlg function to display simple text dialog boxes, with certain skins (e.g. Black Box, Matrix) the text is very difficult to see or read.

    I've attached some screenshots so you can see what I mean.

    [attachment=6740:AlphaControls Dialogs.jpg]

    My development environment:

    • Windows 7

    • RAD Studio 2010

    • AlphaControls 8.52

    #51931
    Support
    Keymaster

    Hello!

    Why buttons are not skinned there? It's not a standard dialog? Could you send me a demo, please?

    #51950
    Jeremy©JTECH
    Participant
    'Support' wrote:

    Hello!

    Why buttons are not skinned there? It's not a standard dialog? Could you send me a demo, please?

    I've attached a demo, and I think I came across the source of the problem. The function I'm using to display text prompts is the Dialogs.MessageDlg method (part of the standard VCL library). Things seems to work fine when the TsSkinManager.SkinningRules property includes the srThirdParty option, but not when that option is off.

    I'm guessing the MessageDlg method is using some sort of custom dialog with TLabel components, and these labels aren't skinned properly unless the srThirdParty option is also set. The big problem with the srThirdParty option (and why we have it turned off) is it screws up like 95% of the frames in our software. When this is set, TLabel controls throughout the software (that we don't want skinned) end up being drawn with skin colors (see the green text in the attached screenshot).

    [attachment=6753:AC Screenshot 1.png]

    I see two main options here:

    A. Continue setting srThirdParty to false. Modify my text prompt class to use a compatible standard dialog (or perhaps a new dialog created by me) that will correctly display text using the current AC skin.

    B. Change srThirdParty setting to true. This is really only feasible if there's an easy way to fix the display problems that result (TLabel controls everywhere are now drawn with skin colors instead of the desired clWindowText).

    Maybe there are other options (changes in a future version of AC?), so I'll rely on you experts to help guide me.

    #51970
    Support
    Keymaster

    Hello. Thank you for the demo.

    A. You can try sMessageDlg function from sDialogs units (based on standard MessageBox).

    B. You can cancel a skinning of labels in the sSkinProvider.OnSkinItem event. Place TsSkinProvider to the form and add this line:

    if Item is TLabel then CanBeAdded := False;

    #52004
    Jeremy©JTECH
    Participant

    Both options sound like they would work, but A is definitely easier to implement. Fortunately in my project all the code for displaying prompts is centralized in one location, which made it really simple to use the sMessageDlg function.

    Anyway, thanks for your help as always! Kudos for already having skinned replacements for those standard dialog functions too! 🙄

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