From 78c08bdc4d5637ace9b85014da8d41f2d56d1c74 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Wed, 30 Nov 2016 15:55:47 +0000 Subject: [PATCH] jvcllaz: Fix NavigationPane painting issues at runtime in JnNavPaneDemo (still issues at designtime). git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5396 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/jvcllaz/run/JvNavigationPane.pas | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/jvcllaz/run/JvNavigationPane.pas b/components/jvcllaz/run/JvNavigationPane.pas index ae8e10f08..8b457946e 100644 --- a/components/jvcllaz/run/JvNavigationPane.pas +++ b/components/jvcllaz/run/JvNavigationPane.pas @@ -1852,6 +1852,10 @@ end; procedure TJvCustomNavigationPane.WMEraseBkgnd(var Msg: TLMEraseBkgnd); begin + exit; + // wp: the following code causes massive painting issues. + + // DEV: Doesn't clear, remove if... //if ActivePage = nil then begin @@ -2397,6 +2401,7 @@ begin ACanvas.Font := Font; SetBkMode(ACanvas.Handle, TRANSPARENT); DrawText(ACanvas, Caption, Length(Caption), R, DT_SINGLELINE or DT_VCENTER); + SetBkMode(ACanvas.Handle, OPAQUE); end; if Colors.ButtonSeparatorColor <> clNone then begin @@ -3527,6 +3532,7 @@ begin OffsetRect(R, 0, -Images.Height div 2); DrawText(Canvas, Caption, Length(Caption), R, cAlignment[Alignment] or cWordWrap[WordWrap] or DT_VCENTER or DT_NOPREFIX or DT_END_ELLIPSIS); + SetBkMode(Canvas.Handle, OPAQUE); end; if IsValidImage then begin @@ -3768,6 +3774,7 @@ begin SetBkMode(Canvas.Handle, TRANSPARENT); DrawText(Canvas, Caption, Length(Caption), R, DT_SINGLELINE or DT_VCENTER or DT_NOPREFIX or DT_EDITCONTROL or cAlignment[Alignment]); + SetBkMode(Canvas.Handle, OPAQUE); end; Canvas.Pen.Color := FrameColor; Canvas.MoveTo(0, ClientHeight - 1); @@ -4911,6 +4918,7 @@ DrawButton: DrawText(Canvas, Caption, Length(Caption), R, DT_LEFT or DT_VCENTER or DT_NOPREFIX or DT_END_ELLIPSIS); Inc(R.Right, 3 + 7); InflateRect(R, 2, 0); + SetBkMode(Canvas.Handle, OPAQUE); end; R.Left := R.Right - 11; Dec(R.Right, 4);