Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Hint color

Hi,

Why the default color of TElMouseHint is clInfoBk, whereas all controls (like buttons), having hints, show it on the system default background (white in my case)? Isn't it a good idea to redefine the default color for TElMouseHint?

Thank you.

Comments

  • 8 Comments sorted by Votes Date Added
  • >> Isn't it a good idea to redefine the default color for TElMouseHint?<<
    clInfoBk is already a system defined color hints, so it would be not a good idea to change this default value (you are free to set any color you like, though).

  • >>clInfoBk is already a system defined color hints<<

    Then how you can explain the fact I described above? I never changed any theme settings, but all other your controls have white hint background. I.e.
    clInfoBk is definitely NOT a system default color. And this was my question.

    One way or another, but all other your controls get the hint bk color in some another way (just like all other controls in all apps in the OS). And the only component, which gets it in another way is just TElMouseHint. Why? Why not to set its background color in the same manner, as for all other control hints?

  • >>clInfoBk is definitely NOT a system default color<<
    I did not say it is a system default color. clInfoBK is a special system color usually used for hints (and other ElPack hints, e.g. with HTML support, work in the same way . Check e.g. TELHTMLHint).

    >>One way or another, but all other your controls get the hint bk color in some another way<<
    You mean standard hints which are drawn with system theme parts (in recent Delphi versions). 
    Hints are drawn either by VCL (see TApplication.*Hint* properties/Events/methods) or controls like TELHTMLHint or TBallonHint which intercept the VCL hint events (but they support e.g. usually no HTML or other advanced features). 

    TELMouseHint works furthermore differently, because you actually specify explicitly a control or container for which an hint should be active/displayed (and which follows then mouse movements in the boundaries of the control).
  • A simple question -- What is the most correct way to make TElMouseHint to be of theme color, as standrd hints?
    AFAIU you assign its color explicitly. What color should I use to be sure that my UI will look natively on any user system? I have in mind -- all controls (including TELMouseHint) will be of the same color.
  • >>What is the most correct way to make TElMouseHint to be of theme color, as standrd hints?<<
    There is no simple answer, because as mentioned above GetSysColor(COLOR_INFOBK); is the best simple color you can get (and is actually the color which is returned by default from the VCL (Application.HintColor). 
    Themed hints are usually painted with gradients (e.g. in Windows 7) and are dependend from the current system theme settings (or the current VCL Style, when enabled).
  • Posts: 0 Accepted Answer Vote Up0Vote Down
    Hi,

    the issue was fixed, using small hack. To determine back color of the hint, the component now draws the hint there part on the internal bitmap, and then calculates average color (of course, excluding some border).
  • Finally I've understood, that you just have no control on all your TElXXXX controls hint painting, as you only use the Windows theme engine to do it. The only component, where you can't do it, is the TElMouseHint, because it is the hint itself, but not a control with hint. This is the problem, and you've found a solution. That's good, and get all my respects!

    Bye!
Sign In or Register to comment.