Allow OS X Cocoa (or any OS X port) to override GetBestSize and provide a native OS X Cocoa impl. Also, fix the line ending check under OS X Cocoa, and a sanity check for SetStyle.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62725 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Ollivier
2009-11-26 23:11:27 +00:00
parent b9cf2753b4
commit 9ab7ff537d
4 changed files with 28 additions and 1 deletions

View 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)