Inherit notebook background recursively under wxMSW.

With MSWSetTransparentBackground() hack only the panel which was the immediate
child of wxNotebook (i.e. its page) inherited the notebook background but not
its children. This resulted in jarring background discontinuities when nested
panels were used.

Fix this by inheriting notebook background in all child panels by testing for
the return value of the parents MSWHasInheritableBackground() method in
wxPanel::HasTransparentBackground() recursively.

Closes #12317.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-08-10 21:48:17 +00:00
parent e9f935cb70
commit d931703342
6 changed files with 32 additions and 30 deletions

View File

@@ -949,9 +949,10 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
dc.DrawText(wxT("Bitmap"), 30, 40);
dc.SelectObject( wxNullBitmap );
(void)new wxBitmapButton(panel, ID_BITMAP_BTN, bitmap, wxPoint(100, 20));
(void)new wxToggleButton(panel, ID_BITMAP_BTN_ENABLE,
wxT("Enable/disable &bitmap"), wxPoint(100, 140));
wxPanel *panel2 = new wxPanel(panel, -1, wxPoint(100, 0), wxSize(100, 200));
(void)new wxBitmapButton(panel2, ID_BITMAP_BTN, bitmap, wxPoint(0, 20));
(void)new wxToggleButton(panel2, ID_BITMAP_BTN_ENABLE,
wxT("Enable/disable &bitmap"), wxPoint(0, 140));
#if defined(__WXMSW__) || defined(__WXMOTIF__)
// test for masked bitmap display