X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/da80ae712a30132bf19127db544959db7e1a7b52..3f4a2351e4c677c88c18ea812b609477adee7380:/src/mac/classic/textctrl.cpp diff --git a/src/mac/classic/textctrl.cpp b/src/mac/classic/textctrl.cpp index e12535f5d8..633d379688 100644 --- a/src/mac/classic/textctrl.cpp +++ b/src/mac/classic/textctrl.cpp @@ -23,6 +23,10 @@ #include "wx/app.h" #include "wx/utils.h" #include "wx/dc.h" + #include "wx/button.h" + #include "wx/settings.h" + #include "wx/msgdlg.h" + #include "wx/toplevel.h" #endif #ifdef __DARWIN__ @@ -32,8 +36,6 @@ #include #endif -#include "wx/msgdlg.h" - #if wxUSE_STD_IOSTREAM #if wxUSE_IOSTREAMH #include @@ -42,11 +44,8 @@ #endif #endif -#include "wx/button.h" -#include "wx/toplevel.h" #include "wx/notebook.h" #include "wx/tabctrl.h" -#include "wx/settings.h" #include "wx/filefn.h" #if defined(__BORLANDC__) && !defined(__WIN32__) @@ -641,9 +640,9 @@ OSStatus mUPOpenControl(ControlHandle theControl, long wxStyle ) -IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxTextCtrlBase) -BEGIN_EVENT_TABLE(wxTextCtrl, wxControl) +BEGIN_EVENT_TABLE(wxTextCtrl, wxTextCtrlBase) EVT_DROP_FILES(wxTextCtrl::OnDropFiles) EVT_CHAR(wxTextCtrl::OnChar) EVT_MENU(wxID_CUT, wxTextCtrl::OnCut) @@ -663,7 +662,7 @@ static void SetTXNData( TXNObject txn , const wxString& st , TXNOffset start , T { #if wxUSE_UNICODE #if SIZEOF_WCHAR_T == 2 - size_t len = st.Len() ; + size_t len = st.length() ; TXNSetData( txn , kTXNUnicodeTextData, (void*)st.wc_str(), len * 2, start, end); #else @@ -1276,16 +1275,6 @@ void wxTextCtrl::SetSelection(long from, long to) } } -bool wxTextCtrl::LoadFile(const wxString& file) -{ - if ( wxTextCtrlBase::LoadFile(file) ) - { - return true; - } - - return false; -} - void wxTextCtrl::WriteText(const wxString& str) { wxString st = str ; @@ -1623,14 +1612,10 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) } if ( !(m_windowStyle & wxTE_MULTILINE) ) { - wxWindow *parent = GetParent(); - while( parent && !parent->IsTopLevel() && parent->GetDefaultItem() == NULL ) { - parent = parent->GetParent() ; - } - if ( parent && parent->GetDefaultItem() ) + wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow); + if ( tlw && tlw->GetDefaultItem() ) { - wxButton *def = wxDynamicCast(parent->GetDefaultItem(), - wxButton); + wxButton *def = wxDynamicCast(tlw->GetDefaultItem(), wxButton); if ( def && def->IsEnabled() ) { wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() );