]> git.saurik.com Git - wxWidgets.git/commitdiff
Improved wxStaticBox border calculation for wxMotif.
authorMattia Barbon <mbarbon@cpan.org>
Sun, 28 Aug 2005 08:07:34 +0000 (08:07 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Sun, 28 Aug 2005 08:07:34 +0000 (08:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35331 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/motif/statbox.h
src/motif/statbox.cpp

index c26d7ba69dc3010c4d76057b2973299d85c1d4fa..e7882f19c29328226183d1297b951611ab23ebe9 100644 (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;
index 0b9ddc67ed801dfc462990ec3128ff2daf97cfad..76f381afc65b29611a5ba0f2dc24c068e879ab42 100644 (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;
+    }
+}