From 459e74ba69ff30cdb0443109a129aa3c4e3cd0d3 Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Sun, 9 Jun 2002 19:24:21 +0000 Subject: [PATCH] Update taskbar.h to use DECLARE/DEFINE_EVENT_TYPE; fixes an runtime error with MinGW and (probably) Cygwin. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/taskbar.h | 17 +++++++++-------- src/msw/taskbar.cpp | 7 +++++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/include/wx/msw/taskbar.h b/include/wx/msw/taskbar.h index c0fa59a0a6..b93a400944 100644 --- a/include/wx/msw/taskbar.h +++ b/include/wx/msw/taskbar.h @@ -92,14 +92,15 @@ public: virtual wxEvent *Clone() const { return new wxTaskBarIconEvent(*this); } }; -const wxEventType wxEVT_TASKBAR_MOVE = wxEVT_FIRST + 1550; -const wxEventType wxEVT_TASKBAR_LEFT_DOWN = wxEVT_FIRST + 1551; -const wxEventType wxEVT_TASKBAR_LEFT_UP = wxEVT_FIRST + 1552; -const wxEventType wxEVT_TASKBAR_RIGHT_DOWN = wxEVT_FIRST + 1553; -const wxEventType wxEVT_TASKBAR_RIGHT_UP = wxEVT_FIRST + 1554; -const wxEventType wxEVT_TASKBAR_LEFT_DCLICK = wxEVT_FIRST + 1555; -const wxEventType wxEVT_TASKBAR_RIGHT_DCLICK = wxEVT_FIRST + 1556; - +BEGIN_DECLARE_EVENT_TYPES() +DECLARE_EVENT_TYPE( wxEVT_TASKBAR_MOVE, 1550 ) +DECLARE_EVENT_TYPE( wxEVT_TASKBAR_LEFT_DOWN, 1551 ) +DECLARE_EVENT_TYPE( wxEVT_TASKBAR_LEFT_UP, 1552 ) +DECLARE_EVENT_TYPE( wxEVT_TASKBAR_RIGHT_DOWN, 1553 ) +DECLARE_EVENT_TYPE( wxEVT_TASKBAR_RIGHT_UP, 1554 ) +DECLARE_EVENT_TYPE( wxEVT_TASKBAR_LEFT_DCLICK, 1555 ) +DECLARE_EVENT_TYPE( wxEVT_TASKBAR_RIGHT_DCLICK, 1556 ) +END_DECLARE_EVENT_TYPES() #define EVT_TASKBAR_MOVE(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_MOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL), #define EVT_TASKBAR_LEFT_DOWN(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL), diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index 3d14a5970d..f17654653b 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -58,6 +58,13 @@ wxList 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 ) BEGIN_EVENT_TABLE(wxTaskBarIcon, wxEvtHandler) EVT_TASKBAR_MOVE (wxTaskBarIcon::_OnMouseMove)