X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7e55544629f172d617ad2d3772fe615bf5cd4830..a696db453c79ff58509195244bcf260dfdf13c81:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index e0d1e1af70..205402dd18 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -71,7 +71,11 @@ // static data // ---------------------------------------------------------------------------- +#if defined(__WXPM__) +int wxWindowBase::ms_lastControlId = 2000; +#else int wxWindowBase::ms_lastControlId = -200; +#endif IMPLEMENT_ABSTRACT_CLASS(wxWindowBase, wxEvtHandler) @@ -722,7 +726,13 @@ bool wxWindowBase::Reparent(wxWindowBase *newParent) void wxWindowBase::PushEventHandler(wxEvtHandler *handler) { - handler->SetNextHandler(GetEventHandler()); + wxEvtHandler *handlerOld = GetEventHandler(); + + handler->SetNextHandler(handlerOld); + + if ( handlerOld ) + GetEventHandler()->SetPreviousHandler(handler); + SetEventHandler(handler); } @@ -733,7 +743,11 @@ wxEvtHandler *wxWindowBase::PopEventHandler(bool deleteHandler) { wxEvtHandler *handlerB = handlerA->GetNextHandler(); handlerA->SetNextHandler((wxEvtHandler *)NULL); + + if ( handlerB ) + handlerB->SetPreviousHandler((wxEvtHandler *)NULL); SetEventHandler(handlerB); + if ( deleteHandler ) { delete handlerA; @@ -765,6 +779,10 @@ bool wxWindowBase::RemoveEventHandler(wxEvtHandler *handler) SetEventHandler(handlerNext); } + if ( handlerNext ) + { + handlerNext->SetPreviousHandler ( handlerPrev ); + } handler->SetNextHandler(NULL); return TRUE; @@ -1958,7 +1976,7 @@ void wxWindowBase::CaptureMouse() if ( winOld ) { ((wxWindowBase*) winOld)->DoReleaseMouse(); - + // save it on stack wxWindowNext *item = new wxWindowNext; item->win = winOld; @@ -1981,7 +1999,7 @@ void wxWindowBase::ReleaseMouse() if ( ms_winCaptureNext ) { ((wxWindowBase*)ms_winCaptureNext->win)->DoCaptureMouse(); - + wxWindowNext *item = ms_winCaptureNext; ms_winCaptureNext = item->next; delete item;