Make DoGetBestSize() always return a width of 100
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26686 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -114,6 +114,8 @@ public:
|
|||||||
// virtual void SelectAll();
|
// virtual void SelectAll();
|
||||||
virtual void SetEditable(bool editable);
|
virtual void SetEditable(bool editable);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __WX_COCOA_TEXTCTRL_H__
|
#endif // __WX_COCOA_TEXTCTRL_H__
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/app.h"
|
#include "wx/app.h"
|
||||||
#include "wx/textctrl.h"
|
#include "wx/textctrl.h"
|
||||||
|
#include "wx/log.h"
|
||||||
#endif //WX_PRECOMP
|
#endif //WX_PRECOMP
|
||||||
|
|
||||||
#include "wx/cocoa/string.h"
|
#include "wx/cocoa/string.h"
|
||||||
@@ -22,6 +23,8 @@
|
|||||||
#import <Foundation/NSString.h>
|
#import <Foundation/NSString.h>
|
||||||
#import <AppKit/NSTextField.h>
|
#import <AppKit/NSTextField.h>
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl)
|
||||||
BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
|
BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
@@ -204,3 +207,16 @@ wxString wxTextCtrl::GetValue() const
|
|||||||
return wxStringWithNSString([GetNSTextField() stringValue]);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user