fix wxWindow::PushEventHandler and related wxWindow functions for the stack management; currently they don't work well when passing event handlers which are part of an event handler chain (see wx-dev thread 'wxWindow event handler stack'); implement wxEvtHandler Unlink() and IsUnlinked() functions and document them; revise docs of all involved functions of both wxEvtHandler and wxWindow, adding images for better explanations

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58291 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2009-01-22 11:53:09 +00:00
parent 47009083ce
commit 7f853dd046
16 changed files with 303 additions and 119 deletions

View File

@@ -1036,12 +1036,7 @@ wxEvtHandler::wxEvtHandler()
wxEvtHandler::~wxEvtHandler()
{
// Takes itself out of the list of handlers
if (m_previousHandler)
m_previousHandler->m_nextHandler = m_nextHandler;
if (m_nextHandler)
m_nextHandler->m_previousHandler = m_previousHandler;
Unlink();
if (m_dynamicEvents)
{
@@ -1103,6 +1098,26 @@ wxEvtHandler::~wxEvtHandler()
delete m_clientObject;
}
void wxEvtHandler::Unlink()
{
// this event handler must take itself out of the chain of handlers:
if (m_previousHandler)
m_previousHandler->SetNextHandler(m_nextHandler);
if (m_nextHandler)
m_nextHandler->SetPreviousHandler(m_previousHandler);
m_nextHandler = NULL;
m_previousHandler = NULL;
}
bool wxEvtHandler::IsUnlinked() const
{
return m_previousHandler == NULL &&
m_nextHandler == NULL;
}
#if wxUSE_THREADS
bool wxEvtHandler::ProcessThreadEvent(const wxEvent& event)