mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 15:59:13 +02:00
LCL: TCanvas.DrawText: changing and restoring BKMode when Style.Opaque=false
git-svn-id: trunk@10766 -
This commit is contained in:
parent
e730abc793
commit
91e8c58c50
@ -12,7 +12,6 @@
|
|||||||
</General>
|
</General>
|
||||||
<PublishOptions>
|
<PublishOptions>
|
||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
<IgnoreBinaries Value="False"/>
|
|
||||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
</PublishOptions>
|
</PublishOptions>
|
||||||
|
@ -2533,7 +2533,7 @@ begin
|
|||||||
ExpandTabs := True;
|
ExpandTabs := True;
|
||||||
SystemFont := False;
|
SystemFont := False;
|
||||||
end;
|
end;
|
||||||
ACanvas.TextRect(ARect,ARect.Left+2,ARect.Top,GetName, Style);
|
ACanvas.TextRect(ARect,ARect.Left+2,ARect.Top,GetName,Style);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPropertyEditor.PropDrawValue(ACanvas:TCanvas; const ARect: TRect;
|
procedure TPropertyEditor.PropDrawValue(ACanvas:TCanvas; const ARect: TRect;
|
||||||
|
@ -1048,17 +1048,25 @@ begin
|
|||||||
InterSectClipRect(Self.Handle, Left, Top, Right, Bottom);
|
InterSectClipRect(Self.Handle, Left, Top, Right, Bottom);
|
||||||
Options := Options or DT_NOCLIP; // no clipping as we are handling it here
|
Options := Options or DT_NOCLIP; // no clipping as we are handling it here
|
||||||
end;
|
end;
|
||||||
|
|
||||||
If Style.Opaque then begin
|
if Style.Opaque then begin
|
||||||
RequiredState([csHandleValid, csBrushValid]);
|
RequiredState([csHandleValid, csBrushValid]);
|
||||||
FillRect(fRect);
|
FillRect(fRect);
|
||||||
|
end else begin
|
||||||
|
SetBkMode(FHandle, TRANSPARENT);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
If Style.SystemFont then
|
if Style.SystemFont then
|
||||||
SetTextColor(Self.Handle, Font.Color);
|
SetTextColor(Self.Handle, Font.Color);
|
||||||
//debugln('TCanvas.TextRect DRAW Text="',Text,'" ',dbgs(fRect));
|
//debugln('TCanvas.TextRect DRAW Text="',Text,'" ',dbgs(fRect));
|
||||||
DrawText(Self.Handle, pChar(Text), Length(Text), fRect, Options);
|
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 Style.Clipping then begin
|
||||||
if DCIndex <> -1 then
|
if DCIndex <> -1 then
|
||||||
RestoreDC(Self.Handle, DCIndex);
|
RestoreDC(Self.Handle, DCIndex);
|
||||||
|
Loading…
Reference in New Issue
Block a user