maintaint the mouse capture stack in all ports, not just wxUniv

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-01-19 19:31:19 +00:00
parent aa8a815b84
commit 94633ad9f1
10 changed files with 92 additions and 89 deletions

View File

@@ -933,53 +933,6 @@ wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal)
return rect;
}
// ----------------------------------------------------------------------------
// mouse capture
// ----------------------------------------------------------------------------
struct WXDLLEXPORT wxWindowNext
{
wxWindow *win;
wxWindowNext *next;
} *wxWindow::ms_winCaptureNext = NULL;
void wxWindow::CaptureMouse()
{
wxLogTrace(_T("mousecapture"), _T("CaptureMouse(0x%08x)"), this);
wxWindow *winOld = GetCapture();
if ( winOld )
{
// save it on stack
wxWindowNext *item = new wxWindowNext;
item->win = winOld;
item->next = ms_winCaptureNext;
ms_winCaptureNext = item;
}
//else: no mouse capture to save
wxWindowNative::CaptureMouse();
}
void wxWindow::ReleaseMouse()
{
wxWindowNative::ReleaseMouse();
if ( ms_winCaptureNext )
{
ms_winCaptureNext->win->CaptureMouse();
wxWindowNext *item = ms_winCaptureNext;
ms_winCaptureNext = item->next;
delete item;
}
//else: stack is empty, no previous capture
wxLogTrace(_T("mousecapture"),
_T("After ReleaseMouse() mouse is captured by 0x%08x"),
GetCapture());
}
// ----------------------------------------------------------------------------
// accelerators and menu hot keys
// ----------------------------------------------------------------------------