mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 18:51:42 +02:00
customdrawnws: Adds background drawing for TPanel
git-svn-id: trunk@34026 -
This commit is contained in:
parent
c70c69b953
commit
8e8771651b
@ -12,7 +12,7 @@ uses
|
|||||||
IntfGraphics, lazcanvas, lazregions,
|
IntfGraphics, lazcanvas, lazregions,
|
||||||
// LCL
|
// LCL
|
||||||
GraphType, Controls, LCLMessageGlue, WSControls, LCLType, LCLProc,
|
GraphType, Controls, LCLMessageGlue, WSControls, LCLType, LCLProc,
|
||||||
Forms, Graphics, customdrawncontrols;
|
StdCtrls, ExtCtrls, Forms, Graphics, customdrawncontrols;
|
||||||
|
|
||||||
type
|
type
|
||||||
TUpdateLazImageFormat = (
|
TUpdateLazImageFormat = (
|
||||||
@ -309,10 +309,21 @@ begin
|
|||||||
ACanvas.SaveState;
|
ACanvas.SaveState;
|
||||||
ACanvas.ResetCanvasState;
|
ACanvas.ResetCanvasState;
|
||||||
|
|
||||||
|
// Special drawing for some native controls
|
||||||
|
if lWinControl is TCustomPanel then
|
||||||
|
begin
|
||||||
|
// Erase the background of TPanel controls, since it can draw it's own border, but fails to draw it's own background
|
||||||
|
ACanvas.Brush.FPColor := TColorToFPColor((lWinControl as TCustomPanel).GetRGBColorResolvingParent());
|
||||||
|
ACanvas.Pen.FPColor := ACanvas.Brush.FPColor;
|
||||||
|
ACanvas.Rectangle(Bounds(0, 0, lWinControl.Width, lWinControl.Height));
|
||||||
|
ACanvas.ResetCanvasState;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Send the drawing message
|
||||||
{$ifdef VerboseCDWinControl}
|
{$ifdef VerboseCDWinControl}
|
||||||
DebugLn(Format('[RenderChildWinControls] i=%d before LCLSendPaintMsg', [i]));
|
DebugLn(Format('[RenderChildWinControls] i=%d before LCLSendPaintMsg', [i]));
|
||||||
{$endif}
|
{$endif}
|
||||||
LCLSendPaintMsg(lCDWinControl.WinControl, struct.hdc, @struct);
|
LCLSendPaintMsg(lWinControl, struct.hdc, @struct);
|
||||||
|
|
||||||
// Now Draw all sub-controls
|
// Now Draw all sub-controls
|
||||||
if lCDWinControl.Children <> nil then
|
if lCDWinControl.Children <> nil then
|
||||||
|
Loading…
Reference in New Issue
Block a user