tvplanit: Improved positioning of hint window for contact grid.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5203 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-09-23 13:29:12 +00:00
parent b46c6f5ab2
commit 9a553e8b08
3 changed files with 23 additions and 13 deletions

View File

@ -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

View File

@ -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

View File

@ -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);