summaryrefslogtreecommitdiffstats
path: root/doc/html/tqcontextmenuevent.html
blob: f33621dda0a8d7bd8aa81f4b3ccdfea69a2b5d7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/tqevent.cpp:1549 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQContextMenuEvent Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQContextMenuEvent Class Reference</h1>

<p>The TQContextMenuEvent class contains parameters that describe a context menu event.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="tqevent-h.html">tqevent.h</a>&gt;</tt>
<p>Inherits <a href="tqevent.html">TQEvent</a>.
<p><a href="tqcontextmenuevent-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn>enum <a href="#Reason-enum"><b>Reason</b></a> { Mouse, Keyboard, Other }</li>
<li class=fn><a href="#TQContextMenuEvent"><b>TQContextMenuEvent</b></a> ( Reason&nbsp;reason, const&nbsp;TQPoint&nbsp;&amp;&nbsp;pos, const&nbsp;TQPoint&nbsp;&amp;&nbsp;globalPos, int&nbsp;state )</li>
<li class=fn><a href="#TQContextMenuEvent-2"><b>TQContextMenuEvent</b></a> ( Reason&nbsp;reason, const&nbsp;TQPoint&nbsp;&amp;&nbsp;pos, int&nbsp;state )</li>
<li class=fn>int <a href="#x"><b>x</b></a> () const</li>
<li class=fn>int <a href="#y"><b>y</b></a> () const</li>
<li class=fn>int <a href="#globalX"><b>globalX</b></a> () const</li>
<li class=fn>int <a href="#globalY"><b>globalY</b></a> () const</li>
<li class=fn>const TQPoint &amp; <a href="#pos"><b>pos</b></a> () const</li>
<li class=fn>const TQPoint &amp; <a href="#globalPos"><b>globalPos</b></a> () const</li>
<li class=fn>ButtonState <a href="#state"><b>state</b></a> () const</li>
<li class=fn>bool <a href="#isAccepted"><b>isAccepted</b></a> () const</li>
<li class=fn>bool <a href="#isConsumed"><b>isConsumed</b></a> () const</li>
<li class=fn>void <a href="#consume"><b>consume</b></a> ()</li>
<li class=fn>void <a href="#accept"><b>accept</b></a> ()</li>
<li class=fn>void <a href="#ignore"><b>ignore</b></a> ()</li>
<li class=fn>Reason <a href="#reason"><b>reason</b></a> () const</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The TQContextMenuEvent class contains parameters that describe a context menu event.
<p> 
<p> Context menu events are sent to widgets when a user triggers a
context menu. What triggers this is platform dependent. For
example, on Windows, pressing the menu button or releasing the
right mouse button will cause this event to be sent.
<p> When this event occurs it is customary to show a <a href="tqpopupmenu.html">TQPopupMenu</a> with a
context menu, if this is relevant to the context.
<p> Context menu events contain a special accept flag that indicates
whether the receiver accepted the event. If the event handler does
not accept the event, then whatever triggered the event will be
handled as a regular input event if possible.
<p> <p>See also <a href="tqpopupmenu.html">TQPopupMenu</a> and <a href="events.html">Event Classes</a>.

<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="Reason-enum"></a>TQContextMenuEvent::Reason</h3>

<p> This enum describes the reason the ContextMenuEvent was sent. The
values are:
<ul>
<li><tt>TQContextMenuEvent::Mouse</tt> - The mouse caused the event to be sent. Normally this
means the right mouse button was clicked, but this is platform
specific.
<li><tt>TQContextMenuEvent::Keyboard</tt> - The keyboard caused this event to be sent. On
Windows this means the menu button was pressed.
<li><tt>TQContextMenuEvent::Other</tt> - The event was sent by some other means (i.e. not by
the mouse or keyboard).
</ul>
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQContextMenuEvent"></a>TQContextMenuEvent::TQContextMenuEvent ( <a href="tqcontextmenuevent.html#Reason-enum">Reason</a>&nbsp;reason, const&nbsp;<a href="tqpoint.html">TQPoint</a>&nbsp;&amp;&nbsp;pos, const&nbsp;<a href="tqpoint.html">TQPoint</a>&nbsp;&amp;&nbsp;globalPos, int&nbsp;state )
</h3>

<p> Constructs a context menu event object with the accept parameter
flag set to FALSE.
<p> The <em>reason</em> parameter must be <a href="#Reason-enum">TQContextMenuEvent::Mouse</a> or <a href="#Reason-enum">TQContextMenuEvent::Keyboard</a>.
<p> The <em>pos</em> parameter specifies the mouse position relative to the
receiving widget. <em>globalPos</em> is the mouse position in absolute
coordinates. <em>state</em> is the ButtonState at the time of the event.

<h3 class=fn><a name="TQContextMenuEvent-2"></a>TQContextMenuEvent::TQContextMenuEvent ( <a href="tqcontextmenuevent.html#Reason-enum">Reason</a>&nbsp;reason, const&nbsp;<a href="tqpoint.html">TQPoint</a>&nbsp;&amp;&nbsp;pos, int&nbsp;state )
</h3>

