]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/app.cpp
adding alpha to core graphics dc
[wxWidgets.git] / src / mac / carbon / app.cpp
index 441eac5ef1cec7d213acacfff1478a3864d022d4..973bb8065df4799ad2d6fca2e5504e688d973331 100644 (file)
     #include "wx/menu.h"
     #include "wx/pen.h"
     #include "wx/brush.h"
+    #include "wx/palette.h"
+    #include "wx/icon.h"
+    #include "wx/cursor.h"
+    #include "wx/dialog.h"
+    #include "wx/msgdlg.h"
+    #include "wx/textctrl.h"
+    #include "wx/memory.h"
+    #include "wx/gdicmn.h"
 #endif
 
-#include "wx/gdicmn.h"
-#include "wx/cursor.h"
-#include "wx/icon.h"
-#include "wx/palette.h"
-#include "wx/dialog.h"
-#include "wx/msgdlg.h"
 #include "wx/module.h"
-#include "wx/memory.h"
 #include "wx/tooltip.h"
-#include "wx/textctrl.h"
 #include "wx/docview.h"
 #include "wx/filename.h"
+#include "wx/link.h"
 
 #include <string.h>
 
@@ -67,7 +68,8 @@
 #  include <Devices.h>
 #endif
 
-extern wxList wxPendingDelete;
+// Keep linker from discarding wxStockGDIMac
+wxFORCE_LINK_MODULE(gdiobj)
 
 #if wxUSE_THREADS
 extern size_t g_numberOfThreads;
@@ -1578,14 +1580,18 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers
         {
             if ( keyval == WXK_RETURN )
             {
-                wxButton *def = wxDynamicCast(focus->GetDefaultItem(), wxButton);
-                if ( def && def->IsEnabled() )
+                wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(focus), wxTopLevelWindow);
+                if ( tlw && tlw->GetDefaultItem() )
                 {
-                    wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() );
-                    event.SetEventObject(def);
-                    def->Command(event);
+                    wxButton *def = wxDynamicCast(tlw->GetDefaultItem(), wxButton);
+                    if ( def && def->IsEnabled() )
+                    {
+                        wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() );
+                        event.SetEventObject(def);
+                        def->Command(event);
 
-                    return true ;
+                        return true ;
+                    }
                 }
             }
             else if (keyval == WXK_ESCAPE || (keyval == '.' && modifiers & cmdKey ) )