LCL: TCanvas.DrawText: changing and restoring BKMode when Style.Opaque=false

git-svn-id: trunk@10766 -
This commit is contained in:
mattias 2007-03-18 21:57:25 +00:00
parent e730abc793
commit 91e8c58c50
3 changed files with 12 additions and 5 deletions
examples/objectinspector
ideintf
lcl/include

View File

@ -12,7 +12,6 @@
</General>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>

View File

@ -2533,7 +2533,7 @@ begin
ExpandTabs := True;
SystemFont := False;
end;
ACanvas.TextRect(ARect,ARect.Left+2,ARect.Top,GetName, Style);
ACanvas.TextRect(ARect,ARect.Left+2,ARect.Top,GetName,Style);
end;
procedure TPropertyEditor.PropDrawValue(ACanvas:TCanvas; const ARect: TRect;

View File

@ -1048,17 +1048,25 @@ begin
InterSectClipRect(Self.Handle, Left, Top, Right, Bottom);
Options := Options or DT_NOCLIP; // no clipping as we are handling it here
end;
If Style.Opaque then begin
if Style.Opaque then begin
RequiredState([csHandleValid, csBrushValid]);
FillRect(fRect);
end else begin
SetBkMode(FHandle, TRANSPARENT);
end;
If Style.SystemFont then
if Style.SystemFont then
SetTextColor(Self.Handle, Font.Color);
//debugln('TCanvas.TextRect DRAW Text="',Text,'" ',dbgs(fRect));
DrawText(Self.Handle, pChar(Text), Length(Text), fRect, Options);
if Style.Opaque and (csBrushValid in FState) then begin
if Brush.Style=bsSolid then
// restore BKMode
SetBkMode(FHandle, OPAQUE)
end;
if Style.Clipping then begin
if DCIndex <> -1 then
RestoreDC(Self.Handle, DCIndex);