]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/classic/combobox.cpp
use WX_DEFINE_ARRAY_INT for an array of ints (bug 1536482)
[wxWidgets.git] / src / mac / classic / combobox.cpp
index aba551e2f3e9ee30acd9c1afe5927110aafe29ed..2879e2a3eb5920b3190e79c170f9b896c53ba865 100644 (file)
@@ -94,14 +94,10 @@ protected:
                 // This will invoke the dialog default action, such
                 // as the clicking the default button.
 
-                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() );