From 13abe5c0c80bc95ce1a6401fead018058137885f Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Sun, 28 Aug 2005 08:07:34 +0000 Subject: [PATCH] Improved wxStaticBox border calculation for wxMotif. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35331 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/motif/statbox.h | 1 + src/motif/statbox.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/include/wx/motif/statbox.h b/include/wx/motif/statbox.h index c26d7ba..e7882f1 100644 --- a/include/wx/motif/statbox.h +++ b/include/wx/motif/statbox.h @@ -50,6 +50,7 @@ public: virtual WXWidget GetLabelWidget() const { return m_labelWidget; } virtual void SetLabel(const wxString& label); + virtual void GetBordersForSizer(int *borderTop, int *borderOther) const; private: WXWidget m_labelWidget; diff --git a/src/motif/statbox.cpp b/src/motif/statbox.cpp index 0b9ddc6..76f381a 100644 --- a/src/motif/statbox.cpp +++ b/src/motif/statbox.cpp @@ -147,3 +147,27 @@ void wxStaticBox::SetLabel( const wxString& label ) sk.Restore(); } + +void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const +{ + Dimension shadow, border; + + XtVaGetValues( (Widget) GetMainWidget(), + XmNshadowThickness, &shadow, + XmNborderWidth, &border, + NULL); + + *borderOther = shadow + border; + + if( GetLabelWidget() ) + { + XtWidgetGeometry preferred; + XtQueryGeometry( (Widget) GetLabelWidget(), NULL, &preferred ); + + *borderTop = preferred.height; + } + else + { + *borderTop = shadow; + } +} -- 2.7.4