]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/textctrl.cpp
reverted the move of wxComboBox styles from wx/defs.h to wx/combobox.h, a lot of...
[wxWidgets.git] / src / mac / carbon / textctrl.cpp
index 7e06fb7eda1947fdf7148e9e8b3657b6d6b9679e..c84b8fa71497f3154454e628229fd43d8596c08b 100644 (file)
@@ -414,9 +414,9 @@ private :
 };
 
 
-IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxTextCtrlBase)
 
-BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
+BEGIN_EVENT_TABLE(wxTextCtrl, wxTextCtrlBase)
     EVT_ERASE_BACKGROUND( wxTextCtrl::OnEraseBackground )
     EVT_DROP_FILES(wxTextCtrl::OnDropFiles)
     EVT_CHAR(wxTextCtrl::OnChar)
@@ -962,15 +962,10 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
 
             if ( !(m_windowStyle & wxTE_MULTILINE) )
             {
-                wxWindow *parent = GetParent();
-                while ( parent && !parent->IsTopLevel() && parent->GetDefaultItem() == NULL )
+                wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
+                if ( tlw && tlw->GetDefaultItem() )
                 {
-                    parent = parent->GetParent() ;
-                }
-
-                if ( parent && parent->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() );