1 \section{\class{wxCloseEvent
}}\label{wxcloseevent
}
3 This event class contains information about window and session close events.
5 The handler function for EVT
\_CLOSE is called when the user has tried to close a a frame
6 or dialog box using the window manager (X) or system menu (Windows). It can
7 also be invoked by the application itself programmatically, for example by
8 calling the
\helpref{wxWindow::Close
}{wxwindowclose
} function.
10 You should check whether the application is forcing the deletion of the window
11 using
\helpref{wxCloseEvent::CanVeto
}{wxcloseeventcanveto
}. If this is
{\tt false
},
12 you
{\it must
} destroy the window using
\helpref{wxWindow::Destroy
}{wxwindowdestroy
}.
13 If the return value is true, it is up to you whether you respond by destroying the window.
15 If you don't destroy the window, you should call
\helpref{wxCloseEvent::Veto
}{wxcloseeventveto
} to
16 let the calling code know that you did not destroy the window. This allows the
\helpref{wxWindow::Close
}{wxwindowclose
} function
17 to return
{\tt true
} or
{\tt false
} depending on whether the close instruction was honoured or not.
19 \wxheading{Derived from
}
21 \helpref{wxEvent
}{wxevent
}\\
22 \helpref{wxObject
}{wxobject
}
24 \wxheading{Include files
}
30 \helpref{wxCore
}{librarieslist
}
32 \wxheading{Event table macros
}
34 To process a close event, use these event handler macros to direct input to member
35 functions that take a wxCloseEvent argument.
38 \begin{twocollist
}\itemsep=
0pt
39 \twocolitem{{\bf EVT
\_CLOSE(func)
}}{Process a close event, supplying the member function. This
40 event applies to wxFrame and wxDialog classes.
}
41 \twocolitem{{\bf EVT
\_QUERY\_END\_SESSION(func)
}}{Process a query end session event, supplying the member function.
42 This event applies to wxApp only.
}
43 \twocolitem{{\bf EVT
\_END\_SESSION(func)
}}{Process an end session event, supplying the member function.
44 This event applies to wxApp only.
}
49 \helpref{wxWindow::Close
}{wxwindowclose
},
\rtfsp
50 %% GD: OnXXX functions are not documented
51 %%\helpref{wxApp::OnEndSession}{wxapponendsession},\rtfsp
52 \helpref{Window deletion overview
}{windowdeletionoverview
}
54 \latexignore{\rtfignore{\wxheading{Members
}}}
57 \membersection{wxCloseEvent::wxCloseEvent
}\label{wxcloseeventctor
}
59 \func{}{wxCloseEvent
}{\param{WXTYPE
}{ commandEventType =
0},
\param{int
}{ id =
0}}
64 \membersection{wxCloseEvent::CanVeto
}\label{wxcloseeventcanveto
}
66 \func{bool
}{CanVeto
}{\void}
68 Returns true if you can veto a system shutdown or a window close event.
69 Vetoing a window close event is not possible if the calling code wishes to
70 force the application to exit, and so this function must be called to check this.
73 \membersection{wxCloseEvent::GetLoggingOff
}\label{wxcloseeventgetloggingoff
}
75 \constfunc{bool
}{GetLoggingOff
}{\void}
77 Returns true if the user is just logging off or false if the system is
78 shutting down. This method can only be called for end session and query end
79 session events, it doesn't make sense for close window event.
82 \membersection{wxCloseEvent::SetCanVeto
}\label{wxcloseeventsetcanveto
}
84 \func{void
}{SetCanVeto
}{\param{bool
}{ canVeto
}}
86 Sets the 'can veto' flag.
89 \membersection{wxCloseEvent::SetForce
}\label{wxcloseeventsetforce
}
91 \constfunc{void
}{SetForce
}{\param{bool
}{ force
}}
93 Sets the 'force' flag.
96 \membersection{wxCloseEvent::SetLoggingOff
}\label{wxcloseeventsetloggingoff
}
98 \constfunc{void
}{SetLoggingOff
}{\param{bool
}{ loggingOff
}}
100 Sets the 'logging off' flag.
103 \membersection{wxCloseEvent::Veto
}\label{wxcloseeventveto
}
105 \func{void
}{Veto
}{\param{bool
}{ veto = true
}}
107 Call this from your event handler to veto a system shutdown or to signal
108 to the calling application that a window close did not happen.
110 You can only veto a shutdown if
\helpref{wxCloseEvent::CanVeto
}{wxcloseeventcanveto
} returns