diff --git a/components/tvplanit/examples/fulldemo/demomain.lfm b/components/tvplanit/examples/fulldemo/demomain.lfm index b64962190..0b08b7b89 100644 --- a/components/tvplanit/examples/fulldemo/demomain.lfm +++ b/components/tvplanit/examples/fulldemo/demomain.lfm @@ -57,7 +57,7 @@ object MainForm: TMainForm Height = 528 Top = 48 Width = 834 - PageIndex = 0 + PageIndex = 2 Align = alClient TabOrder = 1 TabStop = True @@ -373,7 +373,7 @@ object MainForm: TMainForm object Contacts: TPage object VpContactButtonBar1: TVpContactButtonBar Left = 0 - Height = 532 + Height = 528 Top = 0 Width = 40 BorderWidth = 3 @@ -386,16 +386,16 @@ object MainForm: TMainForm end object VpContactGrid1: TVpContactGrid Left = 40 - Height = 532 + Height = 528 Top = 0 - Width = 813 + Width = 794 ControlLink = VpControlLink1 Color = clWindow Align = alClient TabStop = True TabOrder = 1 AllowInPlaceEditing = True - BarWidth = 3 + BarWidth = 1 BarColor = clSilver ColumnWidth = 200 ContactHeadAttributes.Color = clSilver diff --git a/components/tvplanit/source/vpcontactgrid.pas b/components/tvplanit/source/vpcontactgrid.pas index 6491c9a51..9d1565542 100644 --- a/components/tvplanit/source/vpcontactgrid.pas +++ b/components/tvplanit/source/vpcontactgrid.pas @@ -925,7 +925,7 @@ var txt: String; i: Integer; contact: TVpContact; - R: TRect; + R, RHint,RCont, RScr: TRect; begin if FHintMode = hmPlannerHint then begin @@ -943,9 +943,21 @@ begin // Build and show the hint window if FHintWindow = nil then FHintWindow := THintWindow.Create(nil); - APoint := ClientToScreen(APoint); - R := FHintWindow.CalcHintRect(MaxWidth, txt, nil); - OffsetRect(R, APoint.X - WidthOf(R), APoint.Y); + RScr := Screen.WorkAreaRect; + RCont.TopLeft := ClientToScreen(cgContactArray[AContactIndex].WholeRect.TopLeft); + RCont.BottomRight := ClientToScreen(cgContactArray[AContactIndex].WholeRect.BottomRight); + RHint := FHintWindow.CalcHintRect(MaxWidth, txt, nil); + R := RHint; + OffsetRect(R, RCont.Left - WidthOf(R), RCont.Top); + if R.Left < RScr.Left then begin + R := RHint; + OffsetRect(R, RCont.Right, RCont.Top); + end; + RHint := R; + if (R.Bottom > RScr.Bottom) then begin + R := RHint; + OffsetRect(R, 0, R.Bottom - RScr.Bottom); + end; FHintWindow.ActivateHint(R, txt); end else // Hide the hint window diff --git a/components/tvplanit/source/vpcontactgridpainter.pas b/components/tvplanit/source/vpcontactgridpainter.pas index 229528aa1..ee7aea645 100644 --- a/components/tvplanit/source/vpcontactgridpainter.pas +++ b/components/tvplanit/source/vpcontactgridpainter.pas @@ -1688,10 +1688,8 @@ begin ); TVpContactGridOpener(FContactGrid).cgBarArray[BarCount].Index := BarCount; for I := 1 to FContactGrid.BarWidth do begin - TPSMoveTo (RenderCanvas, Angle, RenderIn, - BarPos, RealTop + 2 + TextMargin * 2); - TPSLineTo (RenderCanvas, Angle, RenderIn, - BarPos, RealBottom - TextMargin * 2); + TPSMoveTo(RenderCanvas, Angle, RenderIn, BarPos, RealTop + 2 + TextMargin * 2); + TPSLineTo(RenderCanvas, Angle, RenderIn, BarPos, RealBottom - TextMargin * 2); Inc(BarPos); end; Inc(BarPos, RealColumnWidth);