X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/63b3dc58be6a03cd617668f3a1a97cbfb3f95438..91a6c655582321b61a7545ed9c121ad6593ccbfe:/src/msw/taskbar.cpp?ds=sidebyside diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index 503480beae..0a6277803f 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -17,6 +17,8 @@ #pragma hdrstop #endif +#if wxUSE_TASKBARICON + #ifndef WX_PRECOMP #include "wx/window.h" #include "wx/frame.h" @@ -39,18 +41,6 @@ UINT gs_msgTaskbar = 0; UINT gs_msgRestartTaskbar = 0; -#if WXWIN_COMPATIBILITY_2_4 -BEGIN_EVENT_TABLE(wxTaskBarIcon, wxTaskBarIconBase) - EVT_TASKBAR_MOVE (wxTaskBarIcon::_OnMouseMove) - EVT_TASKBAR_LEFT_DOWN (wxTaskBarIcon::_OnLButtonDown) - EVT_TASKBAR_LEFT_UP (wxTaskBarIcon::_OnLButtonUp) - EVT_TASKBAR_RIGHT_DOWN (wxTaskBarIcon::_OnRButtonDown) - EVT_TASKBAR_RIGHT_UP (wxTaskBarIcon::_OnRButtonUp) - EVT_TASKBAR_LEFT_DCLICK (wxTaskBarIcon::_OnLButtonDClick) - EVT_TASKBAR_RIGHT_DCLICK (wxTaskBarIcon::_OnRButtonDClick) -END_EVENT_TABLE() -#endif - IMPLEMENT_DYNAMIC_CLASS(wxTaskBarIcon, wxEvtHandler) @@ -155,10 +145,11 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip) notifyData.hIcon = GetHiconOf(icon); } + // set NIF_TIP even for an empty tooltip: otherwise it would be impossible + // to remove an existing tooltip using this function + notifyData.uFlags |= NIF_TIP; if ( !tooltip.empty() ) { - notifyData.uFlags |= NIF_TIP; -// lstrcpyn(notifyData.szTip, tooltip.c_str(), WXSIZEOF(notifyData.szTip)); wxStrncpy(notifyData.szTip, tooltip.c_str(), WXSIZEOF(notifyData.szTip)); } @@ -183,6 +174,7 @@ bool wxTaskBarIcon::RemoveIcon() return Shell_NotifyIcon(NIM_DELETE, ¬ifyData) != 0; } +#if wxUSE_MENUS bool wxTaskBarIcon::PopupMenu(wxMenu *menu) { wxASSERT_MSG( m_win != NULL, _T("taskbar icon not initialized") ); @@ -218,32 +210,7 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu) return rval; } - -#if WXWIN_COMPATIBILITY_2_4 -// Overridables -void wxTaskBarIcon::OnMouseMove(wxEvent& e) { e.Skip(); } -void wxTaskBarIcon::OnLButtonDown(wxEvent& e) { e.Skip(); } -void wxTaskBarIcon::OnLButtonUp(wxEvent& e) { e.Skip(); } -void wxTaskBarIcon::OnRButtonDown(wxEvent& e) { e.Skip(); } -void wxTaskBarIcon::OnRButtonUp(wxEvent& e) { e.Skip(); } -void wxTaskBarIcon::OnLButtonDClick(wxEvent& e) { e.Skip(); } -void wxTaskBarIcon::OnRButtonDClick(wxEvent& e) { e.Skip(); } - -void wxTaskBarIcon::_OnMouseMove(wxTaskBarIconEvent& e) - { OnMouseMove(e); } -void wxTaskBarIcon::_OnLButtonDown(wxTaskBarIconEvent& e) - { OnLButtonDown(e); } -void wxTaskBarIcon::_OnLButtonUp(wxTaskBarIconEvent& e) - { OnLButtonUp(e); } -void wxTaskBarIcon::_OnRButtonDown(wxTaskBarIconEvent& e) - { OnRButtonDown(e); } -void wxTaskBarIcon::_OnRButtonUp(wxTaskBarIconEvent& e) - { OnRButtonUp(e); } -void wxTaskBarIcon::_OnLButtonDClick(wxTaskBarIconEvent& e) - { OnLButtonDClick(e); } -void wxTaskBarIcon::_OnRButtonDClick(wxTaskBarIconEvent& e) - { OnRButtonDClick(e); } -#endif +#endif // wxUSE_MENUS void wxTaskBarIcon::RegisterWindowMessages() { @@ -323,3 +290,6 @@ long wxTaskBarIcon::WindowProc(unsigned int msg, return 0; } + +#endif // wxUSE_TASKBARICON +