IDE: clear hint string if using HTML

git-svn-id: trunk@31238 -
This commit is contained in:
mattias 2011-06-15 08:02:28 +00:00
parent 64f265173b
commit 7c49448b51
2 changed files with 11 additions and 6 deletions

View File

@ -115,7 +115,8 @@ type
procedure ReleaseStream(const URL: string); procedure ReleaseStream(const URL: string);
end; end;
{ TSimpleHTMLControl } { TSimpleHTMLControl
At the moment it is a TLabel that simply strips all tags }
TSimpleHTMLControl = class(TLabel,TIDEHTMLControlIntf) TSimpleHTMLControl = class(TLabel,TIDEHTMLControlIntf)
private private
@ -365,6 +366,7 @@ begin
end; end;
inc(EndPos); inc(EndPos);
end; end;
//debugln(['TSimpleHTMLControl.HTMLToCaption CurTagName=',CurTagName,' Tag="',copy(Result,p,EndPos-p),'"']);
if CurTagName='HTML' then if CurTagName='HTML' then
begin begin
@ -413,8 +415,10 @@ begin
end end
else else
NewTag:=''; NewTag:='';
if NewTag='' then if NewTag='' then begin
System.Delete(Result,p,EndPos-p) //debugln(['TSimpleHTMLControl.HTMLToCaption deleting tag ',copy(Result,p,EndPos-p)]);
System.Delete(Result,p,EndPos-p);
end
else begin else begin
Result:=copy(Result,1,p-1)+NewTag+copy(Result,EndPos,length(Result)); Result:=copy(Result,1,p-1)+NewTag+copy(Result,EndPos,length(Result));
inc(p,length(NewTag)); inc(p,length(NewTag));
@ -496,6 +500,7 @@ begin
if s<>'' then if s<>'' then
Stream.Read(s[1],length(s)); Stream.Read(s[1],length(s));
Caption:=HTMLToCaption(s,MaxLineCount); Caption:=HTMLToCaption(s,MaxLineCount);
debugln(['TSimpleHTMLControl.SetHTMLContent ',Caption]);
end; end;
procedure TSimpleHTMLControl.GetPreferredControlSize(out AWidth, AHeight: integer); procedure TSimpleHTMLControl.GetPreferredControlSize(out AWidth, AHeight: integer);
@ -1485,6 +1490,7 @@ begin
inc(NewHeight, 8); // border inc(NewHeight, 8); // border
HintWinRect := Rect(0, 0, NewWidth, NewHeight); HintWinRect := Rect(0, 0, NewWidth, NewHeight);
TheHint:='';
end else begin end else begin
HintWinRect := aHintWindow.CalcHintRect(Screen.Width, TheHint, nil); HintWinRect := aHintWindow.CalcHintRect(Screen.Width, TheHint, nil);
end; end;

View File

@ -3083,9 +3083,8 @@ begin
HintType := GetHintTypeAt(Index,Position.X); HintType := GetHintTypeAt(Index,Position.X);
if (HintType = pehName) and Assigned(OnPropertyHint) then if (HintType = pehName) and Assigned(OnPropertyHint) then
begin begin
if OnPropertyHint(Self, PointedRow, Position, FHintWindow, HintRect, AHint) and if OnPropertyHint(Self, PointedRow, Position, FHintWindow, HintRect, AHint)
(AHint <> '') then then begin
begin
FHintIndex := Index; FHintIndex := Index;
FShowingLongHint := True; FShowingLongHint := True;
//DebugLn(['TOICustomPropertyGrid.HintTimer ',dbgs(HintRect),' ',AHint,' ',dbgs(Position)]); //DebugLn(['TOICustomPropertyGrid.HintTimer ',dbgs(HintRect),' ',AHint,' ',dbgs(Position)]);