From 44383ef7c64a4f7a7fa090337200fdbc2995824b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 8 Jul 2003 22:23:54 +0000 Subject: [PATCH] got rid of (unused since a long time) wxNO_3D and wxUSER_COLOURS git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/defs.h | 16 +++++----------- src/msw/dc.cpp | 35 ++--------------------------------- 2 files changed, 7 insertions(+), 44 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index ce1fbb21ad..50e98c4c47 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -967,19 +967,10 @@ enum wxBorder #define wxSTATIC_BORDER wxBORDER_STATIC #define wxNO_BORDER wxBORDER_NONE -// Override CTL3D etc. control colour processing to allow own background -// colour. -// Override CTL3D or native 3D styles for children -#define wxNO_3D 0x00800000 - -// OBSOLETE - use wxNO_3D instead -#define wxUSER_COLOURS wxNO_3D - // wxALWAYS_SHOW_SB: instead of hiding the scrollbar when it is not needed, // disable it - but still show (see also wxLB_ALWAYS_SB style) // -// NB: as this style is only supported by wxUniversal so far as it doesn't use -// wxUSER_COLOURS/wxNO_3D, we reuse the same style value +// NB: as this style is only supported by wxUniversal and wxMSW so far #define wxALWAYS_SHOW_SB 0x00800000 // Clip children when painting, which reduces flicker in e.g. frames and @@ -1075,7 +1066,10 @@ enum wxBorder // obsolete styles, unused any more #define wxDIALOG_MODAL 0x0020 // free flag value 0x0020 -#define wxDIALOG_MODELESS 0x0000 +#define wxDIALOG_MODELESS 0 +#define wxNO_3D 0 +#define wxUSER_COLOURS 0 + /* * MDI parent frame style flags diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 8caa96a2e7..a795a51b5e 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -1399,40 +1399,9 @@ void wxDC::SetBackground(const wxBrush& brush) m_backgroundBrush = brush; - if (!m_backgroundBrush.Ok()) - return; - - if (m_canvas) - { - bool customColours = TRUE; - // If we haven't specified wxUSER_COLOURS, don't allow the panel/dialog box to - // change background colours from the control-panel specified colours. - if (m_canvas->IsKindOf(CLASSINFO(wxWindow)) && ((m_canvas->GetWindowStyleFlag() & wxUSER_COLOURS) != wxUSER_COLOURS)) - customColours = FALSE; - - if (customColours) - { - if (m_backgroundBrush.GetStyle()==wxTRANSPARENT) - { - m_canvas->SetTransparent(TRUE); - } - else - { - // New behaviour, 10/2/99: setting the background brush of a DC - // doesn't affect the window background colour. However, - // I'm leaving in the transparency setting because it's needed by - // various controls (e.g. wxStaticText) to determine whether to draw - // transparently or not. TODO: maybe this should be a new function - // wxWindow::SetTransparency(). Should that apply to the child itself, or the - // parent? - // m_canvas->SetBackgroundColour(m_backgroundBrush.GetColour()); - m_canvas->SetTransparent(FALSE); - } - } - } - COLORREF new_color = m_backgroundBrush.GetColour().GetPixel(); + if ( m_backgroundBrush.Ok() ) { - (void)SetBkColor(GetHdc(), new_color); + (void)SetBkColor(GetHdc(), m_backgroundBrush.GetColour().GetPixel()); } } -- 2.45.2