]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/statbox_osx.cpp
make sure 10.4 command-key events are routed via the wx-accelerator route as well...
[wxWidgets.git] / src / osx / statbox_osx.cpp
index 2b7b57ee0826a88af3ddd83f35b0d1a8782d2bfc..c20d08e086a5477b13d78f9cb35035c5ce992a4f 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Stefan Csomor
 // Modified by:
 // Created:     1998-01-01
-// RCS-ID:      $Id: statbox.cpp 54129 2008-06-11 19:30:52Z SC $
+// RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
 // Licence:       wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -16,8 +16,6 @@
 #include "wx/statbox.h"
 #include "wx/osx/private.h"
 
-IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
-
 bool wxStaticBox::Create( wxWindow *parent,
     wxWindowID id,
     const wxString& label,
@@ -32,7 +30,7 @@ bool wxStaticBox::Create( wxWindow *parent,
         return false;
 
     m_labelOrig = m_label = label;
-    
+
     m_peer = wxWidgetImpl::CreateGroupBox( this, parent, id, label, pos, size, style, GetExtraStyle() );
 
     MacPostControlCreate( pos, size );
@@ -42,6 +40,12 @@ bool wxStaticBox::Create( wxWindow *parent,
 
 void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const
 {
+#if wxOSX_USE_COCOA
+    int l,t,w,h;
+    m_peer->GetContentArea(l, t, w, h);
+    *borderTop = t + 10;
+    *borderOther = l + 10;
+#else
     static int extraTop = -1; // Uninitted
     static int other = 5;
 
@@ -63,6 +67,16 @@ void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const
         *borderTop += GetCharHeight();
 
     *borderOther = other;
+#endif
+}
+
+bool wxStaticBox::SetFont(const wxFont& font)
+{
+    bool retval = wxWindowBase::SetFont( font );
+
+    // dont' update the native control, it has its own small font
+
+    return retval;
 }
 
 #endif // wxUSE_STATBOX