]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/event.tex
new wxWindow::FindWindowByXXX() methods replacing the old global functions
[wxWidgets.git] / docs / latex / wx / event.tex
CommitLineData
a660d684
KB
1\section{\class{wxEvent}}\label{wxevent}
2
3An event is a structure holding information about an event passed to a
4callback or member function. {\bf wxEvent} used to be a multipurpose
5event object, and is an abstract base class for other event classes (see below).
6
7\wxheading{Derived from}
8
9\helpref{wxObject}{wxobject}
10
954b8ae6
JS
11\wxheading{Include files}
12
13<wx/event.h>
14
a660d684
KB
15\wxheading{See also}
16
17\helpref{wxCommandEvent}{wxcommandevent},\rtfsp
18\helpref{wxMouseEvent}{wxmouseevent}
19
20\latexignore{\rtfignore{\wxheading{Members}}}
21
22\membersection{wxEvent::wxEvent}
23
d5f648a9 24\func{}{wxEvent}{\param{int }{id = 0}, \param{wxEventType }{eventType = {\tt wxEVT\_NULL}}}
a660d684
KB
25
26Constructor. Should not need to be used directly by an application.
27
a660d684
KB
28\membersection{wxEvent::m\_eventObject}
29
30\member{wxObject*}{m\_eventObject}
31
32The object (usually a window) that the event was generated from,
33or should be sent to.
34
35\membersection{wxEvent::m\_eventType}
36
37\member{WXTYPE}{m\_eventType}
38
39The type of the event, such as wxEVENT\_TYPE\_BUTTON\_COMMAND.
40
41\membersection{wxEvent::m\_id}
42
43\member{int}{m\_id}
44
45Identifier for the window.
46
47\membersection{wxEvent::m\_skipped}
48
49\member{bool}{m\_skipped}
50
51Set to TRUE by {\bf Skip} if this event should be skipped.
52
53\membersection{wxEvent::m\_timeStamp}
54
55\member{long}{m\_timeStamp}
56
57Timestamp for this event.
58
8e72b8b5
RR
59\membersection{wxEvent::Clone}\label{wxeventclone}
60
d5f648a9 61\constfunc{virtual wxEvent*}{Clone}{\void}
8e72b8b5
RR
62
63Returns a copy of the event.
64
65Any event that is posted to the wxWindows event system for later action (via
66\helpref{wxEvtHandler::AddPendingEvent}{wxevthandleraddpendingevent} or
67\helpref{wxPostEvent}{wxpostevent}) must implement this method. All wxWindows
68events fully implement this method, but any derived events implemented by the
69user should also implement this method just in case they (or some event
70derived from them) are ever posted.
71
72All wxWindows events implement a copy constructor, so the easiest way of
73implementing the Clone function is to implement a copy constructor for
74a new event (call it MyEvent) and then define the Clone function like this:
75\begin{verbatim}
76 wxEvent *Clone(void) const { return new MyEvent(*this); }
77\end{verbatim}
78
a660d684
KB
79\membersection{wxEvent::GetEventObject}
80
81\func{wxObject*}{GetEventObject}{\void}
82
83Returns the object associated with the
84event, if any.
85
86\membersection{wxEvent::GetEventType}
87
88\func{WXTYPE}{GetEventType}{\void}
89
90Returns the identifier of the given event type,
91such as wxEVENT\_TYPE\_BUTTON\_COMMAND.
92
93\membersection{wxEvent::GetId}
94
95\func{int}{GetId}{\void}
96
97Returns the identifier associated with this event, such as a button command id.
98
99\membersection{wxEvent::GetObjectType}
100
101\func{WXTYPE}{GetObjectType}{\void}
102
103Returns the type of the object associated with the
104event, such as wxTYPE\_BUTTON.
105
106\membersection{wxEvent::GetSkipped}
107
108\func{bool}{GetSkipped}{\void}
109
110Returns TRUE if the event handler should be skipped, FALSE otherwise.
111
112\membersection{wxEvent::GetTimestamp}
113
114\func{long}{GetTimestamp}{\void}
115
116Gets the timestamp for the event.
117
118\membersection{wxEvent::SetEventObject}
119
120\func{void}{SetEventObject}{\param{wxObject* }{object}}
121
122Sets the originating object.
123
124\membersection{wxEvent::SetEventType}
125
126\func{void}{SetEventType}{\param{WXTYPE }{typ}}
127
128Sets the event type.
129
130\membersection{wxEvent::SetId}
131
132\func{void}{SetId}{\param{int}{ id}}
133
134Sets the identifier associated with this event, such as a button command id.
135
136\membersection{wxEvent::SetTimestamp}
137
138\func{void}{SetTimestamp}{\param{long }{timeStamp}}
139
140Sets the timestamp for the event.
141
142Sets the originating object.
143
144\membersection{wxEvent::Skip}\label{wxeventskip}
145
146\func{void}{Skip}{\param{bool}{ skip = TRUE}}
147
148Called by an event handler to tell the event system that the
149event handler should be skipped, and the next valid handler used
150instead.
151