// virtual void SelectAll();
virtual void SetEditable(bool editable);
+protected:
+ virtual wxSize DoGetBestSize() const;
};
#endif // __WX_COCOA_TEXTCTRL_H__
#ifndef WX_PRECOMP
#include "wx/app.h"
#include "wx/textctrl.h"
+ #include "wx/log.h"
#endif //WX_PRECOMP
#include "wx/cocoa/string.h"
#import <Foundation/NSString.h>
#import <AppKit/NSTextField.h>
+#include <math.h>
+
IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl)
BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
END_EVENT_TABLE()
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;
+}
+