X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b0c0a393c4027a46b83187ea1328949ca75971d0..1a42f89c41256c9de765b5e7671f4d1e94dbdc51:/src/cocoa/textctrl.mm diff --git a/src/cocoa/textctrl.mm b/src/cocoa/textctrl.mm index 6ead7fdd43..5028866515 100644 --- a/src/cocoa/textctrl.mm +++ b/src/cocoa/textctrl.mm @@ -13,6 +13,7 @@ #ifndef WX_PRECOMP #include "wx/app.h" #include "wx/textctrl.h" + #include "wx/log.h" #endif //WX_PRECOMP #include "wx/cocoa/string.h" @@ -22,6 +23,8 @@ #import #import +#include + IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl) BEGIN_EVENT_TABLE(wxTextCtrl, wxControl) END_EVENT_TABLE() @@ -204,3 +207,16 @@ wxString wxTextCtrl::GetValue() const return wxStringWithNSString([GetNSTextField() stringValue]); } +wxSize wxTextCtrl::DoGetBestSize() const +{ + wxAutoNSAutoreleasePool pool; + wxASSERT(GetNSControl()); + NSCell *cell = [GetNSControl() cell]; + wxASSERT(cell); + NSSize cellSize = [cell cellSize]; + wxSize size(100,(int)ceilf(cellSize.height)); + + wxLogTrace(wxTRACE_COCOA_Window_Size,wxT("wxTextCtrl=%p::DoGetBestSize()==(%d,%d)"),this,size.x,size.y); + return size; +} +