X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/532372a31c2786eef1c84c0c17c031fa02105d1e..93fa67c0e6124d2657488971800c8fd068dc0d0e:/docs/latex/wx/tdelwin.tex diff --git a/docs/latex/wx/tdelwin.tex b/docs/latex/wx/tdelwin.tex index f9df4e54f0..b5864727a8 100644 --- a/docs/latex/wx/tdelwin.tex +++ b/docs/latex/wx/tdelwin.tex @@ -10,14 +10,14 @@ to close windows. When the user clicks on the system close button or system close command, in a frame or a dialog, wxWindows calls \helpref{wxWindow::Close}{wxwindowclose}. This -in turn generates an EVT\_CLOSE event: see \helpref{wxWindow::OnCloseWindow}{wxwindowonclosewindow}. +in turn generates an EVT\_CLOSE event: see \helpref{wxCloseEvent}{wxcloseevent}. It is the duty of the application to define a suitable event handler, and decide whether or not to destroy the window. If the application is for some reason forcing the application to close -(\helpref{wxCloseEvent::CanVeto}{wxcloseeventcanveto} returns FALSE), the window should always be destroyed, otherwise there is the option to +(\helpref{wxCloseEvent::CanVeto}{wxcloseeventcanveto} returns false), the window should always be destroyed, otherwise there is the option to ignore the request, or maybe wait until the user has answered a question -before deciding whether it's safe to close. The handler for EVT\_CLOSE should +before deciding whether it is safe to close. The handler for EVT\_CLOSE should signal to the calling code if it does not destroy the window, by calling \helpref{wxCloseEvent::Veto}{wxcloseeventveto}. Calling this provides useful information to the calling code. @@ -35,13 +35,13 @@ certain that the window is destroyed. Your application can either use \helpref{wxWindow::Close}{wxwindowclose} event just as the framework does, or it can call \helpref{wxWindow::Destroy}{wxwindowdestroy} directly. -If using Close(), you can pass a TRUE argument to this function to tell the event handler +If using Close(), you can pass a true argument to this function to tell the event handler that we definitely want to delete the frame and it cannot be vetoed. The advantage of using Close instead of Destroy is that it will call any clean-up code defined by the EVT\_CLOSE handler; for example it may close a document contained in a window after first asking the user whether the work should be saved. Close can be vetoed -by this process (return FALSE), whereas Destroy definitely destroys the window. +by this process (return false), whereas Destroy definitely destroys the window. \wxheading{What is the default behaviour?} @@ -53,9 +53,9 @@ In other words, by default, the dialog {\it is not destroyed} (it might have bee on the stack, so the assumption of dynamic creation cannot be made). The default close event handler for wxFrame destroys the frame using Destroy(). - -Under Windows, wxDialog defines a handler for \helpref{wxWindow::OnCharHook}{wxwindowoncharhook} that -generates a Cancel event if the Escape key has been pressed. +% +%Under Windows, wxDialog defines a handler for \helpref{wxWindow::OnCharHook}{wxwindowoncharhook} that +%generates a Cancel event if the Escape key has been pressed. \wxheading{What should I do when the user calls up Exit from a menu?} @@ -70,7 +70,7 @@ the exit command altogether. \wxheading{What should I do to upgrade my 1.xx OnClose to 2.0?} -In wxWindows 1.xx, the {\bf OnClose} function did not actually delete 'this', but signalled +In wxWindows 1.xx, the {\bf OnClose} function did not actually delete 'this', but signaled to the calling function (either {\bf Close}, or the wxWindows framework) to delete or not delete the window.