X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cce442ba7c8506fda1b1bf350390ef06b0863150..4fcf087dda560fd1777daf802f2d834c5d9554d9:/src/motif/window.cpp diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 30f5695703..b2f4037d0e 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -80,6 +80,8 @@ static const int SCROLL_MARGIN = 4; // ---------------------------------------------------------------------------- extern wxHashTable *wxWidgetHashTable; +static wxWindow* g_captureWindow = NULL; + // ---------------------------------------------------------------------------- // private functions @@ -383,6 +385,9 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id, // Destructor wxWindow::~wxWindow() { + if (g_captureWindow == this) + g_captureWindow = NULL; + m_isBeingDeleted = TRUE; // Motif-specific actions first @@ -710,6 +715,7 @@ wxString wxWindow::GetTitle() const void wxWindow::CaptureMouse() { + g_captureWindow = this; if ( m_winCaptured ) return; @@ -722,6 +728,7 @@ void wxWindow::CaptureMouse() void wxWindow::ReleaseMouse() { + g_captureWindow = NULL; if ( !m_winCaptured ) return; @@ -1669,8 +1676,8 @@ bool wxWindow::ProcessAccelerator(wxKeyEvent& event) wxAcceleratorEntry* entry = & (entries[i]); if (entry->MatchesEvent(event)) { - // Bingo, we have a match. Now find a control that matches the entry - // command id. + // Bingo, we have a match. Now find a control that matches the + // entry command id. // Need to go up to the top of the window hierarchy, since it might // be e.g. a menu item @@ -2655,22 +2662,12 @@ bool wxTranslateMouseEvent(wxMouseEvent& wxevent, wxWindow *win, Widget widget, { // I have a dclick win->SetLastClick(0, ts); - switch ( eventType ) - { - case wxEVT_LEFT_DOWN: - eventType = wxEVT_LEFT_DCLICK; - break; - case wxEVT_MIDDLE_DOWN: - eventType = wxEVT_MIDDLE_DCLICK; - break; - case wxEVT_RIGHT_DOWN: - eventType = wxEVT_RIGHT_DCLICK; - break; - - default : - break; - } - + if ( eventType == wxEVT_LEFT_DOWN ) + eventType = wxEVT_LEFT_DCLICK; + else if ( eventType == wxEVT_MIDDLE_DOWN ) + eventType = wxEVT_MIDDLE_DCLICK; + else if ( eventType == wxEVT_RIGHT_DOWN ) + eventType = wxEVT_RIGHT_DCLICK; } else { @@ -2987,6 +2984,13 @@ wxWindow *wxGetActiveWindow() return NULL; } +/* static */ +wxWindow *wxWindowBase::GetCapture() +{ + return (wxWindow *)g_captureWindow; +} + + // Find the wxWindow at the current mouse position, returning the mouse // position. wxWindow* wxFindWindowAtPointer(wxPoint& pt) @@ -3011,12 +3015,10 @@ wxPoint wxGetMousePosition() return wxPoint(rootX, rootY); } + // ---------------------------------------------------------------------------- // wxNoOptimize: switch off size optimization // ---------------------------------------------------------------------------- int wxNoOptimize::ms_count = 0; - - -