From 804670921f9b08b1c2064b5957b4232ca56c913f Mon Sep 17 00:00:00 2001 From: lazarus Date: Fri, 30 Nov 2001 16:41:59 +0000 Subject: [PATCH] Improved hints with overlapping windows. Shane git-svn-id: trunk@469 - --- designer/designer.pp | 16 ++++++++++++++-- designer/objectinspector.pp | 13 ++++++++++++- ide/uniteditor.pp | 11 ++++++++++- lcl/interfaces/gtk/gtkcallback.inc | 5 ++++- 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/designer/designer.pp b/designer/designer.pp index 279d22b36c..315193d11e 100644 --- a/designer/designer.pp +++ b/designer/designer.pp @@ -1070,12 +1070,24 @@ var Control : TControl; Position : TPoint; BW : Integer; + Window : TWInControl; begin + FHintTimer.Enabled := False; + + Position := Mouse.CursorPos; + Window := FindLCLWindow(Position); + if not(Assigned(window)) then Exit; + + //get the parent until parent is nil + While Window.Parent <> nil do + Window := Window.Parent; + + if (window <> FCustomForm) then Exit; + BW := 0; if (FCustomForm is TForm) then BW := TForm(FCustomForm).BorderWidth; - FHintTimer.Enabled := False; - Position := Mouse.CursorPos; + if ((Position.X < (FCustomForm.LEft +BW)) or (Position.X > (FCustomForm.Left+FCustomForm.Width - BW)) or (Position.Y < FCustomForm.Top+22) or (Position.Y > (FCustomForm.Top+FCustomForm.Height - BW))) then Exit; Position := FCustomForm.ScreenToClient(Position); diff --git a/designer/objectinspector.pp b/designer/objectinspector.pp index 7967fa6777..a5a80775ce 100644 --- a/designer/objectinspector.pp +++ b/designer/objectinspector.pp @@ -1226,10 +1226,21 @@ var Index: integer; PointedRow:TOIpropertyGridRow; TypeKind : TTypeKind; + Window :TWinControl; begin FHintTimer.Enabled := False; + Position := Mouse.CursorPos; - if ( (FLastMouseMovePos.X <= 0) or (FLastMouseMOvePos.Y <= 0) + Window := FindLCLWindow(Position); + if not(Assigned(window)) then Exit; + + //get the parent until parent is nil + While Window.Parent <> nil do + Window := Window.Parent; + + if (window <> Self) then Exit; + + if ( (FLastMouseMovePos.X <= 0) or (FLastMouseMOvePos.Y <= 0) or (FLastMouseMovePos.X >= Width) or (FLastMouseMovePos.Y >= Height)) then Exit; diff --git a/ide/uniteditor.pp b/ide/uniteditor.pp index a861ee1a7a..dfa70710ce 100644 --- a/ide/uniteditor.pp +++ b/ide/uniteditor.pp @@ -2906,11 +2906,20 @@ var cPosition : TPoint; TextPosition : TPoint; SE : TSourceEditor; + WIndow : TWInControl; begin FHintTimer.Enabled := False; cPosition := Mouse.CursorPos; - + Window := FindLCLWindow(cPosition); + if not(Assigned(window)) then Exit; + + //get the parent until parent is nil + While Window.Parent <> nil do + Window := Window.Parent; + + if (window <> Self) then Exit; + cPosition := ScreenToClient(cPosition); //Check to see if we are in the windows bounds if ((cPosition.X <=EditorOpts.GutterWidth) or (cPosition.X >= Width) or (cPosition.Y <= 25) diff --git a/lcl/interfaces/gtk/gtkcallback.inc b/lcl/interfaces/gtk/gtkcallback.inc index 8046fa13fb..281f158720 100644 --- a/lcl/interfaces/gtk/gtkcallback.inc +++ b/lcl/interfaces/gtk/gtkcallback.inc @@ -465,7 +465,6 @@ begin Result := DeliverPostMessage(Data, MessE); end else begin - Writeln('LLastClick = ',FormatDateTime('hh:mm:ss:zz',LLastClick)); MessI.Keys := 0; case event^.Button of 1 : begin @@ -1466,6 +1465,10 @@ end; { ============================================================================= $Log$ + Revision 1.49 2001/11/30 16:41:59 lazarus + Improved hints with overlapping windows. + Shane + Revision 1.48 2001/11/29 18:41:27 lazarus Improved the double click. Shane