Window.QueryClose Method | |
Provide a method that is invoked just before the window closes to confirm if the application really wants to close the window.
Namespace:
VO
Assembly:
VOGUIClasses (in VOGUIClasses.dll) Version: 2.21
Syntax VIRTUAL METHOD QueryClose(
oEvent
) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public virtual Usual QueryClose(
Usual oEvent = default
)
Request Example
View SourceParameters
- oEvent (Optional)
- Type: Usual
An empty event required to maintain the protocol that all event handlers have exactly one event as their argument.
Return Value
Type:
Usual
The method inside the window class always returns TRUE.
If you override this method in your subclass then you must return TRUE if the window is to be closed; otherwise, return FALSE.
Remarks Tip |
---|
Important! This is a callback method used by X#.
Normally, it should not be called in your application code.
|
When a user tries to close an application by selecting the Close menu command from a system menu (or by using another method to end the session), the system calls each window's QueryClose() event handler.
Tip |
---|
If you reimplement this method in your subclass, it is recommended that you first call SUPER:QueryClose() within the method to obtain its default behavior. |
Examples
This example displays a message box to confirm that a user wants to quit the application. If a user chooses YES, TRUE is returned (otherwise, FALSE is returned).
1METHOD QueryClose(oEvent) CLASS TopAppWindow
2oTB := TextBox{SELF, "Quit", "Do you really want to quit?"}
3oTB:TYPE := BOXICONQUESTIONMARK + BUTTONYESNO
4IF (oTB:Show() = BOXREPLYYES)
5RETURN TRUE
6ELSE
7RETURN FALSE
8
9END
See Also