From aede4ebb265b6537038e26131ebf07592ade460d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 6 Jul 2003 21:17:30 +0000 Subject: [PATCH] added GetBorder(flags) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/window.h | 10 +++++++--- src/common/wincmn.cpp | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) 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(); -- 2.45.2