Handle window close message in painter

--HG--
branch : develop
This commit is contained in:
kaetemi 2014-12-09 23:06:07 +01:00
parent 90f1234ed0
commit 56339c6f93

View file

@ -3043,7 +3043,7 @@ private:
// Callback on mouse events // Callback on mouse events
virtual void operator ()(const CEvent& event) virtual void operator ()(const CEvent& event)
{ {
if (event==EventDestroyWindowId) if (event==EventDestroyWindowId || event==EventCloseWindowId)
{ {
WindowActive=false; WindowActive=false;
} }
@ -4287,6 +4287,7 @@ DWORD WINAPI myThread (LPVOID vData)
CNELU::EventServer.addListener (EventMouseUpId, &listener); CNELU::EventServer.addListener (EventMouseUpId, &listener);
CNELU::EventServer.addListener (EventMouseDblClkId, &listener); CNELU::EventServer.addListener (EventMouseDblClkId, &listener);
CNELU::EventServer.addListener (EventDestroyWindowId, &listener); CNELU::EventServer.addListener (EventDestroyWindowId, &listener);
CNELU::EventServer.addListener (EventCloseWindowId, &listener);
CNELU::EventServer.addListener (EventKeyDownId, &listener); CNELU::EventServer.addListener (EventKeyDownId, &listener);
// Camera position // Camera position
@ -4356,6 +4357,7 @@ DWORD WINAPI myThread (LPVOID vData)
CNELU::EventServer.removeListener (EventMouseDblClkId, &listener); CNELU::EventServer.removeListener (EventMouseDblClkId, &listener);
CNELU::EventServer.removeListener (EventKeyDownId, &listener); CNELU::EventServer.removeListener (EventKeyDownId, &listener);
CNELU::EventServer.removeListener (EventDestroyWindowId, &listener); CNELU::EventServer.removeListener (EventDestroyWindowId, &listener);
CNELU::EventServer.removeListener (EventCloseWindowId, &listener);
// End. // End.
//======== //========