]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/taskbar.cpp
Correct format specifiers used to show wxIPV4address.
[wxWidgets.git] / src / osx / carbon / taskbar.cpp
index b2f00b26adb37f0bde9bb6a71add91f01c3cc07f..49b11122b2a82339c7bea5c90d81000c29bcd477 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        src/mac/carbon/taskbar.cpp
+// Name:        src/osx/carbon/taskbar.cpp
 // Purpose:     wxTaskBarIcon
 // Author:      Ryan Norton
 // Modified by:
 // Purpose:     wxTaskBarIcon
 // Author:      Ryan Norton
 // Modified by:
@@ -41,7 +41,7 @@ public:
     wxTaskBarIcon *m_parent;
     class wxTaskBarIconWindow *m_menuEventWindow;
 
     wxTaskBarIcon *m_parent;
     class wxTaskBarIconWindow *m_menuEventWindow;
 
-    DECLARE_NO_COPY_CLASS(wxTaskBarIconImpl)
+    wxDECLARE_NO_COPY_CLASS(wxTaskBarIconImpl);
 };
 
 //-----------------------------------------------------------------------------
 };
 
 //-----------------------------------------------------------------------------
@@ -141,7 +141,7 @@ wxDockEventHandler(EventHandlerCallRef WXUNUSED(inHandlerCallRef),
     wxDockTaskBarIcon* pTB = (wxDockTaskBarIcon*) pData;
     const UInt32 eventClass = GetEventClass(inEvent);
     const UInt32 eventKind = GetEventKind(inEvent);
     wxDockTaskBarIcon* pTB = (wxDockTaskBarIcon*) pData;
     const UInt32 eventClass = GetEventClass(inEvent);
     const UInt32 eventKind = GetEventKind(inEvent);
-    
+
     OSStatus err = eventNotHandledErr;
 
     // Handle wxTaskBar menu events (note that this is a global event handler
     OSStatus err = eventNotHandledErr;
 
     // Handle wxTaskBar menu events (note that this is a global event handler
@@ -186,9 +186,15 @@ wxDockEventHandler(EventHandlerCallRef WXUNUSED(inHandlerCallRef),
                     if (item && itemMenu )
                     {
                         if ( eventKind == kEventCommandProcess )
                     if (item && itemMenu )
                     {
                         if ( eventKind == kEventCommandProcess )
-                            err = itemMenu->MacHandleCommandProcess( item, id );
+                        {
+                            if ( itemMenu->HandleCommandProcess( item ) )
+                                err = noErr;
+                        }
                         else if ( eventKind == kEventCommandUpdateStatus )
                         else if ( eventKind == kEventCommandUpdateStatus )
-                            err = itemMenu->MacHandleCommandUpdateStatus( item, id );
+                        {
+                            if ( itemMenu->HandleCommandUpdateStatus( item ) )
+                                err = noErr;
+                        }
                     }
                 }
             }
                     }
                 }
             }
@@ -341,8 +347,7 @@ wxMenu * wxDockTaskBarIcon::DoCreatePopupMenu()
 
     if (theNewMenu)
     {
 
     if (theNewMenu)
     {
-        if (m_pMenu)
-            delete m_pMenu;
+        delete m_pMenu;
         m_pMenu = theNewMenu;
         m_pMenu->SetInvokingWindow(m_menuEventWindow);
     }
         m_pMenu = theNewMenu;
         m_pMenu->SetInvokingWindow(m_menuEventWindow);
     }
@@ -404,11 +409,7 @@ bool wxDockTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& WXUNUSED(too
 //-----------------------------------------------------------------------------
 bool wxDockTaskBarIcon::RemoveIcon()
 {
 //-----------------------------------------------------------------------------
 bool wxDockTaskBarIcon::RemoveIcon()
 {
-    if (m_pMenu)
-    {
-        delete m_pMenu;
-        m_pMenu = NULL;
-    }
+    wxDELETE(m_pMenu);
 
     // restore old icon to the dock
     OSStatus err = RestoreApplicationDockTileImage();
 
     // restore old icon to the dock
     OSStatus err = RestoreApplicationDockTileImage();
@@ -436,8 +437,7 @@ bool wxDockTaskBarIcon::PopupMenu(wxMenu *menu)
 {
     wxASSERT(menu != NULL);
 
 {
     wxASSERT(menu != NULL);
 
-    if (m_pMenu)
-        delete m_pMenu;
+    delete m_pMenu;
 
     // start copy of menu
     m_pMenu = wxDeepCopyMenu(menu);
 
     // start copy of menu
     m_pMenu = wxDeepCopyMenu(menu);
@@ -466,7 +466,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxTaskBarIcon, wxEvtHandler)
 // actually seperate programs that also require a special undocumented id
 // hack and other such fun stuff).
 //-----------------------------------------------------------------------------
 // actually seperate programs that also require a special undocumented id
 // hack and other such fun stuff).
 //-----------------------------------------------------------------------------
-wxTaskBarIcon::wxTaskBarIcon(wxTaskBarIconType nType)
+wxTaskBarIcon::wxTaskBarIcon(wxTaskBarIconType WXUNUSED_UNLESS_DEBUG(nType))
 {
     wxASSERT_MSG(
         nType == DOCK,
 {
     wxASSERT_MSG(
         nType == DOCK,