]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/taskbar.h
getting rid of wxBuffer
[wxWidgets.git] / include / wx / os2 / taskbar.h
1 /////////////////////////////////////////////////////////////////////////
2 // File: taskbar.h
3 // Purpose: Defines wxTaskBarIcon class for manipulating icons on the
4 // task bar. Optional.
5 // Author: David Webster
6 // Modified by:
7 // Created: 10/17/99
8 // RCS-ID: $Id$
9 // Copyright: (c) David Webster
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////
12
13 #ifndef _WX_TASKBAR_H_
14 #define _WX_TASKBAR_H_
15
16 #include <wx/event.h>
17 #include <wx/list.h>
18 #include <wx/icon.h>
19
20 class WXDLLEXPORT wxTaskBarIcon: public wxEvtHandler {
21 DECLARE_DYNAMIC_CLASS(wxTaskBarIcon)
22 public:
23 wxTaskBarIcon(void);
24 virtual ~wxTaskBarIcon(void);
25
26 // Accessors
27 inline WXHWND GetHWND() const { return m_hWnd; }
28 inline bool IsOK() const { return (m_hWnd != 0) ; }
29 inline bool IsIconInstalled() const { return m_iconAdded; }
30
31 // Operations
32 bool SetIcon(const wxIcon& icon, const wxString& tooltip = "");
33 bool RemoveIcon(void);
34 bool PopupMenu(wxMenu *menu); //, int x, int y);
35
36 // Overridables
37 virtual void OnMouseMove(wxEvent&);
38 virtual void OnLButtonDown(wxEvent&);
39 virtual void OnLButtonUp(wxEvent&);
40 virtual void OnRButtonDown(wxEvent&);
41 virtual void OnRButtonUp(wxEvent&);
42 virtual void OnLButtonDClick(wxEvent&);
43 virtual void OnRButtonDClick(wxEvent&);
44
45 // Implementation
46 static wxTaskBarIcon* FindObjectForHWND(WXHWND hWnd);
47 static void AddObject(wxTaskBarIcon* obj);
48 static void RemoveObject(wxTaskBarIcon* obj);
49 static bool RegisterWindowClass();
50 static WXHWND CreateTaskBarWindow();
51 MRESULT WindowProc( WXHWND hWnd, UINT msg, MPARAM wParam, MPARAM lParam );
52
53 // Data members
54 protected:
55 WXHWND m_hWnd;
56 bool m_iconAdded;
57 static wxList sm_taskBarIcons;
58 static bool sm_registeredClass;
59 static unsigned int sm_taskbarMsg;
60
61 // non-virtual default event handlers to forward events to the virtuals
62 void _OnMouseMove(wxEvent&);
63 void _OnLButtonDown(wxEvent&);
64 void _OnLButtonUp(wxEvent&);
65 void _OnRButtonDown(wxEvent&);
66 void _OnRButtonUp(wxEvent&);
67 void _OnLButtonDClick(wxEvent&);
68 void _OnRButtonDClick(wxEvent&);
69
70 DECLARE_EVENT_TABLE()
71 };
72
73 const wxEventType wxEVT_TASKBAR_MOVE = wxEVT_FIRST + 1550;
74 const wxEventType wxEVT_TASKBAR_LEFT_DOWN = wxEVT_FIRST + 1551;
75 const wxEventType wxEVT_TASKBAR_LEFT_UP = wxEVT_FIRST + 1552;
76 const wxEventType wxEVT_TASKBAR_RIGHT_DOWN = wxEVT_FIRST + 1553;
77 const wxEventType wxEVT_TASKBAR_RIGHT_UP = wxEVT_FIRST + 1554;
78 const wxEventType wxEVT_TASKBAR_LEFT_DCLICK = wxEVT_FIRST + 1555;
79 const wxEventType wxEVT_TASKBAR_RIGHT_DCLICK = wxEVT_FIRST + 1556;
80
81 #define EVT_TASKBAR_MOVE(fn) wxEventTableEntry(wxEVT_TASKBAR_MOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
82 #define EVT_TASKBAR_LEFT_DOWN(fn) wxEventTableEntry(wxEVT_TASKBAR_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
83 #define EVT_TASKBAR_LEFT_UP(fn) wxEventTableEntry(wxEVT_TASKBAR_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
84 #define EVT_TASKBAR_RIGHT_DOWN(fn) wxEventTableEntry(wxEVT_TASKBAR_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
85 #define EVT_TASKBAR_RIGHT_UP(fn) wxEventTableEntry(wxEVT_TASKBAR_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
86 #define EVT_TASKBAR_LEFT_DCLICK(fn) wxEventTableEntry(wxEVT_TASKBAR_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
87 #define EVT_TASKBAR_RIGHT_DCLICK(fn) wxEventTableEntry(wxEVT_TASKBAR_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
88
89
90 #endif
91 // _TASKBAR_H_
92