-void wxInteractiveMoveHandler::OnMouseMove(wxMouseEvent& event)
-{
- if ( m_data.m_flags & wxINTERACTIVE_WAIT_FOR_INPUT )
- event.Skip();
-
- else if ( m_data.m_flags & wxINTERACTIVE_MOVE )
- {
- wxPoint diff = wxGetMousePosition() - m_data.m_pos;
- m_data.m_rect = m_data.m_rectOrig;
- m_data.m_rect.Offset(diff);
- m_data.m_window->Move(m_data.m_rect.GetPosition());
- }
-
- else if ( m_data.m_flags & wxINTERACTIVE_RESIZE )
- {
- wxPoint diff = wxGetMousePosition() - m_data.m_pos;
- m_data.m_rect = m_data.m_rectOrig;
- wxApplyResize(m_data, diff);
- m_data.m_window->SetSize(m_data.m_rect);
- }
-}
-
-void wxInteractiveMoveHandler::OnMouseDown(wxMouseEvent& event)
-{
- if ( m_data.m_flags & wxINTERACTIVE_WAIT_FOR_INPUT )
- {
- m_data.m_flags &= ~wxINTERACTIVE_WAIT_FOR_INPUT;
- m_data.m_pos = wxGetMousePosition();
- }
-}
-
-void wxInteractiveMoveHandler::OnKeyDown(wxKeyEvent& event)
-{
- if ( m_data.m_flags & wxINTERACTIVE_WAIT_FOR_INPUT )
- {
- m_data.m_flags &= ~wxINTERACTIVE_WAIT_FOR_INPUT;
- m_data.m_pos = wxGetMousePosition();
- }
-
- wxPoint diff(-1,-1);
-
- switch ( event.GetKeyCode() )
- {
- case WXK_UP: diff = wxPoint(0, -16); break;
- case WXK_DOWN: diff = wxPoint(0, 16); break;
- case WXK_LEFT: diff = wxPoint(-16, 0); break;
- case WXK_RIGHT: diff = wxPoint(16, 0); break;
- case WXK_ESCAPE:
- m_data.m_window->SetSize(m_data.m_rectOrig);
- m_data.m_evtLoop->Exit();
- return;
- case WXK_RETURN:
- m_data.m_evtLoop->Exit();
- return;
- }
-
- if ( diff.x != -1 )
- {
- if ( m_data.m_flags & wxINTERACTIVE_MOVE )
- {
- m_data.m_rect.Offset(diff);
- m_data.m_window->Move(m_data.m_rect.GetPosition());
- }
- else /* wxINTERACTIVE_RESIZE */
- {
- if ( !(m_data.m_flags & wxINTERACTIVE_RESIZE_DIR) )
- {
- if ( diff.y < 0 )
- m_data.m_flags |= wxINTERACTIVE_RESIZE_N;
- else if ( diff.y > 0 )
- m_data.m_flags |= wxINTERACTIVE_RESIZE_S;
- if ( diff.x < 0 )
- m_data.m_flags |= wxINTERACTIVE_RESIZE_W;
- else if ( diff.x > 0 )
- m_data.m_flags |= wxINTERACTIVE_RESIZE_E;
- }
-
- wxApplyResize(m_data, diff);
- m_data.m_window->SetSize(m_data.m_rect);
- }
- }
-}
-
-void wxInteractiveMoveHandler::OnMouseUp(wxMouseEvent& event)
-{
- m_data.m_evtLoop->Exit();
-}
-
-
-void wxTopLevelWindowBase::InteractiveMove(int flags)