///////////////////////////////////////////////////////////////////////////////
-// Name: src/mac/carbon/taskbar.cpp
+// Name: src/osx/carbon/taskbar.cpp
// Purpose: wxTaskBarIcon
// Author: Ryan Norton
// Modified by:
#include "wx/icon.h"
#endif
-#include "wx/mac/private.h"
+#include "wx/osx/private.h"
class wxTaskBarIconImpl
{
wxTaskBarIcon *m_parent;
class wxTaskBarIconWindow *m_menuEventWindow;
- DECLARE_NO_COPY_CLASS(wxTaskBarIconImpl)
+ wxDECLARE_NO_COPY_CLASS(wxTaskBarIconImpl);
};
//-----------------------------------------------------------------------------
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
if (item && itemMenu )
{
if ( eventKind == kEventCommandProcess )
- err = itemMenu->MacHandleCommandProcess( item, id );
+ {
+ if ( itemMenu->HandleCommandProcess( item ) )
+ err = noErr;
+ }
else if ( eventKind == kEventCommandUpdateStatus )
- err = itemMenu->MacHandleCommandUpdateStatus( item, id );
+ {
+ if ( itemMenu->HandleCommandUpdateStatus( item ) )
+ err = noErr;
+ }
}
}
}
if (theNewMenu)
{
- if (m_pMenu)
- delete m_pMenu;
+ delete m_pMenu;
m_pMenu = theNewMenu;
m_pMenu->SetInvokingWindow(m_menuEventWindow);
}
//-----------------------------------------------------------------------------
bool wxDockTaskBarIcon::RemoveIcon()
{
- if (m_pMenu)
- {
- delete m_pMenu;
- m_pMenu = NULL;
- }
+ wxDELETE(m_pMenu);
// restore old icon to the dock
OSStatus err = RestoreApplicationDockTileImage();
{
wxASSERT(menu != NULL);
- if (m_pMenu)
- delete m_pMenu;
+ delete m_pMenu;
// start copy of menu
m_pMenu = wxDeepCopyMenu(menu);
// 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,