clInfoBk colour in Windows lazarus / 21-General ---------------------------------------------------------------------- petevick · 2024-11-16 09:22 In Linux Mint applying clInfoBk to a control gives the correct colour for the system hint tip background colour. In Object Inspector the correct colour is displayed for clInfoBk. In Windows 10 applying clInfoBk to a control gives the incorrect colour, even though in Object Inspector the correct colour is displayed for clInfoBk, what is displayed is a light yellow colour. What's going on in Windows?, is clInfoBk simply not a reliable method for getting the system hint tip background colour?, it seems doubtful as the Object Inspector clearly displays the correct system colour. I can only conclude that clInfoBk is being overridden somewhere along the way. ---------------------------------------------------------------------- zeljko · 2024-11-16 09:31 What do you get by calling LCLIntf.GetSystemColor(COLOR_INFOBK) ? ---------------------------------------------------------------------- wp · 2024-11-16 09:33 Quote from: petevick on November 16, 2024, 10:22:06 amIn Windows 10 applying clInfoBk to a control gives the incorrect colour, even though in Object Inspector the correct colour is displayed for clInfoBk, what is displayed is a light yellow colour. What color is displayed then? Which control? (Maybe the color cannot be changed at all in Windows for this particular control) ---------------------------------------------------------------------- petevick · 2024-11-16 09:36 Quote from: zeljko on November 16, 2024, 10:31:07 amWhat do you get by calling LCLIntf.GetSystemColor(COLOR_INFOBK) ? LCLIntf.GetSystemColor(COLOR_INFOBK) gave an error, but LCLIntf.GetSysColor(COLOR_INFOBK) worked but gave the same incorrect resulting colour. edit - it also gives the incorrect colour in Linux ---------------------------------------------------------------------- petevick · 2024-11-16 09:41 Quote from: wp on November 16, 2024, 10:33:10 amQuote from: petevick on November 16, 2024, 10:22:06 amIn Windows 10 applying clInfoBk to a control gives the incorrect colour, even though in Object Inspector the correct colour is displayed for clInfoBk, what is displayed is a light yellow colour. What color is displayed then? Which control? (Maybe the color cannot be changed at all in Windows for this particular control) I'm using a TPanel for testing purposes, and as stated, the colour displayed is light yellow. ---------------------------------------------------------------------- TRon · 2024-11-16 09:45 What is the hintcolor set in TAppplicationProperties ? ---------------------------------------------------------------------- petevick · 2024-11-16 09:54 Quote from: TRon on November 16, 2024, 10:45:22 amWhat is the hintcolor set in TAppplicationProperties ? Same result as before, correct in Linux and incorrect in Windows 10. The HintColor property for is TAppplicationProperties -2147483624 ---------------------------------------------------------------------- TRon · 2024-11-16 09:58 In that case it looks like zeljko's hunch is correct. Just to make sure, not by any chance compiling for gtk or qt ? ---------------------------------------------------------------------- wp · 2024-11-16 09:59 Quote from: petevick on November 16, 2024, 10:41:48 amI'm using a TPanel for testing purposes, and as stated, the colour displayed is light yellow. Now you completely lost me. clInfoBk *is* light yellow on Windows. Which color did you expect? ---------------------------------------------------------------------- petevick · 2024-11-16 10:02 Quote from: wp on November 16, 2024, 10:59:22 amQuote from: petevick on November 16, 2024, 10:41:48 amI'm using a TPanel for testing purposes, and as stated, the colour displayed is light yellow. Now you completely lost me. clInfoBk *is* light yellow on Windows. Which color did you expect? Not in my Windows it isn't, it's a white background with black text, I'm assuming set by Themes. ---------------------------------------------------------------------- wp · 2024-11-16 10:04 Quote from: petevick on November 16, 2024, 10:54:40 amThe HintColor property for is TAppplicationProperties -2147483624 I don't understand this sentence... Anyway: -2147483624 in hex is $800018, and this is what clInfoBk is. But: clInfoBk is a system color, its bytes do not represent the rgb values. In order to get these you must apply the ColorToRGB function. And ColorToRGB(clInfoBk), in hex again, is $E1FFFF, a pale yellow. ---------------------------------------------------------------------- petevick · 2024-11-16 10:05 Quote from: TRon on November 16, 2024, 10:58:47 amIn that case it looks like zeljko's hunch is correct. Just to make sure, not by any chance compiling for gtk or qt ? I'm compiling for gtk in Linux, but the issue is in Windows which I use all default settings but compile for Win32 ---------------------------------------------------------------------- petevick · 2024-11-16 10:08 Quote from: wp on November 16, 2024, 11:04:57 amQuote from: petevick on November 16, 2024, 10:54:40 amThe HintColor property for is TAppplicationProperties -2147483624 I don't understand this sentence... Anyway: -2147483624 in hex is $800018, and this is what clInfoBk is. But: clInfoBk is a system color, its bytes do not represent the rgb values. In order to get these you must apply the ColorToRGB function. And ColorToRGB(clInfoBk), in hex again, is $E1FFFF, a pale yellow. That's as maybe, but all the hint tips in every windows app I've looked at are white background with black text ---------------------------------------------------------------------- TRon · 2024-11-16 10:12 We can end the miscommunication in one small example: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i // at your form creation event:  Application.HintColor:= clRed;  Application.ShowHint := true;  Form1.ShowHint:=true;  Panel1.ShowHint:=true;  and don't forget to also set the hint texts for both form and panel. Does that show a hint with a red background ? edit: If that works then for sure things are working as intended. Then we can discuss what the colour of clInfoBk should actually be. ---------------------------------------------------------------------- petevick · 2024-11-16 10:41 Quote from: TRon on November 16, 2024, 11:12:37 amWe can end the miscommunication in one small example: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i // at your form creation event:  Application.HintColor:= clRed;  Application.ShowHint := true;  Form1.ShowHint:=true;  Panel1.ShowHint:=true; and don't forget to also set the hint texts for both form and panel. Does that show a hint with a red background ? edit: If that works then for sure things are working as intended. Then we can discuss what the colour of clInfoBk should actually be. Yes it does. ---------------------------------------------------------------------- TRon · 2024-11-16 11:34 So... having had a quick look. For windows 10 you can't seem to set this color (infowindow aka clInfoBk) other than by means of the registry. That seem to imply that for windows 10 clInfoBk is not a reliable color to depend on (ms itself list this color as being present up til windows 7). it seems related to theming manifest where these kind if things are suppose to be defined. Not being windows minded anymore, someone more knowledgeable should have a closer look (can't test myself). The only thing I am pretty sure of is that it always used to be the light yellow colour but can imagine that if ms does not support that anymore that current applications use another default system colour for tooltips. ---------------------------------------------------------------------- cdbc · 2024-11-16 11:53 Hi I think, that because people are leaning against darker themes, this yellowish, kinda screams loud... ...But you can define your own:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i const BackGroundYellow = $0080FFFF;I used it for the longest time, too  Regards Benny ---------------------------------------------------------------------- petevick · 2024-11-16 11:54 Quote from: TRon on November 16, 2024, 12:34:29 pmSo... having had a quick look. For windows 10 you can't seem to set this color (infowindow aka clInfoBk) other than by means of the registry. That seem to imply that for windows 10 clInfoBk is not a reliable color to depend on (ms itself list this color as being present up til windows 7). Not being windows minded anymore, someone more knowledgeable should have a closer look (can't test myself). The only thing I am pretty sure of is that it always used to be the light yellow colour but can imagine that if ms does not support that anymore that current applications use another default system colour for tooltips. Thanks for taking the time to look. Your reply is pretty much my conclusion. I also tried it in Win7 and had the same incorrect results. I also agree with you that hint backgrounds always used to be a light yellow colour. I personally hate Windows which is why I use Linux day to day. ---------------------------------------------------------------------- TRon · 2024-11-16 11:59 @cdbc: Yes, that is a solution but I fear that petevick would like to have a theme reliable color so that the colour of the hints will always match the user's chosen theme. ---------------------------------------------------------------------- petevick · 2024-11-16 12:00 Quote from: TRon on November 16, 2024, 12:59:23 pm@cdbc: Yes, that is a solution but I fear that petevick would like to have a theme reliable color so that the colour of the hints will always match the user's chosen theme. Your fear is well founded ---------------------------------------------------------------------- zeljko · 2024-11-16 12:02 Quote from: petevick on November 16, 2024, 10:36:39 amQuote from: zeljko on November 16, 2024, 10:31:07 amWhat do you get by calling LCLIntf.GetSystemColor(COLOR_INFOBK) ? LCLIntf.GetSystemColor(COLOR_INFOBK) gave an error, but LCLIntf.GetSysColor(COLOR_INFOBK) worked but gave the same incorrect resulting colour. edit - it also gives the incorrect colour in Linux Sorry for error, I've typed from head, it's strange that it returns wrong syscolor, maybe it's not syscolor at all but some kind of brush ? ---------------------------------------------------------------------- wp · 2024-11-16 12:39 Quote from: petevick on November 16, 2024, 12:54:56 pmI also tried it in Win7 and had the same incorrect results. OK, this is an important information. I still have Win 7 on a VM and can verify this: the popup hints have a white, grayish background although clInfoBk is the standard pale yellow color. Scanning the sources of THintWindow in unit Forms shows me a (protected) boolean function THintWindow.UseBGThemes. Making this return false results in the yellow hint background even on Win 7: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  TMyHintWindow = class(THintWindow)  public    function UseBGThemes: Boolean; override;  end;  function TMyHintWindow.UseBGThemes: Boolean;begin  Result := false;end; { TForm1 } procedure TForm1.FormCreate(Sender: TObject);begin  HintWindowClass := TMyHintWindow;end; ---------------------------------------------------------------------- petevick · 2024-11-16 15:44 Quote from: wp on November 16, 2024, 01:39:04 pmQuote from: petevick on November 16, 2024, 12:54:56 pmI also tried it in Win7 and had the same incorrect results. OK, this is an important information. I still have Win 7 on a VM and can verify this: the popup hints have a white, grayish background although clInfoBk is the standard pale yellow color. Scanning the sources of THintWindow in unit Forms shows me a (protected) boolean function THintWindow.UseBGThemes. Making this return false results in the yellow hint background even on Win 7: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  TMyHintWindow = class(THintWindow)  public    function UseBGThemes: Boolean; override;  end;  function TMyHintWindow.UseBGThemes: Boolean;begin  Result := false;end; { TForm1 } procedure TForm1.FormCreate(Sender: TObject);begin  HintWindowClass := TMyHintWindow;end; This sounds like Microsoft have shifted the goalposts for acceptable GUI design to suit their own agenda. I also don't understand why the textual properties of hint tips are accessed via Screen.HintFont but there is no background colour equivalent like Screen.HintBk for example, maybe that's too obvious.