X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b59cd6c4331d28debd757ed71062d0b544d3bf7e..ab67e8874db324fab5223cc8d5dff8a8de3e2b77:/src/osx/cocoa/taskbar.mm?ds=inline diff --git a/src/osx/cocoa/taskbar.mm b/src/osx/cocoa/taskbar.mm index 0938f3efb5..20d09701ac 100644 --- a/src/osx/cocoa/taskbar.mm +++ b/src/osx/cocoa/taskbar.mm @@ -4,7 +4,7 @@ // Author: David Elliott, Stefan Csomor // Modified by: // Created: 2004/01/24 -// RCS-ID: $Id: taskbar.mm 35650 2005-09-23 12:56:45Z MR $ +// RCS-ID: $Id$ // Copyright: (c) 2004 David Elliott, Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////// @@ -13,6 +13,7 @@ #if wxUSE_TASKBARICON #ifndef WX_PRECOMP + #include "wx/toplevel.h" #include "wx/menu.h" #include "wx/icon.h" #include "wx/log.h" @@ -61,7 +62,7 @@ public: virtual bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString) = 0; virtual bool RemoveIcon() = 0; - bool IsIconInstalled() const { return m_icon.Ok(); } + bool IsIconInstalled() const { return m_icon.IsOk(); } virtual bool PopupMenu(wxMenu *menu) = 0; virtual ~wxTaskBarIconImpl(); @@ -140,9 +141,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxTaskBarIcon, wxEvtHandler) wxTaskBarIcon::wxTaskBarIcon(wxTaskBarIconType iconType) { - if(iconType == DOCK) + if(iconType == wxTBI_DOCK) m_impl = new wxTaskBarIconDockImpl(this); - else if(iconType == CUSTOM_STATUSITEM) + else if(iconType == wxTBI_CUSTOM_STATUSITEM) m_impl = new wxTaskBarIconCustomStatusItemImpl(this); else { m_impl = NULL; @@ -290,6 +291,8 @@ bool wxTaskBarIconDockImpl::PopupMenu(wxMenu *WXUNUSED(menu)) @implementation wxNSAppController(wxTaskBarIconNSApplicationDelegateCategory) - (NSMenu*)applicationDockMenu:(NSApplication *)sender { + wxUnusedVar(sender); + return wxTaskBarIconDockImpl::OSXGetDockHMenu(); } @end @@ -302,6 +305,7 @@ bool wxTaskBarIconDockImpl::PopupMenu(wxMenu *WXUNUSED(menu)) - (void) clickedAction: (id) sender { + wxUnusedVar(sender); wxMenu *menu = impl->CreatePopupMenu(); if (menu) { @@ -334,7 +338,7 @@ wxTaskBarIconCustomStatusItemImpl::~wxTaskBarIconCustomStatusItemImpl() { } -bool wxTaskBarIconCustomStatusItemImpl::SetIcon(const wxIcon& icon, const wxString& WXUNUSED(tooltip)) +bool wxTaskBarIconCustomStatusItemImpl::SetIcon(const wxIcon& icon, const wxString& tooltip) { if(!m_statusItem) { @@ -343,6 +347,7 @@ bool wxTaskBarIconCustomStatusItemImpl::SetIcon(const wxIcon& icon, const wxStri m_target = [[wxOSXStatusItemTarget alloc] init]; [m_target setImplementation:this]; + [m_statusItem setHighlightMode:YES]; [m_statusItem setTarget:m_target]; [m_statusItem setAction:@selector(clickedAction:)]; [m_statusItem sendActionOn:NSLeftMouseDownMask]; @@ -363,6 +368,8 @@ bool wxTaskBarIconCustomStatusItemImpl::SetIcon(const wxIcon& icon, const wxStri } [m_statusItem setImage:m_icon.GetNSImage()]; + wxCFStringRef cfTooltip(tooltip); + [m_statusItem setToolTip:cfTooltip.AsNSString()]; return true; }