Improved wxStaticBox border calculation for wxMotif.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35331 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2005-08-28 08:07:34 +00:00
parent a7f17c90e5
commit 13abe5c0c8
2 changed files with 25 additions and 0 deletions

View File

@@ -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;

View File

@@ -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;
}
}