void wxIFMFloatingWindowBase::OnMoving(wxMoveEvent &event) { wxIFMFloatingMoveEvent moveevt( (event.GetEventType() == wxEVT_MOVE ? wxEVT_IFM_FLOATING_MOVE : wxEVT_IFM_FLOATING_MOVING), this, event); if( !GetIP()->ProcessPluginEvent(moveevt) ) event.Skip(); }
void wxAuiFloatingFrame::OnMoveEvent(wxMoveEvent& event) { if (!m_solidDrag) { // systems without solid window dragging need to be // handled slightly differently, due to the lack of // the constant stream of EVT_MOVING events if (!isMouseDown()) return; OnMoveStart(); OnMoving(event.GetRect(), wxNORTH); m_moving = true; return; } wxRect winRect = GetRect(); if (winRect == m_lastRect) return; // skip the first move event if (m_lastRect.IsEmpty()) { m_lastRect = winRect; return; } // as on OSX moving windows are not getting all move events, only sporadically, this difference // is almost always big on OSX, so avoid this early exit opportunity #ifndef __WXOSX__ // skip if moving too fast to avoid massive redraws and // jumping hint windows if ((abs(winRect.x - m_lastRect.x) > 3) || (abs(winRect.y - m_lastRect.y) > 3)) { m_last3Rect = m_last2Rect; m_last2Rect = m_lastRect; m_lastRect = winRect; // However still update the internally stored position to avoid // snapping back to the old one later. if (m_ownerMgr) { m_ownerMgr->GetPane(m_paneWindow). floating_pos = winRect.GetPosition(); } return; } #endif // prevent frame redocking during resize if (m_lastRect.GetSize() != winRect.GetSize()) { m_last3Rect = m_last2Rect; m_last2Rect = m_lastRect; m_lastRect = winRect; return; } wxDirection dir = wxALL; int horiz_dist = abs(winRect.x - m_last3Rect.x); int vert_dist = abs(winRect.y - m_last3Rect.y); if (vert_dist >= horiz_dist) { if (winRect.y < m_last3Rect.y) dir = wxNORTH; else dir = wxSOUTH; } else { if (winRect.x < m_last3Rect.x) dir = wxWEST; else dir = wxEAST; } m_last3Rect = m_last2Rect; m_last2Rect = m_lastRect; m_lastRect = winRect; if (!isMouseDown()) return; if (!m_moving) { OnMoveStart(); m_moving = true; } if (m_last3Rect.IsEmpty()) return; if ( event.GetEventType() == wxEVT_MOVING ) OnMoving(event.GetRect(), dir); else OnMoving(wxRect(event.GetPosition(),GetSize()), dir); }