You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.4 KiB
C#
56 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace GeoSigmaViewer
|
|
{
|
|
class DrawToolProportion : DrawTool
|
|
{
|
|
private ProportionDialog dlg;
|
|
public DrawToolProportion()
|
|
{
|
|
ToolCursor = DrawCursors.Select;
|
|
ItemType = DrawItemType.ITEM_PROPORTION;
|
|
}
|
|
public override void Start()
|
|
{
|
|
if (dlg != null)
|
|
{
|
|
if (dlg.IsAccessible)
|
|
dlg.Close();
|
|
dlg = null;
|
|
}
|
|
|
|
drawer.Geo.CreateProportion(); //创建比例尺
|
|
drawer.Geo.EnableRedraw(true);
|
|
drawer.ReDraw();
|
|
|
|
dlg = new ProportionDialog(ref drawer);
|
|
dlg.Show();
|
|
}
|
|
public override void End()
|
|
{
|
|
if (dlg != null)
|
|
{
|
|
if(dlg.IsAccessible)
|
|
dlg.Close();
|
|
|
|
dlg = null;
|
|
}
|
|
}
|
|
public override void OnLButtonDown(Drawer drawArea, MouseEventArgs e)
|
|
{
|
|
drawArea.Geo.OnLButtonDown(e.X, e.Y);
|
|
drawArea.Geo.EnableRedraw(true);
|
|
drawArea.ReDraw();
|
|
|
|
ProportionData data = new ProportionData();
|
|
drawArea.Geo.Proportion_GetData(ref data);
|
|
//dlg.SetXY(data.x, data.y);
|
|
}
|
|
}
|
|
}
|