Question about Hints lazarus / 31-LCL ---------------------------------------------------------------------- Blaazen · 2011-10-18 19:30 Is it normal that hint of Form is displayed on the component? How to reproduce: 1) Form: set any text to hint and set ShowHint to True. 2) Place some component on Form and set both its propertis ShowHint and ParentShowHint to False. Now Run it and hover the component. Here (Linux+Qt) is parent's hint displayed. ---------------------------------------------------------------------- Shebuka · 2011-10-19 07:45 Same here on Mac OS X, worser, if i set ShowHint and ParentShowHint of Component to True, no hit is shown... missing some 'not'? ---------------------------------------------------------------------- Blaazen · 2011-10-19 11:04 Quoteif i set ShowHint and ParentShowHint of Component to True, no hit is shown... In this case should be displayed Hint of component, not Hint of parent (Form, in this case). This works here. Can someone test the case from the first post in Delphi ? ---------------------------------------------------------------------- Bart · 2011-10-19 11:56 Delphi 3 Form1 with Button1 Form1.ShowHint = True, Button1.ShowHint = False, ParentShowHint = False -> Proper hint on Form, No hint on button Form1.ShowHint = True, Button1.ShowHint = True, ParentShowHint = False -> Proper hint on Form, Proper Hint on button Form1.ShowHint = False, Button1.ShowHint = True, ParentShowHint = False -> No hint on Form, Proper Hint on button Basically as expected. Bart ---------------------------------------------------------------------- Blaazen · 2011-10-19 13:44 Thanks. I reported as 20518: http://bugs.freepascal.org/view.php?id=20518 ---------------------------------------------------------------------- Shebuka · 2011-10-19 13:50 Quote from: Blaazen on October 19, 2011, 01:04:29 pmQuoteif i set ShowHint and ParentShowHint of Component to True, no hit is shown... In this case should be displayed Hint of component, not Hint of parent (Form, in this case). This works here. No, in this case it should display the hint of parent (form) because ParentShowHint is true. ---------------------------------------------------------------------- Blaazen · 2011-10-19 14:06 QuoteNo, in this case it should display the hint of parent (form) because ParentShowHint is true.AFAIK no. See: http://docwiki.embarcadero.com/VCL/en/Controls.TControl.ParentShowHint ParentShowHint does not affect what Hint will be displayed. It only says if component reads its own ShowHint or Parent's ShowHint. Component should never show parent's Hint. ---------------------------------------------------------------------- Shebuka · 2011-10-19 14:47 Quote from: Blaazen on October 19, 2011, 04:06:40 pmQuoteNo, in this case it should display the hint of parent (form) because ParentShowHint is true.AFAIK no. See: http://docwiki.embarcadero.com/VCL/en/Controls.TControl.ParentShowHint ParentShowHint does not affect what Hint will be displayed. It only says if component reads its own ShowHint or Parent's ShowHint. Component should never show parent's Hint. Are we reading same ref.? "If ParentShowHint is True, the control uses the ShowHint property value of its parent." for me this states that it must show the hint of parent, that is form, but it shows hint of Component... The fact is that i can actually set them both to True... "set the ShowHint property for those controls that should have Help Hints to True, and ParentShowHint becomes False automatically." If ShowHint is True, ParentShowHint must became False automatically. If ParentShowHint is True, ShowHint must became False automatically. ---------------------------------------------------------------------- Blaazen · 2011-10-19 15:02 Quote "If ParentShowHint is True, the control uses the ShowHint property value of its parent." for me this states that it must show the hint of parent, that is formNo, component only uses ShowHint property of its parent to decide whether display its own Hint or not. Quoteset the ShowHint property for those controls that should have Help Hints to True, and ParentShowHint becomes False automaticallyIn Lazarus, when I set ParentShowHint to True then ShowHint is set to True automaticly and when I set ShowHint to False then ParentShowHint is set to False automaticly. So this seems be different to Delphi. Anyway, in Lazarus component displays parent's Hint when both ShowHint and ParentShowHint are False which is IMO bad and Bart confimed that this is different behaviour than Delphi has. It is what I bugreported. ---------------------------------------------------------------------- JuhaManninen · 2011-10-24 09:18 Quote from: Blaazen on October 19, 2011, 05:02:43 pmIn Lazarus, when I set ParentShowHint to True then ShowHint is set to True automaticly and when I set ShowHint to False then ParentShowHint is set to False automaticly. So this seems be different to Delphi. Anyway, in Lazarus component displays parent's Hint when both ShowHint and ParentShowHint are False which is IMO bad and Bart confimed that this is different behaviour than Delphi has. It is what I bugreported. Blaazen, I was testing #20518: "Component shows parent's Hint" and it works correctly for me. However, switching ParentShowHint and ShowHint values automatically when changing one of them seems wrong, as you noted. Can you please create another report for it? My own Delphi installation seems to be broken now so I can't verify the Delphi behavior. I will set the new report related to #20518. If it worked correctly in 0.9.30 then it gets high priority. Juha ---------------------------------------------------------------------- Blaazen · 2011-10-24 20:27 Juha, I still have this issue and I today confirmed also with Laz.+GTK2 r.33065. I have no Delphi, but reading this documentation: http://docwiki.embarcadero.com/VCL/en/Controls.TControl.ParentShowHint Quote...set the ShowHint property for those controls that should have Help Hints to True, and ParentShowHint becomes False automatically. Lazarus does not behave so. Instead, when I set ParentShowHint to True Lazarus sets automaticly ShowHint to True AND when I set ShowHint to False then Lazarus sets automaticly ParentShowHint ot False. So what should I report ? ---------------------------------------------------------------------- JuhaManninen · 2011-10-25 09:27 Quote from: Blaazen on October 24, 2011, 10:27:37 pmJuha, I still have this issue and I today confirmed also with Laz.+GTK2 r.33065. I have no Delphi, but reading this documentation: http://docwiki.embarcadero.com/VCL/en/Controls.TControl.ParentShowHint Quote...set the ShowHint property for those controls that should have Help Hints to True, and ParentShowHint becomes False automatically. Lazarus does not behave so. Instead, when I set ParentShowHint to True Lazarus sets automaticly ShowHint to True AND when I set ShowHint to False then Lazarus sets automaticly ParentShowHint ot False. So what should I report ? I try to fix it, no report is needed. I fixed the automatic selection logic at r33080. Now, what is the correct source for a hint text, when a control has ParentShowHint = True and both the control and its parent have a hint text? The parent has ShowHint = True. Now the text comes from the parent. The code looks many levels to find a parent with ShowHint = True. For example I have a form with Hint = 'This is a parent of all controls!' and ShowHint = True. There is a GroupBox wth ParentShowHint = True, and on the GroupBox there is a button with also ParentShowHint = True. Now the button shows: 'This is a parent of all controls!',  which does not look right. The button's own hint text is ignored. Could someone test how Delphi works in this case? My reinstalling Delphi 2009 didn't help. I tried installing Delphi XE2 demo version earlier and it screwed the system. Even Delphi 7 doesn't run on Win 7. I will try on Linux + Wine later. Juha ---------------------------------------------------------------------- Avishai · 2011-10-25 09:47 Mr. Manninen, I think you must install Delphi 7 in Root Directory for it to work in Win 7.  I have "C:\Borland" for Delphi 6 and it works.  When I put it in "C:\Program Files (x86)\Borland" I must Run as Administrator.  Maybe this is not the problem but it works for me. ---------------------------------------------------------------------- JuhaManninen · 2011-10-25 10:42 Thanks Avishai. I have Administrator rights here but, surprise, installing to "C:\Borland" helped! Windows still complains about incompatibility problems but it lets Delphi 7 to run. Now the hint text source is surely wrong after my change. The logic of setting both ShowHint and ParentShowHint to the same value was a way to show the control's own hint. Now I can see that Delphi 7 did it the same way! According to documentation they changed the behavior in later Delphi versions. Does someone have a recent Delphi version to verify it? Juha [Edit]: I fixed the hint text in r33082. Someone could still verify with a recent Delphi. ---------------------------------------------------------------------- Avishai · 2011-10-25 12:59 Mr. Manninen, I am happy that I could help you.  You have helped me so many times ---------------------------------------------------------------------- Blaazen · 2011-10-25 16:11 QuoteNow the text comes from the parent.It seems that Delphi do it too. I found this documentation http://docwiki.embarcadero.com/VCL/en/Controls.TControl.Hint Quote If a control has no Hint value specified, but its parent control does, the control uses the value of the parent control (as long as the control's ShowHint property is True). ---------------------------------------------------------------------- LuizAmérico · 2012-09-23 23:24 I reverted the changes in hint since the behavior of the original question was correct. I also fixed getting the parent hint text. More info in http://bugs.freepascal.org/view.php?id=20518