]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/taskbar.h
backport wxRegConfig enumeration fix
[wxWidgets.git] / include / wx / msw / taskbar.h
1 /////////////////////////////////////////////////////////////////////////
2 // File: wx/msw/taskbar.h
3 // Purpose: Defines wxTaskBarIcon class for manipulating icons on the
4 // Windows task bar.
5 // Author: Julian Smart
6 // Modified by:
7 // Created: 24/3/98
8 // RCS-ID: $Id$
9 // Copyright: (c) Julian Smart
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////
12
13 #ifndef _TASKBAR_H_
14 #define _TASKBAR_H_
15
16 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
17 #pragma interface "taskbar.h"
18 #endif
19
20 #include "wx/list.h"
21 #include "wx/icon.h"
22
23 class WXDLLIMPEXP_ADV wxTaskBarIcon;
24
25 WX_DECLARE_LIST_WITH_DECL(wxTaskBarIcon, wxTaskBarIconList,
26 class WXDLLIMPEXP_ADV);
27
28 class WXDLLIMPEXP_ADV wxTaskBarIcon: public wxTaskBarIconBase
29 {
30 DECLARE_DYNAMIC_CLASS_NO_COPY(wxTaskBarIcon)
31 public:
32 wxTaskBarIcon(void);
33 virtual ~wxTaskBarIcon(void);
34
35 // Accessors
36 inline WXHWND GetHWND() const { return m_hWnd; }
37 inline bool IsOk() const { return (m_hWnd != 0) ; }
38 inline bool IsIconInstalled() const { return m_iconAdded; }
39
40 // Operations
41 bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString);
42 bool RemoveIcon(void);
43 bool PopupMenu(wxMenu *menu); //, int x, int y);
44
45 #if WXWIN_COMPATIBILITY_2_4
46 wxDEPRECATED( bool IsOK() const );
47
48 // Overridables
49 virtual void OnMouseMove(wxEvent&);
50 virtual void OnLButtonDown(wxEvent&);
51 virtual void OnLButtonUp(wxEvent&);
52 virtual void OnRButtonDown(wxEvent&);
53 virtual void OnRButtonUp(wxEvent&);
54 virtual void OnLButtonDClick(wxEvent&);
55 virtual void OnRButtonDClick(wxEvent&);
56 #endif
57
58 // Implementation
59 static wxTaskBarIcon* FindObjectForHWND(WXHWND hWnd);
60 static void AddObject(wxTaskBarIcon* obj);
61 static void RemoveObject(wxTaskBarIcon* obj);
62 static bool RegisterWindowClass();
63 static WXHWND CreateTaskBarWindow();
64 long WindowProc( WXHWND hWnd, unsigned int msg, unsigned int wParam, long lParam );
65
66 // Data members
67 protected:
68 WXHWND m_hWnd;
69 bool m_iconAdded;
70 wxIcon m_icon;
71 wxString m_strTooltip;
72
73 static wxTaskBarIconList sm_taskBarIcons;
74
75 #if WXWIN_COMPATIBILITY_2_4
76 // non-virtual default event handlers to forward events to the virtuals
77 void _OnMouseMove(wxEvent&);
78 void _OnLButtonDown(wxEvent&);
79 void _OnLButtonUp(wxEvent&);
80 void _OnRButtonDown(wxEvent&);
81 void _OnRButtonUp(wxEvent&);
82 void _OnLButtonDClick(wxEvent&);
83 void _OnRButtonDClick(wxEvent&);
84
85 DECLARE_EVENT_TABLE()
86 #endif
87 };
88
89 #if WXWIN_COMPATIBILITY_2_4
90 inline bool wxTaskBarIcon::IsOK() const { return IsOk(); }
91 #endif
92
93 #endif
94 // _TASKBAR_H_
95
96
97
98
99