コード例 #1
0
        private void PictureBox1_DoubleClick(object sender, EventArgs e)
        {
            // Create a little input form and create/update a task.
            Point mousePos = Cursor.Position;
            _taskSelected = _logics.GetSelectedTask(PictureBox1.PointToClient(mousePos).X, PictureBox1.PointToClient(mousePos).Y);
            frmCreateTaskDialog frm = new frmCreateTaskDialog(PictureBox1.PointToClient(mousePos).X, PictureBox1.PointToClient(mousePos).Y, _logics, _taskSelected);
            frm.ShowDialog();

            DrawTasks();

            _taskSelected = null;
        }
コード例 #2
0
 private void PictureBox1_MouseDown(object sender, MouseEventArgs e)
 {
     // Find out which object is selected.
     _mouseLocation = Cursor.Position;
     _taskSelected = _logics.GetSelectedTask(PictureBox1.PointToClient(_mouseLocation.Value).X, PictureBox1.PointToClient(_mouseLocation.Value).Y);
 }
コード例 #3
0
 private void PictureBox1_MouseWheel(object sender, MouseEventArgs e)
 {
     // Find out which object is selected.
     Point mousePos = Cursor.Position;
     _taskSelected = _logics.GetSelectedTask(PictureBox1.PointToClient(Cursor.Position).X, PictureBox1.PointToClient(Cursor.Position).Y);
     if (_taskSelected != null)
     {
         _taskSelected.Priority += e.Delta / 120;
         _logics.UpdateTaskPriority(_taskSelected);
         DrawTasks();
     }
     _taskSelected = null;
 }
コード例 #4
0
 private void PictureBox1_MouseUp(object sender, MouseEventArgs e)
 {
     if (_taskSelected != null)
     {
         _logics.UpdateTaskPosition(_taskSelected);
         _taskSelected = null;
         _mouseLocation = null;
     }
 }