]> git.saurik.com Git - wxWidgets.git/blob - src/common/taskbarcmn.cpp
Define __VISUALC__ for ICC under Windows again.
[wxWidgets.git] / src / common / taskbarcmn.cpp
1 /////////////////////////////////////////////////////////////////////////
2 // File: src/common/taskbarcmn.cpp
3 // Purpose: Common parts of wxTaskBarIcon class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 04/04/2003
7 // Copyright: (c) Julian Smart, 2003
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////
10
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
13
14 #ifdef __BORLANDC__
15 #pragma hdrstop
16 #endif
17
18 #if wxUSE_TASKBARICON
19
20 #include "wx/taskbar.h"
21
22 #ifndef WX_PRECOMP
23 #include "wx/app.h"
24 #include "wx/list.h"
25 #include "wx/menu.h"
26 #endif
27
28 extern WXDLLIMPEXP_DATA_CORE(wxList) wxPendingDelete;
29
30 // DLL options compatibility check:
31 WX_CHECK_BUILD_OPTIONS("wxAdvanced")
32
33 wxDEFINE_EVENT( wxEVT_TASKBAR_MOVE, wxTaskBarIconEvent );
34 wxDEFINE_EVENT( wxEVT_TASKBAR_LEFT_DOWN, wxTaskBarIconEvent );
35 wxDEFINE_EVENT( wxEVT_TASKBAR_LEFT_UP, wxTaskBarIconEvent );
36 wxDEFINE_EVENT( wxEVT_TASKBAR_RIGHT_DOWN, wxTaskBarIconEvent );
37 wxDEFINE_EVENT( wxEVT_TASKBAR_RIGHT_UP, wxTaskBarIconEvent );
38 wxDEFINE_EVENT( wxEVT_TASKBAR_LEFT_DCLICK, wxTaskBarIconEvent );
39 wxDEFINE_EVENT( wxEVT_TASKBAR_RIGHT_DCLICK, wxTaskBarIconEvent );
40 wxDEFINE_EVENT( wxEVT_TASKBAR_BALLOON_TIMEOUT, wxTaskBarIconEvent );
41 wxDEFINE_EVENT( wxEVT_TASKBAR_BALLOON_CLICK, wxTaskBarIconEvent );
42
43
44 BEGIN_EVENT_TABLE(wxTaskBarIconBase, wxEvtHandler)
45 EVT_TASKBAR_CLICK(wxTaskBarIconBase::OnRightButtonDown)
46 END_EVENT_TABLE()
47
48 void wxTaskBarIconBase::OnRightButtonDown(wxTaskBarIconEvent& WXUNUSED(event))
49 {
50 wxMenu *menu = CreatePopupMenu();
51 if (menu)
52 {
53 PopupMenu(menu);
54 delete menu;
55 }
56 }
57
58 void wxTaskBarIconBase::Destroy()
59 {
60 wxPendingDelete.Append(this);
61 }
62
63 #endif // wxUSE_TASKBARICON