diff --git a/include/wx/osx/combobox.h b/include/wx/osx/combobox.h index bf1b20861b..cae14068b8 100644 --- a/include/wx/osx/combobox.h +++ b/include/wx/osx/combobox.h @@ -146,10 +146,6 @@ class WXDLLIMPEXP_CORE wxComboBox : public wxControl, public wxComboBoxBase WX_DECLARE_CONTROL_CONTAINER(); #endif - // only used by the native Cocoa combobox, but we must define it everywhere - // to maintain the wxTextEntry abstraction. - virtual wxTextWidgetImpl * GetTextPeer() const; - #if wxOSX_USE_COCOA wxComboWidgetImpl* GetComboPeer() const; #endif diff --git a/include/wx/osx/textctrl.h b/include/wx/osx/textctrl.h index 988340df21..85583505fd 100644 --- a/include/wx/osx/textctrl.h +++ b/include/wx/osx/textctrl.h @@ -26,9 +26,6 @@ #include "wx/control.h" #include "wx/textctrl.h" -// forward decl for wxListWidgetImpl implementation type. -class WXDLLIMPEXP_FWD_CORE wxTextWidgetImpl; - class WXDLLIMPEXP_CORE wxTextCtrl: public wxTextCtrlBase { DECLARE_DYNAMIC_CLASS(wxTextCtrl) @@ -142,7 +139,6 @@ public: virtual void MacSuperChangedPosition(); virtual void MacCheckSpelling(bool check); - virtual wxTextWidgetImpl * GetTextPeer() const; protected: // common part of all ctors void Init(); diff --git a/src/osx/combobox_osx.cpp b/src/osx/combobox_osx.cpp index 744ad7304a..a69e26cf8b 100644 --- a/src/osx/combobox_osx.cpp +++ b/src/osx/combobox_osx.cpp @@ -217,11 +217,6 @@ bool wxComboBox::OSXHandleClicked( double WXUNUSED(timestampsec) ) return true; } -wxTextWidgetImpl* wxComboBox::GetTextPeer() const -{ - return dynamic_cast (m_peer); -} - wxComboWidgetImpl* wxComboBox::GetComboPeer() const { return dynamic_cast (m_peer); diff --git a/src/osx/textctrl_osx.cpp b/src/osx/textctrl_osx.cpp index 869fcb5b50..4021966024 100644 --- a/src/osx/textctrl_osx.cpp +++ b/src/osx/textctrl_osx.cpp @@ -137,11 +137,6 @@ bool wxTextCtrl::Create( wxWindow *parent, return true; } -wxTextWidgetImpl* wxTextCtrl::GetTextPeer() const -{ - return dynamic_cast (m_peer); -} - void wxTextCtrl::MacSuperChangedPosition() { wxWindow::MacSuperChangedPosition() ; diff --git a/src/osx/textentry_osx.cpp b/src/osx/textentry_osx.cpp index 680a4fdcfb..3e2ca4f22d 100644 --- a/src/osx/textentry_osx.cpp +++ b/src/osx/textentry_osx.cpp @@ -204,7 +204,9 @@ bool wxTextEntry::CanRedo() const wxTextWidgetImpl * wxTextEntry::GetTextPeer() const { - wxFAIL_MSG("You need to implement wxTextWidgetImpl* GetTextPeer() in your wxTextEntry subclass if you want to use the native impls of its methods."); - return NULL; + wxWindow * const win = const_cast(this)->GetEditableWindow(); + + return win ? dynamic_cast(win->GetPeer()) : NULL; } + #endif // wxUSE_TEXTCTRL