mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 07:42:33 +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,
|
||||
// LCL
|
||||
GraphType, Controls, LCLMessageGlue, WSControls, LCLType, LCLProc,
|
||||
Forms, Graphics, customdrawncontrols;
|
||||
StdCtrls, ExtCtrls, Forms, Graphics, customdrawncontrols;
|
||||
|
||||
type
|
||||
TUpdateLazImageFormat = (
|
||||
@ -309,10 +309,21 @@ begin
|
||||
ACanvas.SaveState;
|
||||
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}
|
||||
DebugLn(Format('[RenderChildWinControls] i=%d before LCLSendPaintMsg', [i]));
|
||||
{$endif}
|
||||
LCLSendPaintMsg(lCDWinControl.WinControl, struct.hdc, @struct);
|
||||
LCLSendPaintMsg(lWinControl, struct.hdc, @struct);
|
||||
|
||||
// Now Draw all sub-controls
|
||||
if lCDWinControl.Children <> nil then
|
||||
|
Loading…
Reference in New Issue
Block a user