]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/taskbar.tex
Added EVT_MOVE_START, EVT_MOVE_END (wxMSW only for now)
[wxWidgets.git] / docs / latex / wx / taskbar.tex
CommitLineData
a660d684
KB
1\section{\class{wxTaskBarIcon}}\label{wxtaskbaricon}
2
4c98885e 3This class represents a taskbar icon. A taskbar icon is an icon that appears in the `system tray' and responds to mouse clicks, optionally with a tooltip above it to help provide information.
33d4eef0
VS
4
5\wxheading{X Window System Note}
6
7Under X Window System, the window manager must support either
8the \urlref{System Tray Protocol by freedesktop.org}{http://freedesktop.org/Standards/systemtray-spec}
9(WMs used by modern desktop environments such as GNOME >= 2, KDE
10>= 3 and XFCE >= 4 all do) or the older methods used in GNOME 1.2 and
11KDE 1 and 2. If it doesn't, the icon will appear as a toplevel window on
12user's desktop.
13
14Because not all window managers have system tray, there's no guarantee that
15wxTaskBarIcon will work correctly under X Window System and so the applications
16should use it only as an optional component of their user interface. The user
17should be required to explicitly enable the taskbar icon on Unix, it shouldn't
18be on by default.
19
a660d684
KB
20
21\wxheading{Derived from}
22
ea64fd02 23\helpref{wxEvtHandler}{wxevthandler}\\
a660d684
KB
24\helpref{wxObject}{wxobject}
25
954b8ae6
JS
26\wxheading{Include files}
27
28<wx/taskbar.h>
29
a7af285d
VZ
30\wxheading{Library}
31
32\helpref{wxAdv}{librarieslist}
33
ea64fd02
MB
34\wxheading{Event handling}
35
36To process input from a taskbar icon, use the following event handler macros to direct input to member
dae73d74
VS
37functions that take a wxTaskBarIconEvent argument. Note that not all ports are
38required to send these events and so it's better to override
39\helpref{CreatePopupMenu}{wxtaskbariconcreatepopupmenu} if all that
40the application does is that it shows a popup menu in reaction to mouse click.
ea64fd02
MB
41
42\twocolwidtha{7cm}
43\begin{twocollist}\itemsep=0pt
44\twocolitem{{\bf EVT\_TASKBAR\_MOVE(func)}}{Process a
45wxEVT\_TASKBAR\_MOVE event.}
46\twocolitem{{\bf EVT\_TASKBAR\_LEFT\_DOWN(func)}}{Process a
47wxEVT\_TASKBAR\_LEFT\_DOWN event.}
48\twocolitem{{\bf EVT\_TASKBAR\_LEFT\_UP(func)}}{Process a
49wxEVT\_TASKBAR\_LEFT\_UP event.}
50\twocolitem{{\bf EVT\_TASKBAR\_RIGHT\_DOWN(func)}}{Process a
51wxEVT\_TASKBAR\_RIGHT\_DOWN event.}
52\twocolitem{{\bf EVT\_TASKBAR\_RIGHT\_UP(func)}}{Process a
53wxEVT\_TASKBAR\_RIGHT\_UP event.}
54\twocolitem{{\bf EVT\_TASKBAR\_LEFT\_DCLICK(func)}}{Process a
55wxEVT\_TASKBAR\_LEFT\_DCLICK event.}
56\twocolitem{{\bf EVT\_TASKBAR\_RIGHT\_DCLICK(func)}}{Process a
57wxEVT\_TASKBAR\_RIGHT\_DCLICK event.}
9fcf8144
VZ
58\twocolitem{{\bf EVT\_TASKBAR\_CLICK(func)}}{This is a synonym for either
59EVT\_TASKBAR\_RIGHT\_DOWN or UP depending on the platform, use this event macro
60to catch the event which should result in the menu being displayed on the
61current platform.}
ea64fd02
MB
62\end{twocollist}%
63
a660d684
KB
64\latexignore{\rtfignore{\wxheading{Members}}}
65
15d83f72 66\membersection{wxTaskBarIcon::wxTaskBarIcon}\label{wxtaskbariconctor}
a660d684
KB
67
68\func{}{wxTaskBarIcon}{\void}
69
70Default constructor.
71
15d83f72 72\membersection{wxTaskBarIcon::\destruct{wxTaskBarIcon}}\label{wxtaskbaricondtor}
a660d684
KB
73
74\func{}{\destruct{wxTaskBarIcon}}{\void}
75
76Destroys the wxTaskBarIcon object, removing the icon if not already removed.
77
dae73d74
VS
78\membersection{wxTaskBarIcon::CreatePopupMenu}\label{wxtaskbariconcreatepopupmenu}
79
80\func{virtual wxMenu*}{CreatePopupMenu}{\void}
81
82This method is called by the library when the user requests popup menu
83(on Windows and Unix platforms, this is when the user right-clicks the icon).
84Override this function in order to provide popup menu associated with the icon.
85
239ef314 86If CreatePopupMenu returns NULL (this happens by default),
dae73d74
VS
87no menu is shown, otherwise the menu is
88displayed and then deleted by the library as soon as the user dismisses it.
89The events can be handled by a class derived from wxTaskBarIcon.
90
a660d684
KB
91\membersection{wxTaskBarIcon::IsIconInstalled}\label{wxtaskbariconisiconinstalled}
92
93\func{bool}{IsIconInstalled}{\void}
94
cc81d32f 95Returns true if \helpref{SetIcon}{wxtaskbariconseticon} was called with no subsequent \helpref{RemoveIcon}{wxtaskbariconremoveicon}.
a660d684 96
6af507f7 97\membersection{wxTaskBarIcon::IsOk}\label{wxtaskbariconisok}
a660d684 98
6af507f7 99\func{bool}{IsOk}{\void}
a660d684 100
cc81d32f 101Returns true if the object initialized successfully.
a660d684 102
feb68562
JS
103\membersection{wxTaskBarIcon::PopupMenu}\label{wxtaskbariconpopupmenu}
104
105\func{bool}{PopupMenu}{\param{wxMenu*}{ menu}}
106
107Pops up a menu at the current mouse position. The events can be handled by
108a class derived from wxTaskBarIcon.
109
dae73d74
VS
110\wxheading{Note}
111
112It is recommended to override
239ef314 113\helpref{CreatePopupMenu}{wxtaskbariconcreatepopupmenu}
dae73d74
VS
114callback instead of calling this method from event handler, because some
115ports (e.g. wxCocoa) may not implement PopupMenu and mouse click events at all.
116
a660d684
KB
117\membersection{wxTaskBarIcon::RemoveIcon}\label{wxtaskbariconremoveicon}
118
119\func{bool}{RemoveIcon}{\void}
120
121Removes the icon previously set with \helpref{SetIcon}{wxtaskbariconseticon}.
122
123\membersection{wxTaskBarIcon::SetIcon}\label{wxtaskbariconseticon}
124
125\func{bool}{SetIcon}{\param{const wxIcon\&}{ icon}, \param{const wxString\& }{tooltip}}
126
127Sets the icon, and optional tooltip text.
128
129