wx.CloseEvent Class Reference

Inheritance diagram for wx.CloseEvent:

wx.Event wx.Object

List of all members.

Public Member Functions

 CloseEvent (int type)
 CloseEvent (IntPtr wxObject)
void Veto (bool veto)
void Veto ()


bool CanVeto [get, set]
bool GetVeto [get]
bool LoggingOff [get, set]

Detailed Description

This event class contains information about window and session close events.

The handler function for EVT_CLOSE is called when the user has tried to close a a frame or dialog box using the window manager (X) or system menu (Windows). It can also be invoked by the application itself programmatically, for example by calling the wx.Window.Close() function.

You should check whether the application is forcing the deletion of the window using wx.CloseEvent.CanVeto. If this is false, you must destroy the window using wx.Window.Destroy. If the return value is true, it is up to you whether you respond by destroying the window.

If you don't destroy the window, you should call wx.CloseEvent.Veto to let the calling code know that you did not destroy the window. This allows the wx.Window.Close() function to return true or false depending on whether the close instruction was honoured or not.

Please do not forget to skip the event after processing. wxWidgets may stop closig down the application if the event has not been skipped.

Constructor & Destructor Documentation

wx.CloseEvent.CloseEvent ( IntPtr  wxObject  ) 

wx.CloseEvent.CloseEvent ( int  type  ) 

Member Function Documentation

void wx.CloseEvent.Veto ( bool  veto  ) 

Listeners of this event may veto the closing sequence if they are not ready for closing. Do not forget to skip of not vetoed.

veto True if you want to vetoe, false otherwise.

void wx.CloseEvent.Veto (  ) 

Listeners of this event may veto the closing sequence if they are not ready for closing. Do not forget to skip of not vetoed.

Property Documentation

bool wx.CloseEvent.CanVeto [get, set]

Returns true if you can veto a system shutdown or a window close event. Vetoing a window close event is not possible if the calling code wishes to force the application to exit, and so this function must be called to check this.

bool wx.CloseEvent.GetVeto [get]

bool wx.CloseEvent.LoggingOff [get, set]

Returns true if the user is just logging off or false if the system is shutting down. This method can only be called for end session and query end session events, it doesn't make sense for close window event.

Manual of the wx.NET   (c) 2003-2011 the wx.NET project at   Get wx.NET at SourceForge.net. Fast, secure and Free Open Source software downloads