|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
|
|
|
|
|
|
namespace GeoSigmaViewer
|
|
|
|
|
|
{
|
|
|
|
|
|
public class DrawToolDelete : DrawTool
|
|
|
|
|
|
{
|
|
|
|
|
|
private MouseMoveResult mmResult;
|
|
|
|
|
|
public DrawToolDelete()
|
|
|
|
|
|
{
|
|
|
|
|
|
ToolCursor = DrawCursors.Delete;
|
|
|
|
|
|
ItemType = DrawItemType.ITEM_DELETE;
|
|
|
|
|
|
mmResult = new MouseMoveResult();
|
|
|
|
|
|
}
|
|
|
|
|
|
public override void Start()
|
|
|
|
|
|
{
|
|
|
|
|
|
drawer.Cursor = ToolCursor;
|
|
|
|
|
|
drawer.Geo.Delete_SetType(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnMouseClick(Drawer drawArea, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
base.OnMouseClick(drawArea, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnLButtonDown(Drawer drawArea, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
drawArea.Geo.Delete_ClearCountSelected();
|
|
|
|
|
|
drawArea.Geo.OnLButtonDown(e.X, e.Y);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnMouseMove(Drawer drawArea, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (e.Button == MouseButtons.Left)
|
|
|
|
|
|
{
|
|
|
|
|
|
Graphics g = drawArea.CreateGraphics();
|
|
|
|
|
|
drawArea.Geo.ItemMouseMove(g.GetHdc(), e.X, e.Y, ref mmResult);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnLButtonUp(Drawer drawArea, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
drawArea.Geo.OnLButtonUp(e.X, e.Y);
|
|
|
|
|
|
drawArea.Geo.EnableRedraw(true);
|
|
|
|
|
|
drawArea.ReDraw();
|
|
|
|
|
|
|
|
|
|
|
|
if (drawArea.Geo.Delete_GetCountSelected() <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
MessageBox.Show("未选中图元?", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|