]> git.saurik.com Git - wxWidgets.git/blob - interface/taskbar.h
Probable fix for [ 1933745 ] Crash in wxDataViewHeaderWindowBase::GetColumn()
[wxWidgets.git] / interface / taskbar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: taskbar.h
3 // Purpose: interface of wxTaskBarIcon
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxTaskBarIcon
11 @wxheader{taskbar.h}
12
13 This class represents a taskbar icon. A taskbar icon is an icon that appears in
14 the 'system tray' and responds to mouse clicks, optionally with a tooltip above it to help provide information.
15
16 @library{wxadv}
17 @category{FIXME}
18 */
19 class wxTaskBarIcon : public wxEvtHandler
20 {
21 public:
22 /**
23 Default constructor.
24 */
25 wxTaskBarIcon();
26
27 /**
28 Destroys the wxTaskBarIcon object, removing the icon if not already removed.
29 */
30 ~wxTaskBarIcon();
31
32 /**
33 This method is called by the library when the user requests popup menu
34 (on Windows and Unix platforms, this is when the user right-clicks the icon).
35 Override this function in order to provide popup menu associated with the icon.
36 If CreatePopupMenu returns @NULL (this happens by default),
37 no menu is shown, otherwise the menu is
38 displayed and then deleted by the library as soon as the user dismisses it.
39 The events can be handled by a class derived from wxTaskBarIcon.
40 */
41 virtual wxMenu* CreatePopupMenu();
42
43 /**
44 This method is similar to wxWindow::Destroy and can
45 be used to schedule the task bar icon object for the delayed destruction: it
46 will be deleted during the next event loop iteration, which allows the task bar
47 icon to process any pending events for it before being destroyed.
48 */
49 void Destroy();
50
51 /**
52 Returns @true if SetIcon() was called with no subsequent RemoveIcon().
53 */
54 bool IsIconInstalled();
55
56 /**
57 Returns @true if the object initialized successfully.
58 */
59 bool IsOk();
60
61 /**
62 Pops up a menu at the current mouse position. The events can be handled by
63 a class derived from wxTaskBarIcon.
64 */
65 bool PopupMenu(wxMenu* menu);
66
67 /**
68 Removes the icon previously set with SetIcon().
69 */
70 bool RemoveIcon();
71
72 /**
73 Sets the icon, and optional tooltip text.
74 */
75 bool SetIcon(const wxIcon& icon, const wxString& tooltip);
76 };
77