diff --git a/include/wx/window.h b/include/wx/window.h index 646e088e22..679ceb8067 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -680,9 +680,13 @@ public: // misc // ---- - // get the window border style: uses the current style and falls back to - // the default style for this class otherwise (see GetDefaultBorder()) - wxBorder GetBorder() const; + // get the window border style from the given flags: this is different from + // simply doing flags & wxBORDER_MASK because it uses GetDefaultBorder() to + // translate wxBORDER_DEFAULT to something reasonable + wxBorder GetBorder(long flags) const; + + // get border for the flags of this window + wxBorder GetBorder() const { return GetBorder(GetWindowStyleFlag()); } void UpdateWindowUI(); diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 383c61e8fa..810d518d9d 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -1994,9 +1994,9 @@ void wxWindowListNode::DeleteData() // borders // ---------------------------------------------------------------------------- -wxBorder wxWindowBase::GetBorder() const +wxBorder wxWindowBase::GetBorder(long flags) const { - wxBorder border = (wxBorder)(m_windowStyle & wxBORDER_MASK); + wxBorder border = (wxBorder)(flags & wxBORDER_MASK); if ( border == wxBORDER_DEFAULT ) { border = GetDefaultBorder();