IdeIntf: don't explicitly free owned hint controls from HintWindow. Formatting.

git-svn-id: trunk@45825 -
This commit is contained in:
juha 2014-07-11 16:30:27 +00:00
parent 05f1b5f85f
commit e8c25a5a34

View File

@ -2194,8 +2194,7 @@ begin
Index := MouseToIndex(y,false); Index := MouseToIndex(y,false);
if (Index > -1) if (Index > -1)
and (not FShowingLongHint) and (not FShowingLongHint)
and ((FHintWindow=nil) or (not FHintWindow.Visible) and ((FHintWindow=nil) or (not FHintWindow.Visible) or (Index<>FHintIndex))
or (Index<>FHintIndex))
then begin then begin
FHintIndex:=Index; FHintIndex:=Index;
FShowingLongHint:=false; FShowingLongHint:=false;
@ -2204,12 +2203,12 @@ begin
begin begin
// Mouse is over property name... // Mouse is over property name...
fHint := fPropRow.Name; fHint := fPropRow.Name;
if InitHints and ((Canvas.TextWidth(fHint) + BorderWidth + GetTreeIconX(Index) + Indent) >= SplitterX) then if InitHints
and ((Canvas.TextWidth(fHint) + BorderWidth + GetTreeIconX(Index) + Indent) >= SplitterX) then
begin begin
fHintRect := FHintWindow.CalcHintRect(0,fHint,nil); fHintRect := FHintWindow.CalcHintRect(0,fHint,nil);
fPoint := ClientToScreen( fPoint := ClientToScreen(Point(BorderWidth+GetTreeIconX(Index)+Indent,
Point(BorderWidth+GetTreeIconX(Index)+Indent, fPropRow.Top - TopY-1));
fPropRow.Top - TopY-1));
MoveRect(fHintRect,fPoint.x,fPoint.y); MoveRect(fHintRect,fPoint.x,fPoint.y);
FHintWindow.ActivateHint(fHintRect,fHint); FHintWindow.ActivateHint(fHintRect,fHint);
end; end;
@ -2218,9 +2217,10 @@ begin
begin begin
// Mouse is over property value... // Mouse is over property value...
fHint := fPropRow.LastPaintedValue; fHint := fPropRow.LastPaintedValue;
if length(fHint) > 100 then fHint := copy(fHint, 1, 100) + '...'; if length(fHint) > 100 then
if (Canvas.TextWidth(fHint) > (ClientWidth - BorderWidth - SplitterX)) and fHint := copy(fHint, 1, 100) + '...';
InitHints then if InitHints
and (Canvas.TextWidth(fHint) > (ClientWidth - BorderWidth - SplitterX)) then
begin begin
fHintRect := FHintWindow.CalcHintRect(0,fHint,nil); fHintRect := FHintWindow.CalcHintRect(0,fHint,nil);
fpoint := ClientToScreen(Point(SplitterX, fPropRow.Top - TopY - 1)); fpoint := ClientToScreen(Point(SplitterX, fPropRow.Top - TopY - 1));
@ -3314,11 +3314,11 @@ end;
procedure TOICustomPropertyGrid.HideHint; procedure TOICustomPropertyGrid.HideHint;
begin begin
if FHintWindow = nil then Exit; if FHintWindow = nil then Exit;
FHintWindow.Visible := False;
FHintIndex := -1; FHintIndex := -1;
FShowingLongHint := False; FShowingLongHint := False;
while FHintWindow.ControlCount > 0 do FHintWindow.Visible := False;
FHintWindow.Controls[0].Free; Assert(FHintWindow.ControlCount <= 1,
'TOICustomPropertyGrid.HideHint: FHintWindow.ControlCount = '+IntToStr(FHintWindow.ControlCount));
end; end;
procedure TOICustomPropertyGrid.ValueControlMouseDown(Sender : TObject; procedure TOICustomPropertyGrid.ValueControlMouseDown(Sender : TObject;