X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7a34307e2463bca44f128e28b70e1df4f626e8f8..0738b901b17340f09766524b8d9d79e9ed1268e7:/src/osx/textctrl_osx.cpp?ds=inline diff --git a/src/osx/textctrl_osx.cpp b/src/osx/textctrl_osx.cpp index 8fd25ac960..6edd282e97 100644 --- a/src/osx/textctrl_osx.cpp +++ b/src/osx/textctrl_osx.cpp @@ -119,7 +119,13 @@ bool wxTextCtrl::Create( wxWindow *parent, m_peer = wxWidgetImpl::CreateTextControl( this, GetParent(), GetId(), str, pos, size, style, GetExtraStyle() ); MacPostControlCreate(pos, size) ; - + +#if wxOSX_USE_COCOA + // under carbon everything can already be set before the MacPostControlCreate embedding takes place + // but under cocoa for single line textfields this only works after everything has been set up + GetTextPeer()->SetStringValue(str); +#endif + // only now the embedding is correct and we can do a positioning update MacSuperChangedPosition() ; @@ -367,6 +373,11 @@ wxSize wxTextCtrl::DoGetBestSize() const return wxSize(wText, hText); } +bool wxTextCtrl::GetStyle(long position, wxTextAttr& style) +{ + return GetTextPeer()->GetStyle(position, style); +} + // ---------------------------------------------------------------------------- // Undo/redo // ---------------------------------------------------------------------------- @@ -718,6 +729,12 @@ bool wxTextCtrl::MacSetupCursor( const wxPoint& pt ) // implementation base class // ---------------------------------------------------------------------------- +bool wxTextWidgetImpl::GetStyle(long WXUNUSED(position), + wxTextAttr& WXUNUSED(style)) +{ + return false; +} + void wxTextWidgetImpl::SetStyle(long WXUNUSED(start), long WXUNUSED(end), const wxTextAttr& WXUNUSED(style))