#include "wx/msw/winundef.h"
#include <string.h>
-#include "wx/msw/taskbar.h"
+#include "wx/taskbar.h"
#include "wx/msw/private.h"
#ifndef __TWIN32__
#include <shellapi.h>
#endif
+#include "wx/listimpl.cpp"
+WX_DEFINE_LIST(wxTaskBarIconList);
+
LRESULT APIENTRY _EXPORT wxTaskBarIconWindowProc( HWND hWnd, unsigned msg,
UINT wParam, LONG lParam );
wxChar *wxTaskBarWindowClass = (wxChar*) wxT("wxTaskBarWindowClass");
-wxList wxTaskBarIcon::sm_taskBarIcons;
-bool wxTaskBarIcon::sm_registeredClass = false;
+wxTaskBarIconList wxTaskBarIcon::sm_taskBarIcons;
+bool wxTaskBarIcon::sm_registeredClass = FALSE;
UINT wxTaskBarIcon::sm_taskbarMsg = 0;
-DEFINE_EVENT_TYPE( wxEVT_TASKBAR_MOVE )
-DEFINE_EVENT_TYPE( wxEVT_TASKBAR_LEFT_DOWN )
-DEFINE_EVENT_TYPE( wxEVT_TASKBAR_LEFT_UP )
-DEFINE_EVENT_TYPE( wxEVT_TASKBAR_RIGHT_DOWN )
-DEFINE_EVENT_TYPE( wxEVT_TASKBAR_RIGHT_UP )
-DEFINE_EVENT_TYPE( wxEVT_TASKBAR_LEFT_DCLICK )
-DEFINE_EVENT_TYPE( wxEVT_TASKBAR_RIGHT_DCLICK )
-
+#if WXWIN_COMPATIBILITY_2_4
BEGIN_EVENT_TABLE(wxTaskBarIcon, wxEvtHandler)
EVT_TASKBAR_MOVE (wxTaskBarIcon::_OnMouseMove)
EVT_TASKBAR_LEFT_DOWN (wxTaskBarIcon::_OnLButtonDown)
EVT_TASKBAR_LEFT_DCLICK (wxTaskBarIcon::_OnLButtonDClick)
EVT_TASKBAR_RIGHT_DCLICK (wxTaskBarIcon::_OnRButtonDClick)
END_EVENT_TABLE()
+#endif
IMPLEMENT_DYNAMIC_CLASS(wxTaskBarIcon, wxEvtHandler)
// Operations
bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip)
{
- if (!IsOK())
+ if (!IsOk())
return false;
NOTIFYICONDATA notifyData;
return rval;
}
-
+#if WXWIN_COMPATIBILITY_2_4
// Overridables
-void wxTaskBarIcon::OnMouseMove(wxEvent&)
-{
-}
-
-void wxTaskBarIcon::OnLButtonDown(wxEvent&)
-{
-}
-
-void wxTaskBarIcon::OnLButtonUp(wxEvent&)
-{
-}
-
-void wxTaskBarIcon::OnRButtonDown(wxEvent&)
-{
-}
-
-void wxTaskBarIcon::OnRButtonUp(wxEvent&)
-{
-}
-
-void wxTaskBarIcon::OnLButtonDClick(wxEvent&)
-{
-}
-
-void wxTaskBarIcon::OnRButtonDClick(wxEvent&)
-{
-}
+void wxTaskBarIcon::OnMouseMove(wxEvent&) {}
+void wxTaskBarIcon::OnLButtonDown(wxEvent&) {}
+void wxTaskBarIcon::OnLButtonUp(wxEvent&) {}
+void wxTaskBarIcon::OnRButtonDown(wxEvent&) {}
+void wxTaskBarIcon::OnRButtonUp(wxEvent&) {}
+void wxTaskBarIcon::OnLButtonDClick(wxEvent&) {}
+void wxTaskBarIcon::OnRButtonDClick(wxEvent&) {}
void wxTaskBarIcon::_OnMouseMove(wxEvent& e) { OnMouseMove(e); }
void wxTaskBarIcon::_OnLButtonDown(wxEvent& e) { OnLButtonDown(e); }
void wxTaskBarIcon::_OnRButtonUp(wxEvent& e) { OnRButtonUp(e); }
void wxTaskBarIcon::_OnLButtonDClick(wxEvent& e) { OnLButtonDClick(e); }
void wxTaskBarIcon::_OnRButtonDClick(wxEvent& e) { OnRButtonDClick(e); }
-
+#endif
wxTaskBarIcon* wxTaskBarIcon::FindObjectForHWND(WXHWND hWnd)
{
- wxNode *node = sm_taskBarIcons.GetFirst();
+ wxTaskBarIconList::Node *node = sm_taskBarIcons.GetFirst();
while (node)
{
- wxTaskBarIcon* obj = (wxTaskBarIcon*) node->GetData();
+ wxTaskBarIcon *obj = node->GetData();
if (obj->GetHWND() == hWnd)
return obj;
node = node->GetNext();
LRESULT APIENTRY _EXPORT wxTaskBarIconWindowProc( HWND hWnd, unsigned msg,
UINT wParam, LONG lParam )
{
- wxTaskBarIcon* obj = wxTaskBarIcon::FindObjectForHWND((WXHWND) hWnd);
+ wxTaskBarIcon *obj = wxTaskBarIcon::FindObjectForHWND((WXHWND) hWnd);
if (obj)
return obj->WindowProc((WXHWND) hWnd, msg, wParam, lParam);
else