]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/textctrl.mm
expose find window method
[wxWidgets.git] / src / cocoa / textctrl.mm
index 6ead7fdd43e175125196f043b083a02fe8b6a5b4..5028866515504efa92d85f21dd772840db1e205e 100644 (file)
@@ -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 <Foundation/NSString.h>
 #import <AppKit/NSTextField.h>
 
+#include <math.h>
+
 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;
+}
+