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:
@@ -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
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user