File: cs_233.html

package info (click to toggle)
crystalspace 0.94-20020412-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 62,276 kB
  • ctags: 52,843
  • sloc: cpp: 274,783; ansic: 6,608; perl: 6,276; objc: 3,952; asm: 2,942; python: 2,354; php: 542; pascal: 530; sh: 430; makefile: 370; awk: 193
file content (127 lines) | stat: -rw-r--r-- 5,368 bytes parent folder | download
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created by texi2html 1.64 -->
<!-- 
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
 
-->
<HTML>
<HEAD>
<TITLE>Crystal Space: AWS Component Events</TITLE>

<META NAME="description" CONTENT="Crystal Space: AWS Component Events">
<META NAME="keywords" CONTENT="Crystal Space: AWS Component Events">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.64">

</HEAD>

<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">

<A NAME="SEC566"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_232.html#SEC565"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_234.html#SEC567"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_230.html#SEC563"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_231.html#SEC564"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_235.html#SEC568"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_285.html#SEC711">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<HR SIZE=1>
<H4> 7.12.3.2 Events: Responding To User Actions </H4>
<!--docid::SEC566::-->
<P>

Events are broken out into <CODE>OnBlah()</CODE> functions. The
parameters for those events are also broken out and passed to the
functions. At the end of any of the <CODE>OnBlah()</CODE> event
functions (except <CODE>OnDraw()</CODE>) you should return `<SAMP>true</SAMP>' if the
event was used by you, otherwise return `<SAMP>false</SAMP>'. You <EM>must</EM>
override <EM>all</EM> event functions, even if you don't use them
all. If you will not use a particular event, just return `<SAMP>false</SAMP>'.
</P><P>

It's important to note that you will only receive events that
apply to your component. For example, if the mouse is inside
your component, you will receive all mouse events. However, once
the mouse leaves the confines of your borders you will no longer
receive <EM>any</EM> mouse events. The only exception to this is
the <CODE>OnMouseExit()</CODE> event which is sent to the component that
just lost the mouse.
</P><P>

The following is the list of all events understood by components:
</P><P>

<DL COMPACT>
<DT><CODE>virtual bool OnMouseDown(int button, int x, int y)</CODE>
<DD>Triggered when the user presses a mouse button.
<P>

<DT><CODE>virtual bool OnMouseUp(int button, int x, int y)</CODE>
<DD>Triggered when the user releases a mouse button.
<P>

<DT><CODE>virtual bool OnMouseMove(int button, int x, int y)</CODE>
<DD>Triggered when the user moves the mouse.
<P>

<DT><CODE>virtual bool OnMouseClick(int button, int x, int y)</CODE>
<DD>Triggered when the user clicks the mouse.
<P>

<DT><CODE>virtual bool OnMouseDoubleClick(int button, int x, int y)</CODE>
<DD>Triggered when the user double clicks the mouse.
<P>

<DT><CODE>virtual bool OnMouseExit()</CODE>
<DD>Triggered when this component loses mouse focus.
<P>

<DT><CODE>virtual bool OnMouseEnter()</CODE>
<DD>Triggered when this component gains mouse focus.
<P>

<DT><CODE>virtual bool OnKeypress(int key, int modifiers)</CODE>
<DD>Triggered when the user presses a key.
<P>

<DT><CODE>virtual bool OnLostFocus()</CODE>
<DD>Triggered when the keyboard focus is lost.
<P>

<DT><CODE>virtual bool OnGainFocus()</CODE>
<DD>Triggered when the keyboard focus is gained.
</DL>
<P>

<A NAME="AWS Component Signals"></A>
<HR SIZE=1>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_232.html#SEC565"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_234.html#SEC567"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_230.html#SEC563"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_231.html#SEC564"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_235.html#SEC568"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_285.html#SEC711">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<BR>  
<FONT SIZE="-1">
This document was generated

using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>

</BODY>
</HTML>