From 015ffbb0ef355995833a054487c92bb1062deac1 Mon Sep 17 00:00:00 2001 From: Iwbnwif Yiw Date: Sun, 3 Apr 2016 15:27:28 +0200 Subject: [PATCH] Make background of book controls in wxMSW be the same as parent This improves their appearance especially when they're used as children of wxNotebook, which uses a different background colour than plain wxPanel by default. This generalizes what was already done for wxChoicebook in 6cab632f (see #12503) to all book controls. Closes #16878. --- include/wx/bookctrl.h | 5 +++++ include/wx/choicebk.h | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/wx/bookctrl.h b/include/wx/bookctrl.h index 35d7bb45e9..0149ba4d94 100644 --- a/include/wx/bookctrl.h +++ b/include/wx/bookctrl.h @@ -311,6 +311,11 @@ protected: // Lay out controls virtual void DoSize(); + // It is better to make this control transparent so that by default the controls on + // its pages are on the same colour background as the rest of the window. If the user + // prefers a coloured background they can set the background colour on the page panel + virtual bool HasTransparentBackground() wxOVERRIDE { return true; } + // This method also invalidates the size of the controller and should be // called instead of just InvalidateBestSize() whenever pages are added or // removed as this also affects the controller diff --git a/include/wx/choicebk.h b/include/wx/choicebk.h index c56916f903..f32e8d3a0d 100644 --- a/include/wx/choicebk.h +++ b/include/wx/choicebk.h @@ -79,11 +79,6 @@ public: // returns the choice control wxChoice* GetChoiceCtrl() const { return (wxChoice*)m_bookctrl; } - // Override this to return true because the part of parent window - // background between our controlling wxChoice and the page area should - // show through. - virtual bool HasTransparentBackground() wxOVERRIDE { return true; } - protected: virtual void DoSetWindowVariant(wxWindowVariant variant) wxOVERRIDE;