From fff0200dffbad703cbb81d101afcfe45bb4522e7 Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 24 Jan 2008 02:59:06 +0000 Subject: [PATCH] gtk: dont erase background of TCustomForm descendants git-svn-id: trunk@13851 - --- lcl/interfaces/gtk/gtkcallback.inc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/gtk/gtkcallback.inc b/lcl/interfaces/gtk/gtkcallback.inc index 4504a45a33..afea94a272 100644 --- a/lcl/interfaces/gtk/gtkcallback.inc +++ b/lcl/interfaces/gtk/gtkcallback.inc @@ -29,7 +29,17 @@ function DoDeliverPaintMessage(const Target: TObject; var PaintMsg: TLMPaint): PtrInt; begin - if (TObject(Target) is TCustomControl) and not (csOpaque in TWinControl(Target).ControlStyle) then + { + erase backgound of not csOpaque custom controls + + Attention - TCustomForm is also TCustomControl descendant - if we erase its + backgound then Form.Color will work, but under gtk1 form background will erase + subcontrols. For example checkboxes become unvisible. If this will be solved then + remove line "not (TObject(Target) is TCustomForm) and" from condition. + } + if (TObject(Target) is TCustomControl) and + not (TObject(Target) is TCustomForm) and + not (csOpaque in TWinControl(Target).ControlStyle) then begin Include(TWinControlAccess(Target).FWinControlFlags, wcfEraseBackground); TWinControl(Target).Perform(LM_ERASEBKGND, PaintMsg.DC, 0);