Example #1
0
 /// <summary>
 /// Обработчик нажатия по панели для показа контекствного меню
 /// </summary>
 /// <param name="sender">Объект события</param>
 /// <param name="e">Аргумент события</param>
 private void Panel1_MouseClick(object sender, MouseEventArgs e)
 {
     if (status == MapStat.createnew && e.Button == MouseButtons.Left)
     {
         mouseloc = e.Location;
         Cursor   = Cursors.Arrow;
         status   = MapStat.none;
         AddTask form = new AddTask();
         form.FormClosing   += uxPlay;
         this.Enabled        = false;
         form.SavingChanges += GetNewPoint;
         form.Show();
         StartPaintTrace();
     }
     else if (e.Button == MouseButtons.Right)
     {
         foreach (ToolStripItem it in contextPainter.Items)
         {
             it.Enabled = false;
         }
         contextPainter.Items[0].Enabled = true;
         if (points.Count > 0)
         {
             contextPainter.Items[6].Enabled = true;
         }
         mouseloc = new Point(Cursor.Position.X - TasksPanel.Location.X - this.Location.X, Cursor.Position.Y - TasksPanel.Location.Y - this.Location.Y);
         contextPainter.Show(Cursor.Position);
         StartPaintTrace();
     }
 }
Example #2
0
        /// <summary>
        /// Обработчик нажатия по "Добавить задачу"
        /// </summary>
        /// <param name="sender">Объект события</param>
        /// <param name="e">Аргумент события</param>
        private void AddtaskMB_Click(object sender, EventArgs e)
        {
            AddTask form = new AddTask();

            form.FormClosing   += uxPlay;
            this.Enabled        = false;
            form.SavingChanges += GetNewPoint;
            form.Show();
            StartPaintTrace();
        }