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:
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user