private void pictureBox1_MouseMove(object sender, MouseEventArgs e) { if (isPressed && !isPointer && e.Button == MouseButtons.Left) { MM_NewFigureDraw(e); } if (isPointer & !isPressed) { if (CurrFig != -1) { APoints = new ActivePoints(FigList.Item(CurrFig)); Cursor = APoints.ChangeCursor(e, FigList.Item(CurrFig)); } } if (isPointer && isPressed && e.Button == MouseButtons.Left) { if (FigList.Item(CurrFig) is MyInterfaces.IEditable) { MM_CurrentFigureEdit(e); } else { MessageBoxError("You can't edit this figure.", "Editing error."); } } }
private void MD_CurrentFigureSelect(MouseEventArgs ee) { lboxFigures.SelectedIndex = CurrFig; grEdit.Clear(Color.Transparent); grRez.Clear(Color.Transparent); grRez.DrawImage(Layers[2], 0, 0); FigList.AllOff(); if (FigList.Item(CurrFig) is MyInterfaces.ISelectable) { ((MyInterfaces.ISelectable)FigList.Item(CurrFig)).SelectFigure(grEdit); } grRez.DrawImage(Layers[4], 0, 0); pictureBox1.Refresh(); isPressed = true; CurrPen.Color = FigList.Item(CurrFig).pen.color; CurrPen.Width = FigList.Item(CurrFig).pen.Width; APoints = new ActivePoints(FigList.Item(CurrFig)); trackbarWidth.Value = (int)FigList.Item(CurrFig).pen.Width; lblWidth.Text = "Width: " + ((int)FigList.Item(CurrFig).pen.Width).ToString(); if (FigList.Item(CurrFig) is MyInterfaces.IFillingable) { if (((MyInterfaces.IFillingable)FigList.Item(CurrFig)).isFilled) { rbFillOn.Checked = true; } else { rbFillOff.Checked = true; } } btnColor.BackColor = FigList.Item(CurrFig).pen.color; CursorPos = APoints.GetCursorAPoint(ee); btnConfirm.Enabled = true; lboxFigures.Enabled = false; btnBack.Enabled = false; btnClear.Enabled = false; btnDel.Enabled = true; }