]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/textctrl.mm
Add wxOSX_10_6_AND_LATER macro and use it.
[wxWidgets.git] / src / osx / cocoa / textctrl.mm
index 63a2515307fd2630ddedfaf503e2155748d582bb..9dbb445eed3d256b7779859ed9f22ade7f86a6e9 100644 (file)
@@ -514,6 +514,18 @@ void wxNSTextViewControl::CheckSpelling(bool check)
         [m_textView setContinuousSpellCheckingEnabled: check];
 }
 
+wxSize wxNSTextViewControl::GetBestSize() const
+{
+    if (m_textView && [m_textView layoutManager])
+    {
+        NSRect rect = [[m_textView layoutManager] usedRectForTextContainer: [m_textView textContainer]];
+        wxSize size = wxSize(rect.size.width, rect.size.height);
+        size.x += [m_textView textContainerInset].width;
+        size.y += [m_textView textContainerInset].height;
+        return size;
+    }
+}
+
 // wxNSTextFieldControl
 
 wxNSTextFieldControl::wxNSTextFieldControl( wxTextCtrl *wxPeer, WXWidget w ) : wxWidgetCocoaImpl(wxPeer, w)