]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/closeevt.tex
don't call wxYield() from EnsureVisible(), this is too dangerous - and unnecessary...
[wxWidgets.git] / docs / latex / wx / closeevt.tex
CommitLineData
a660d684
KB
1\section{\class{wxCloseEvent}}\label{wxcloseevent}
2
3This event class contains information about window and session close events.
4
5\wxheading{Derived from}
6
7\helpref{wxEvent}{wxevent}
8
954b8ae6
JS
9\wxheading{Include files}
10
11<wx/event.h>
12
a660d684
KB
13\wxheading{Event table macros}
14
15To process a close event, use these event handler macros to direct input to member
16functions that take a wxCloseEvent argument.
17
18\twocolwidtha{7cm}
19\begin{twocollist}\itemsep=0pt
387a3b02
JS
20\twocolitem{{\bf EVT\_CLOSE(func)}}{Process a close event, supplying the member function. This
21event applies to wxFrame and wxDialog classes.}
22\twocolitem{{\bf EVT\_QUERY\_END\_SESSION(func)}}{Process a query end session event, supplying the member function.
23This event applies to wxApp only.}
2432b92d 24\twocolitem{{\bf EVT\_END\_SESSION(func)}}{Process an end session event, supplying the member function.
387a3b02 25This event applies to wxApp only.}
a660d684
KB
26\end{twocollist}%
27
28\wxheading{See also}
29
30\helpref{wxWindow::OnCloseWindow}{wxwindowonclosewindow},\rtfsp
31\helpref{wxWindow::Close}{wxwindowclose},\rtfsp
da36f544
JS
32\helpref{wxApp::OnQueryEndSession}{wxapponqueryendsession},\rtfsp
33\helpref{wxApp::OnEndSession}{wxapponendsession},\rtfsp
a660d684
KB
34\helpref{Window deletion overview}{windowdeletionoverview}
35
36\latexignore{\rtfignore{\wxheading{Members}}}
37
38\membersection{wxCloseEvent::wxCloseEvent}
39
40\func{}{wxCloseEvent}{\param{WXTYPE}{ commandEventType = 0}, \param{int}{ id = 0}}
41
42Constructor.
43
387a3b02
JS
44\membersection{wxCloseEvent::CanVeto}\label{wxcloseeventcanveto}
45
46\func{bool}{CanVeto}{\void}
47
48Returns TRUE if you can veto a system shutdown or a window close event.
49Vetoing a window close event is not possible if the calling code wishes to
50force the application to exit, and so this function must be called to check this.
51
a660d684
KB
52\membersection{wxCloseEvent::GetLoggingOff}\label{wxcloseeventgetloggingoff}
53
54\constfunc{bool}{GetLoggingOff}{\void}
55
56Returns TRUE if the user is logging off.
57
58\membersection{wxCloseEvent::GetSessionEnding}\label{wxcloseeventgetsessionending}
59
60\constfunc{bool}{GetSessionEnding}{\void}
61
62Returns TRUE if the session is ending.
63
64\membersection{wxCloseEvent::GetForce}\label{wxcloseeventgetforce}
65
387a3b02 66\constfunc{bool}{GetForce}{\void}
a660d684
KB
67
68Returns TRUE if the application wishes to force the window to close.
387a3b02
JS
69This will shortly be obsolete, replaced by CanVeto.
70
71\membersection{wxCloseEvent::SetCanVeto}\label{wxcloseeventsetcanveto}
72
73\func{void}{SetCanVeto}{\param{bool}{ canVeto}}
74
75Sets the 'can veto' flag.
76
77\membersection{wxCloseEvent::SetForce}\label{wxcloseeventsetforce}
78
79\constfunc{void}{SetForce}{\param{bool}{ force}}
80
81Sets the 'force' flag.
82
83\membersection{wxCloseEvent::SetLoggingOff}\label{wxcloseeventsetloggingoff}
84
85\constfunc{void}{SetLoggingOff}{\param{bool}{ loggingOff}}
86
87Sets the 'logging off' flag.
a660d684
KB
88
89\membersection{wxCloseEvent::Veto}\label{wxcloseeventveto}
90
387a3b02
JS
91\func{void}{Veto}{\param{bool}{ veto = TRUE}}
92
93Call this from your event handler to veto a system shutdown or to signal
94to the calling application that a window close did not happen.
a660d684 95
387a3b02
JS
96You can only veto a shutdown if \helpref{wxCloseEvent::CanVeto}{wxcloseeventcanveto} returns
97TRUE.
a660d684
KB
98
99