Don't pop up annoying message box in the drawing sample.
The rubber banding selection message box was shown even after a simple click, i.e. when nothing was actually selected which was quite annoying, so don't do this. Also remove unnecessary casts and use wxLogMessage() instead of wxString::Printf() + wxMessageBox(). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1650,15 +1650,15 @@ void MyCanvas::OnMouseUp(wxMouseEvent &event)
|
|||||||
m_overlay.Reset();
|
m_overlay.Reset();
|
||||||
m_rubberBand = false;
|
m_rubberBand = false;
|
||||||
|
|
||||||
int x,y,xx,yy ;
|
wxPoint endpoint = CalcUnscrolledPosition(event.GetPosition());
|
||||||
event.GetPosition(&x,&y);
|
|
||||||
CalcUnscrolledPosition( x, y, &xx, &yy );
|
|
||||||
|
|
||||||
wxString str;
|
|
||||||
str.Printf( wxT("Rectangle selection from %d,%d to %d,%d"),
|
|
||||||
m_anchorpoint.x, m_anchorpoint.y , (int)xx, (int)yy );
|
|
||||||
wxMessageBox( str , wxT("Rubber-Banding") );
|
|
||||||
|
|
||||||
|
// Don't pop up the message box if nothing was actually selected.
|
||||||
|
if ( endpoint != m_anchorpoint )
|
||||||
|
{
|
||||||
|
wxLogMessage("Selected rectangle from (%d, %d) to (%d, %d)",
|
||||||
|
m_anchorpoint.x, m_anchorpoint.y,
|
||||||
|
endpoint.x, endpoint.y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user