X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b95edd4708105589d03267b5932f3a42e89b0d06..5ed738a766bb06539893bd424759e75926c43e15:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 2f540c96cd..6ffcaea012 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -152,6 +152,7 @@ void wxWindowBase::InitBase() m_constraints = (wxLayoutConstraints *) NULL; m_constraintsInvolvedIn = (wxWindowList *) NULL; m_windowSizer = (wxSizer *) NULL; + m_containingSizer = (wxSizer *) NULL; m_autoLayout = FALSE; #endif // wxUSE_CONSTRAINTS @@ -257,6 +258,9 @@ wxWindowBase::~wxWindowBase() m_constraints = NULL; } + if ( m_containingSizer ) + m_containingSizer->Remove((wxWindow*)this); + if ( m_windowSizer ) delete m_windowSizer; @@ -401,14 +405,18 @@ void wxWindowBase::Centre(int direction) wxRect rect = wxGetClientDisplayRect(); wxSize size (rect.width,rect.height); +#ifndef __WXMGL__ // FIXME - temporary dirty hack!! if (posParent.x >= 0) // if parent is on the main display +#endif { if (xNew < 0) xNew = 0; else if (xNew+width > size.x) xNew = size.x-width-1; } +#ifndef __WXMGL__ // FIXME - temporary dirty hack!! if (posParent.y >= 0) // if parent is on the main display +#endif { if (yNew+height > size.y) yNew = size.y-height-1; @@ -1190,9 +1198,6 @@ bool wxWindowBase::Layout() GetClientSize(&w, &h); GetSizer()->SetDimension( 0, 0, w, h ); -#if defined __WXPM__ - OS2Layout(w, h); -#endif } else { @@ -1703,6 +1708,11 @@ void wxWindowBase::CaptureMouse() wxWindow *winOld = GetCapture(); if ( winOld ) { + // I think this is correct, but not compatible with some ports +#if defined(__WXX11__) || defined(__WXMGL__) + ((wxWindowBase*) winOld)->DoReleaseMouse(); +#endif + // save it on stack wxWindowNext *item = new wxWindowNext; item->win = winOld; @@ -1724,8 +1734,13 @@ void wxWindowBase::ReleaseMouse() if ( ms_winCaptureNext ) { + // I think this is correct, but not compatible with some ports +#if defined(__WXX11__) || defined(__WXMGL__) + ((wxWindowBase*)ms_winCaptureNext->win)->DoCaptureMouse(); +#else ms_winCaptureNext->win->CaptureMouse(); - +#endif + wxWindowNext *item = ms_winCaptureNext; ms_winCaptureNext = item->next; delete item;