From 431e319cc630c40d870ac91b863187299ca948c4 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 13 Nov 2007 14:51:14 +0000 Subject: [PATCH] Take wxBORDER_THEME, and the default border style, into account git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49910 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/univ/stdrend.cpp | 5 +++++ src/univ/themes/mono.cpp | 5 +++-- src/univ/winuniv.cpp | 7 ++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/univ/stdrend.cpp b/src/univ/stdrend.cpp index 082cf1b884..865f5bc018 100644 --- a/src/univ/stdrend.cpp +++ b/src/univ/stdrend.cpp @@ -413,13 +413,17 @@ void wxStdRenderer::DrawBorder(wxDC& dc, switch ( border ) { case wxBORDER_SUNKEN: + case wxBORDER_THEME: DrawSunkenBorder(dc, &rect); break; + // wxBORDER_DOUBLE and wxBORDER_THEME are currently the same value. +#if 0 case wxBORDER_DOUBLE: DrawAntiSunkenBorder(dc, &rect); DrawExtraBorder(dc, &rect); break; +#endif case wxBORDER_STATIC: DrawStaticBorder(dc, &rect); @@ -458,6 +462,7 @@ wxRect wxStdRenderer::GetBorderDimensions(wxBorder border) const case wxBORDER_RAISED: case wxBORDER_SUNKEN: + case wxBORDER_THEME: width = 2; break; diff --git a/src/univ/themes/mono.cpp b/src/univ/themes/mono.cpp index 4fd27cea1e..45079a1384 100644 --- a/src/univ/themes/mono.cpp +++ b/src/univ/themes/mono.cpp @@ -650,13 +650,14 @@ wxRect wxMonoRenderer::GetBorderDimensions(wxBorder border) const case wxBORDER_STATIC: case wxBORDER_RAISED: case wxBORDER_SUNKEN: + case wxBORDER_THEME: width = 1; break; - + /* case wxBORDER_DOUBLE: width = 2; break; - + */ default: wxFAIL_MSG(_T("unknown border type")); // fall through diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index 2e3dbcd844..bea3acdaf1 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -145,6 +145,11 @@ bool wxWindow::Create(wxWindow *parent, long style, const wxString& name) { + // Get default border + wxBorder border = GetBorder(style); + style &= ~wxBORDER_MASK; + style |= border; + long actualStyle = style; // we add wxCLIP_CHILDREN to get the same ("natural") behaviour under MSW @@ -665,7 +670,7 @@ void wxWindow::OnSize(wxSizeEvent& event) } } else - if (HasFlag( wxSUNKEN_BORDER ) || HasFlag( wxRAISED_BORDER )) + if (HasFlag( wxSUNKEN_BORDER ) || HasFlag( wxRAISED_BORDER ) || HasFlag( wxBORDER_THEME )) { if (newSize.y > m_oldSize.y) {