void MainEmuFrame::OnMoveAround( wxMoveEvent& evt ) { if( IsBeingDeleted() || !IsVisible() || IsIconized() ) return; // Uncomment this when doing logger stress testing (and then move the window around // while the logger spams itself) // ... makes for a good test of the message pump's responsiveness. if( EnableThreadedLoggingTest ) Console.Warning( "Threaded Logging Test! (a window move event)" ); // evt.GetPosition() returns the client area position, not the window frame position. // So read the window's screen-relative position directly. g_Conf->MainGuiPosition = GetScreenPosition(); // wxGTK note: X sends gratuitous amounts of OnMove messages for various crap actions // like selecting or deselecting a window, which muck up docking logic. We filter them // out using 'lastpos' here. :) static wxPoint lastpos( wxDefaultCoord, wxDefaultCoord ); if( lastpos == evt.GetPosition() ) return; lastpos = evt.GetPosition(); if( g_Conf->ProgLogBox.AutoDock ) { g_Conf->ProgLogBox.DisplayPosition = GetRect().GetTopRight(); if( ConsoleLogFrame* proglog = wxGetApp().GetProgramLog() ) proglog->SetPosition( g_Conf->ProgLogBox.DisplayPosition ); } evt.Skip(); }
void NyqBench::OnMove(wxMoveEvent & e) { e.Skip(); if (!IsIconized() && !IsMaximized()) { mLastSize.SetPosition(e.GetPosition()); } }
void AISTargetQueryDialog::OnMove( wxMoveEvent& event ) { // Record the dialog position wxPoint p = event.GetPosition(); g_ais_query_dialog_x = p.x; g_ais_query_dialog_y = p.y; event.Skip(); }
void CM93DSlide::OnMove( wxMoveEvent& event ) { // Record the dialog position wxPoint p = event.GetPosition(); g_cm93detail_dialog_x = p.x; g_cm93detail_dialog_y = p.y; event.Skip(); }
void PopUpDSlide::OnMove( wxMoveEvent& event ) { // Record the dialog position wxPoint p = event.GetPosition(); g_detailslider_dialog_x = p.x; g_detailslider_dialog_y = p.y; event.Skip(); }
void ConfigDialog::OnMove( wxMoveEvent& event ) { _gCfgDlgPos = event.GetPosition(); #ifdef __WINDOWS__ // HACK::...... _gCfgDlgPos.y -= 23; // title-bar? _gCfgDlgPos.x -= 4; #endif }
void wxG3DCanvas::handleWindowMove(wxMoveEvent& event) { wxPoint& point = event.GetPosition(); _gWindow->clientX = point.x; _gWindow->clientY = point.y; _gWindow->settings.x = point.x; _gWindow->settings.y = point.y; event.Skip(); }
void MyChild::OnMove(wxMoveEvent& event) { // VZ: here everything is totally wrong under MSW, the positions are // different and both wrong (pos2 is off by 2 pixels for me which seems // to be the width of the MDI canvas border) wxPoint pos1 = event.GetPosition(), pos2 = GetPosition(); wxLogStatus("position from event: (%d, %d), from frame (%d, %d)", pos1.x, pos1.y, pos2.x, pos2.y); event.Skip(); }
void WXAppBar::OnMove( wxMoveEvent& event ) { #if defined(__WXMSW__) SetSize(m_X, m_Y, m_Width, m_Height, 0); Raise (); #endif wxPoint p= event.GetPosition(); // printf ("onMove: %d, %d, orig: %d, %d\n", p.x, p.y, m_X, m_Y); // wxDialog::OnMove (event); event.Skip(); }
/* * Check the initial placement of the window. We get one of these messages * when the window is first placed, and every time it's moved thereafter. * * Right now we're just trying to make sure wxWidgets doesn't shove it off * the top of the screen under Linux. Might want to change this to * remember the previous placement and put the window back. */ void PhoneWindow::OnMove(wxMoveEvent& event) { if (mPlacementChecked) return; wxPoint point; point = event.GetPosition(); if (point.y < 0) { printf("Sim: window is at (%d,%d), adjusting\n", point.x, point.y); point.y = 0; Move(point); } mPlacementChecked = true; }
void MyButton::OnMove(wxMoveEvent& event) { wxPoint size = event.GetPosition(); st1->SetLabel(wxString::Format(wxT("x: %d"), size.x)); st2->SetLabel(wxString::Format(wxT("y: %d"), size.y)); }
void WindowPosition::onMove(wxMoveEvent& ev) { setPosition(ev.GetPosition().x, ev.GetPosition().y); ev.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); }