<p> Constructs a context menu event object with the accept parameter
flag set to FALSE.
<p> The <em>reason</em> parameter must be <a href="#Reason-enum">TQContextMenuEvent::Mouse</a> or <a href="#Reason-enum">TQContextMenuEvent::Keyboard</a>.
<p> The <em>pos</em> parameter specifies the mouse position relative to the
receiving widget. <em>state</em> is the ButtonState at the time of the
event.
<p> The <a href="#globalPos">globalPos</a>() is initialized to <a href="tqcursor.html#pos">TQCursor::pos</a>(), which may not be
appropriate. Use the other constructor to specify the global
position explicitly.

<h3 class=fn>void <a name="accept"></a>TQContextMenuEvent::accept ()
</h3>

<p> Sets the accept flag of the context event object.
<p> Setting the accept flag indicates that the receiver of this event
has processed the event. Processing the event means you did
something with it and it will be implicitly consumed.
<p> The accept flag is not set by default.
<p> <p>See also <a href="#ignore">ignore</a>() and <a href="#consume">consume</a>().

<h3 class=fn>void <a name="consume"></a>TQContextMenuEvent::consume ()
</h3>

<p> Sets the consume flag of the context event object.
<p> Setting the consume flag indicates that the receiver of this event
does not want the event to be propagated further (i.e. not sent to
parent classes.)
<p> The consumed flag is not set by default.
<p> <p>See also <a href="#ignore">ignore</a>() and <a href="#accept">accept</a>().

<h3 class=fn>const&nbsp;<a href="tqpoint.html">TQPoint</a>&nbsp;&amp; <a name="globalPos"></a>TQContextMenuEvent::globalPos () const
</h3>

<p> Returns the global position of the mouse pointer at the time of
the event.
<p> <p>See also <a href="#x">x</a>(), <a href="#y">y</a>(), and <a href="#pos">pos</a>().

<h3 class=fn>int <a name="globalX"></a>TQContextMenuEvent::globalX () const
</h3>

<p> Returns the global x-position of the mouse pointer at the time of
the event.
<p> <p>See also <a href="#globalY">globalY</a>() and <a href="#globalPos">globalPos</a>().

<h3 class=fn>int <a name="globalY"></a>TQContextMenuEvent::globalY () const
</h3>

<p> Returns the global y-position of the mouse pointer at the time of
the event.
<p> <p>See also <a href="#globalX">globalX</a>() and <a href="#globalPos">globalPos</a>().

<h3 class=fn>void <a name="ignore"></a>TQContextMenuEvent::ignore ()
</h3>

<p> Clears the accept flag of the context event object.
<p> Clearing the accept flag indicates that the receiver of this event
does not need to show a context menu. This will implicitly remove
the consumed flag as well.
<p> The accept flag is not set by default.
<p> <p>See also <a href="#accept">accept</a>() and <a href="#consume">consume</a>().

<h3 class=fn>bool <a name="isAccepted"></a>TQContextMenuEvent::isAccepted () const
</h3>

<p> Returns TRUE if the receiver has processed the event; otherwise
returns FALSE.
<p> <p>See also <a href="#accept">accept</a>(), <a href="#ignore">ignore</a>(), and <a href="#consume">consume</a>().

<h3 class=fn>bool <a name="isConsumed"></a>TQContextMenuEvent::isConsumed () const
</h3>

<p> Returns TRUE (which stops propagation of the event) if the
receiver has blocked the event; otherwise returns FALSE.
<p> <p>See also <a href="#accept">accept</a>(), <a href="#ignore">ignore</a>(), and <a href="#consume">consume</a>().

<h3 class=fn>const&nbsp;<a href="tqpoint.html">TQPoint</a>&nbsp;&amp; <a name="pos"></a>TQContextMenuEvent::pos () const
</h3>

<p> Returns the position of the mouse pointer relative to the widget
that received the event.
<p> <p>See also <a href="#x">x</a>(), <a href="#y">y</a>(), and <a href="#globalPos">globalPos</a>().

<h3 class=fn><a href="tqcontextmenuevent.html#Reason-enum">Reason</a> <a name="reason"></a>TQContextMenuEvent::reason () const
</h3>

<p> Returns the reason for this context event.

<h3 class=fn><a href="tqt.html#ButtonState-enum">ButtonState</a> <a name="state"></a>TQContextMenuEvent::state () const
</h3>

<p> Returns the button state (a combination of mouse buttons and
keyboard modifiers), i.e. what buttons and keys were being
pressed immediately before the event was generated.
<p> The returned value is <a href="tqt.html#ButtonState-enum">LeftButton</a>, <a href="tqt.html#ButtonState-enum">RightButton</a>, <a href="tqt.html#ButtonState-enum">MidButton</a>,
<a href="tqt.html#ButtonState-enum">ShiftButton</a>, <a href="tqt.html#ButtonState-enum">ControlButton</a> and <a href="tqt.html#ButtonState-enum">AltButton</a> OR'ed together.

<h3 class=fn>int <a name="x"></a>TQContextMenuEvent::x () const
</h3>

<p> Returns the x-position of the mouse pointer, relative to the
widget that received the event.
<p> <p>See also <a href="#y">y</a>() and <a href="#pos">pos</a>().

<h3 class=fn>int <a name="y"></a>TQContextMenuEvent::y () const
</h3>

<p> Returns the y-position of the mouse pointer, relative to the
widget that received the event.
<p> <p>See also <a href="#x">x</a>() and <a href="#pos">pos</a>().

<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright &copy; 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>