private void overlayBox_MouseDown(object sender, MouseEventArgs e) { // If active selection not null and right button clicked - show context menu. if (e.Button == MouseButtons.Right && _model.ActiveSelection != null) { // Show context menu. contextMenuStrip1.Show(Cursor.Position); } // Translate coordinates, if image is zoomed in/out. _model.MouseDown(TranslateCursorLocation(), e.Button); }
public void test_MouseDownWhenIdleChangesStateToSelecting() { _model.MouseDown(new System.Drawing.Point(0, 0), MouseButtons.Left); Assert.AreEqual(MainFormStatus.Selecting, _model.Status); }