From: Remko B. <rem...@us...> - 2005-04-23 15:05:21
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12224 Modified Files: JvBalloonHint.pas Log Message: Fix for bug reported in the newsgroup: JvBalloonHint.ActivateHintRect is not working (Constantine Yannakopoulos) Index: JvBalloonHint.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvBalloonHint.pas,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** JvBalloonHint.pas 17 Feb 2005 10:19:59 -0000 1.34 --- JvBalloonHint.pas 23 Apr 2005 15:05:09 -0000 1.35 *************** *** 1758,1761 **** --- 1758,1785 ---- end; + procedure BoundRect(var ARect: TRect; const BoundingRect: TRect); + begin + if BoundingRect.Left > ARect.Left then + begin + ARect.Right := ARect.Right + (BoundingRect.Left - ARect.Left); + ARect.Left := BoundingRect.Left; + end; + if BoundingRect.Top > ARect.Top then + begin + ARect.Bottom := ARect.Bottom + (BoundingRect.Top - ARect.Top); + ARect.Top := BoundingRect.Top; + end; + if BoundingRect.Right < ARect.Right then + begin + ARect.Left := ARect.Left - (ARect.Right - BoundingRect.Right); + ARect.Right := BoundingRect.Right; + end; + if BoundingRect.Bottom < ARect.Bottom then + begin + ARect.Top := ARect.Top - (ARect.Bottom - BoundingRect.Bottom); + ARect.Bottom := BoundingRect.Bottom; + end; + end; + procedure TJvBalloonWindowEx.InternalActivateHint(var Rect: TRect; const AHint: string); *************** *** 1788,1803 **** ParentWindow := 0; ! UpdateBoundsRect(Rect); ! UpdateRegion; ! UpdateBoundsRect(Rect); ! if Rect.Top + Height > Screen.DesktopHeight then ! Rect.Top := Screen.DesktopHeight - Height; ! if Rect.Left + Width > Screen.DesktopWidth then ! Rect.Left := Screen.DesktopWidth - Width; ! if Rect.Left < Screen.DesktopLeft then ! Rect.Left := Screen.DesktopLeft; ! if Rect.Bottom < Screen.DesktopTop then ! Rect.Bottom := Screen.DesktopTop; { Set the Z order of the balloon } --- 1812,1820 ---- ParentWindow := 0; ! BoundRect(Rect, Screen.DesktopRect); ! with Rect do ! SetBounds(Left, Top, Right-Left, Bottom-Top); ! UpdateRegion; { Set the Z order of the balloon } |