Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-10

TControl.IsParentShowHint

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Hans-Peter Diettrich

This method looks as if it could be removed. A property ParentShowHint exists already, which does exactly the same.

DoDi

Reply by email

zeljko
to Hans-Peter Diettrich
Hans-Peter Diettrich wrote
This method looks as if it could be removed. A property ParentShowHint exists already, which does exactly the same.

This method is added because code from application.inc must access parentshowhint from TControl, but it's protected there, so IsParentShowHint is introduced. Look at issue http://bugs.freepascal.org/view.php?id=20518 . While application calculating if hint should be shown or not it must take ParentShowHint into account, otherwise you'll get next: 1.Form with 1 button.
2.Form.ShowHint = True
3.Button.ShowHint = False, Button.ParentShowHint = False 4.You'll get form hint over button.

I agree that it can be removed if other solution is proposed to work correct (or if latest Juha patches are correct and that function isn't used). I didn't want to change visibility of ParentShowHint in TControl, so added IsParentShowHint.

zeljko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111026/7952e8f4/attachment.html>

Reply by email

Juha Manninen
to zeljko

2011/10/26 zeljko

Show quoted text 8 lines
** I agree that it can be removed if other solution is proposed to work correct (or if latest Juha patches are correct and that function isn't used). I didn't want to change visibility of ParentShowHint in TControl, so added IsParentShowHint.

IsParentShowHint is still used after my changes, in function GetHintControl. The correctness of the changes can be debated on dev-list (or here as well).

In fact I wanted to ask you why not change the visibility of ParentShowHint instead of creating a new function?
I think that is what DoDi meant.

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111026/aa935f04/attachment.html>

Reply by email

Hans-Peter Diettrich
to zeljko: This method is added because code from application.inc must access parentshowhint from…
Show quoted text 10 lines
On Wednesday 26 of October 2011 03:35:31 Hans-Peter Diettrich wrote: > This method looks as if it could be removed. A property ParentShowHint > exists already, which does exactly the same. This method is added because code from application.inc must access parentshowhint from TControl, but it's protected there, so IsParentShowHint is introduced.

Okay so far, I missed the different visibility.

BTW such problems make it impossible to implement another (Delphi compatible) DragManager :-(

I didn't want to change visibility of ParentShowHint in TControl, so added IsParentShowHint.

Why not implement it as just another property?

   public property IsParentShowHint read FParentShowHint;

DoDi

Reply by email