From e5ecf1fc2409dd724a99b7833a7c6240f7bb257a Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Wed, 2 Mar 2005 10:57:08 +0000 Subject: [PATCH] In MSWUniv wxWindow and wxWindowMSW are different classes so we can't access some of protected members (catched only by Borland). Therefore some of the flags related to background needs reading API. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32558 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/univ/window.h | 1 - include/wx/window.h | 12 ++++++++++-- src/msw/window.cpp | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/wx/univ/window.h b/include/wx/univ/window.h index 13a54c9421..d13c7657a6 100644 --- a/include/wx/univ/window.h +++ b/include/wx/univ/window.h @@ -150,7 +150,6 @@ public: // return true if we should use the colours/fonts returned by the // corresponding GetXXX() methods instead of the default ones - bool UseBgCol() const { return m_hasBgCol; } bool UseFgCol() const { return m_hasFgCol; } bool UseFont() const { return m_hasFont; } diff --git a/include/wx/window.h b/include/wx/window.h index 508875a488..06b9ad44d4 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -424,11 +424,11 @@ public: // Override these methods for windows that have a virtual size // independent of their client size. eg. the virtual area of a - // wxScrolledWindow. + // wxScrolledWindow. virtual void DoSetVirtualSize( int x, int y ); virtual wxSize DoGetVirtualSize() const; - + // Return the largest of ClientSize and BestSize (as determined // by a sizer, interior children, or other means) @@ -759,6 +759,14 @@ public: m_inheritBgCol = false; } wxColour GetBackgroundColour() const; + bool InheritsBackgroundColour() const + { + return m_inheritBgCol; + } + bool UseBgCol() const + { + return m_hasBgCol; + } // if the window shouldn't inherit its colour from the parent, override // this function to return true diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 9dc2e5922d..605d60812d 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -4041,7 +4041,7 @@ WXHBRUSH wxWindowMSW::MSWGetBgBrush(WXHDC hDC) // windows for which a custom colour had been explicitly set with // SetOwnBackgroundColour() and so shouldn't affect its children if ( win->ProvidesBackground() || - (win->m_hasBgCol && !win->m_inheritBgCol) ) + (win->UseBgCol() && !win->InheritsBackgroundColour()) ) break; } -- 2.45.2