]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/utils.mm
supporting more key equivalents for display, fixing setHidden: method warning
[wxWidgets.git] / src / osx / cocoa / utils.mm
index aa32945edad50ecb7bfc3832581979cf34195982..f8926e800b6c41d574ecd2e57a876273367f4b2d 100644 (file)
@@ -49,26 +49,9 @@ void wxBell()
 
 #if wxUSE_GUI
 
-@interface wxNSAppController : NSObject wxOSX_10_6_AND_LATER(<NSApplicationDelegate>)
-{
-}
-
-- (void)applicationWillFinishLaunching:(NSApplication *)sender;
-
-- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename;
-- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender;
-- (BOOL)application:(NSApplication *)sender printFile:(NSString *)filename;
-- (void)handleGetURLEvent:(NSAppleEventDescriptor *)event
-           withReplyEvent:(NSAppleEventDescriptor *)replyEvent;
-
-- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender;
-- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
-- (void)applicationWillTerminate:(NSApplication *)sender;
-@end
-
 @implementation wxNSAppController
 
-- (void)applicationWillFinishLaunching:(NSApplication *)application {  
+- (void)applicationWillFinishLaunching:(NSNotification *)application { 
     wxUnusedVar(application);
 }
 
@@ -130,7 +113,7 @@ void wxBell()
     return NSTerminateNow;
 }
 
-- (void)applicationWillTerminate:(NSApplication *)application {
+- (void)applicationWillTerminate:(NSNotification *)application {
     wxUnusedVar(application);
     wxCloseEvent event;
     event.SetCanVeto(false);
@@ -290,6 +273,13 @@ void wxBeginBusyCursor(const wxCursor *cursor)
 {
     if (gs_wxBusyCursorCount++ == 0)
     {
+        NSEnumerator *enumerator = [[[NSApplication sharedApplication] windows] objectEnumerator];
+        id object;
+        
+        while ((object = [enumerator nextObject])) {
+            [(NSWindow*) object disableCursorRects];
+        }        
+
         gMacStoredActiveCursor = gMacCurrentCursor;
         cursor->MacInstall();
 
@@ -306,10 +296,17 @@ void wxEndBusyCursor()
 
     if (--gs_wxBusyCursorCount == 0)
     {
-        gMacStoredActiveCursor.MacInstall();
-        gMacStoredActiveCursor = wxNullCursor;
+        NSEnumerator *enumerator = [[[NSApplication sharedApplication] windows] objectEnumerator];
+        id object;
+        
+        while ((object = [enumerator nextObject])) {
+            [(NSWindow*) object enableCursorRects];
+        }        
 
         wxSetCursor(wxNullCursor);
+
+        gMacStoredActiveCursor.MacInstall();
+        gMacStoredActiveCursor = wxNullCursor;
     }
 }