本文整理汇总了C#中DotSpatial.Controls.GeoMouseArgs类的典型用法代码示例。如果您正苦于以下问题:C# GeoMouseArgs类的具体用法?C# GeoMouseArgs怎么用?C# GeoMouseArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GeoMouseArgs类属于DotSpatial.Controls命名空间,在下文中一共展示了GeoMouseArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnMouseUp
/// <summary>
/// Handles the Mouse Up situation
/// </summary>
/// <param name="e"></param>
protected override void OnMouseUp(GeoMouseArgs e)
{
Map.Invalidate();
Rectangle r = e.Map.MapFrame.View;
int w = r.Width;
int h = r.Height;
if (e.Button == MouseButtons.Left)
{
r.Inflate(r.Width / 2, r.Height / 2);
r.X += w / 2 - e.X;
r.Y += h / 2 - e.Y;
e.Map.MapFrame.View = r;
e.Map.MapFrame.ResetExtents();
}
else
{
r.Inflate(-r.Width / 4, -r.Height / 4);
// The mouse cursor should anchor the geographic location during zoom.
r.X += (e.X / 2) - w / 4;
r.Y += (e.Y / 2) - h / 4;
e.Map.MapFrame.View = r;
e.Map.MapFrame.ResetExtents();
}
base.OnMouseUp(e);
}
示例2: OnMouseUp
/// <summary>
/// Overrides the OnMouseUp event to handle the situation where we are trying to
/// identify the vector features in the specified area.
/// </summary>
protected override void OnMouseUp(GeoMouseArgs e)
{
if (e.Button != MouseButtons.Left) return;
var rtol = new Rectangle(e.X - 8, e.Y - 8, 16, 16);
var rstr = new Rectangle(e.X - 1, e.Y - 1, 2, 2);
var tolerant = e.Map.PixelToProj(rtol);
var strict = e.Map.PixelToProj(rstr);
if (_frmFeatureIdentifier == null || _frmFeatureIdentifier.IsDisposed)
{
_frmFeatureIdentifier = new FeatureIdentifier();
}
_frmFeatureIdentifier.treFeatures.BeginUpdate();
_frmFeatureIdentifier.SuspendLayout();
_frmFeatureIdentifier.Clear();
Identify(e.Map.MapFrame.GetLayers(), strict, tolerant);
_frmFeatureIdentifier.ReSelect();
_frmFeatureIdentifier.ResumeLayout();
SetSelectToSelectedNode(e.Map);
_frmFeatureIdentifier.treFeatures.EndUpdate();
if (!_frmFeatureIdentifier.Visible)
{
_frmFeatureIdentifier.Show(Map.MapFrame != null ? Map.MapFrame.Parent : null);
}
base.OnMouseUp(e);
}
示例3: OnGlpyhClick
/// <inheritdoc/>
protected override void OnGlpyhClick(GeoMouseArgs e)
{
using (var form = new ExtensionManagerForm())
{
form.App = Manager;
form.ShowDialog();
}
}
示例4: OnMouseDown
/// <summary>
/// Handles the actions that the tool controls during the OnMouseDown event
/// </summary>
/// <param name="e"></param>
protected override void OnMouseDown(GeoMouseArgs e)
{
if (e.Button == MouseButtons.Left && _preventDrag == false)
{
//PreventBackBuffer = true;
_dragStart = e.Location;
_source = e.Map.MapFrame.View;
}
base.OnMouseDown(e);
}
示例5: OnMouseDown
/// <summary>
/// Handles the MouseDown
/// </summary>
/// <param name="e"></param>
protected override void OnMouseDown(GeoMouseArgs e)
{
if (e.Button == MouseButtons.Left)
{
_startPoint = e.Location;
_geoStartPoint = e.GeographicLocation;
_isDragging = true;
Map.IsBusy = true;
}
base.OnMouseDown(e);
}
示例6: OnMouseUp
/// <summary>
/// Overrides the OnMouseUp event to handle the situation where we are trying to
/// identify the vector features in the specified area.
/// </summary>
/// <param name="e"></param>
protected override void OnMouseUp(GeoMouseArgs e)
{
if (e.Button != MouseButtons.Left) return;
Rectangle rtol = new Rectangle(e.X - 8, e.Y - 8, 16, 16);
Rectangle rstr = new Rectangle(e.X - 1, e.Y - 1, 2, 2);
Extent tolerant = e.Map.PixelToProj(rtol);
Extent strict = e.Map.PixelToProj(rstr);
if (_frmFeatureIdentifier == null)
{
_frmFeatureIdentifier = new FeatureIdentifier();
}
_frmFeatureIdentifier.SuspendLayout();
_frmFeatureIdentifier.Clear();
Identify(e.Map.MapFrame.GetLayers(), strict, tolerant);
_frmFeatureIdentifier.ReSelect();
_frmFeatureIdentifier.ResumeLayout();
_frmFeatureIdentifier.Show(Map.MapFrame != null? Map.MapFrame.Parent : null);
base.OnMouseUp(e);
}
示例7: Map_GeoMouseMove
private void Map_GeoMouseMove(object sender, GeoMouseArgs e)
{
xPanel.Caption = String.Format("X: {0:.#####}", e.GeographicLocation.X);
yPanel.Caption = String.Format("Y: {0:.#####}", e.GeographicLocation.Y);
}
示例8: OnMouseUp
/// <summary>
/// Fires the MouseUP event
/// </summary>
/// <param name="e"></param>
protected virtual void OnMouseUp(GeoMouseArgs e)
{
if (MouseUp == null)
{
return;
}
MouseUp(this, e);
}
示例9: OnMouseWheel
/// <summary>
/// Allows for inheriting tools to override the behavior
/// </summary>
/// <param name="e"></param>
protected virtual void OnMouseWheel(GeoMouseArgs e)
{
if (MouseWheel == null)
{
return;
}
MouseWheel(this, e);
}
示例10: OnMouseUp
/// <summary>
/// Handles the Mouse-Up situation
/// </summary>
/// <param name="e"></param>
protected override void OnMouseUp(GeoMouseArgs e)
{
if (_standBy)
{
return;
}
// Add the current point to the featureset
if (e.Button == MouseButtons.Right)
{
if (_coordinates.Count > 1)
{
_previousParts.Add(_coordinates);
if (_areaMode)
{
_measureDialog.TotalArea = _currentArea;
}
else
{
_previousDistance += _currentDistance;
_currentDistance = 0;
_currentArea = 0;
_measureDialog.Distance = 0;
_measureDialog.TotalDistance = _previousDistance;
}
}
_coordinates = new List<Coordinate>();
Map.Invalidate();
}
else
{
if (_coordinates == null)
{
_coordinates = new List<Coordinate>();
}
if (_coordinates.Count > 0)
{
if (_measureDialog.MeasureMode == MeasureMode.Distance)
{
Coordinate c1 = e.GeographicLocation;
double dist = GetDist(c1);
_measureDialog.TotalDistance = _previousDistance + dist;
_currentDistance += dist;
}
}
_coordinates.Add(e.GeographicLocation);
if (_areaMode)
{
if (_coordinates.Count >= 3)
{
double area = GetArea(_coordinates);
_currentArea = area;
}
}
Map.Invalidate();
}
base.OnMouseUp(e);
}
示例11: OnMouseDoubleClick
/// <summary>
/// Fires the DoubleClick event
/// </summary>
/// <param name="e"></param>
protected virtual void OnMouseDoubleClick(GeoMouseArgs e)
{
if (MouseDoubleClick == null)
{
return;
}
MouseDoubleClick(this, e);
}
示例12: OnMouseUp
/// <inheritdoc/>
protected override void OnMouseUp(GeoMouseArgs e)
{
Rectangle glyph = GlpyhBounds;
if (glyph.Contains(e.Location))
{
OnGlpyhClick(e);
// whether they do anything or not, the glyph is the only thing that should happen in this window.
e.Handled = true;
}
}
示例13: OnMouseWheel
/// <summary>
/// Fires the OnMouseWheel event for the active tools
/// </summary>
/// <param name="e"></param>
protected override void OnMouseWheel(MouseEventArgs e)
{
GeoMouseArgs args = new GeoMouseArgs(e, this);
foreach (IMapFunction tool in MapFunctions)
{
if (tool.Enabled)
{
tool.DoMouseWheel(args);
if (args.Handled) break;
}
}
base.OnMouseWheel(e);
}
示例14: DoMouseDoubleClick
/// <summary>
/// Forces this tool to execute whatever behavior should occur during a double click even on the panel
/// </summary>
/// <param name="e"></param>
public void DoMouseDoubleClick(GeoMouseArgs e)
{
OnMouseDoubleClick(e);
}
示例15: OnMouseMove
/// <summary>
/// This method occurs as the mouse moves.
/// </summary>
/// <param name="e">The GeoMouseArcs class describes the mouse condition along with geographic coordinates.</param>
protected override void OnMouseMove(GeoMouseArgs e)
{
if (_standBy) { return; }
// Begin snapping changes
Coordinate snappedCoord = e.GeographicLocation;
bool prevWasSnapped = this.isSnapped;
this.isSnapped = ComputeSnappedLocation(e, ref snappedCoord);
_coordinateDialog.X = snappedCoord.X;
_coordinateDialog.Y = snappedCoord.Y;
// End snapping changes
if (_coordinates != null && _coordinates.Count > 0)
{
List<Point> points = _coordinates.Select(coord => Map.ProjToPixel(coord)).ToList();
Rectangle oldRect = SymbologyGlobal.GetRectangle(_mousePosition, points[points.Count - 1]);
Rectangle newRect = SymbologyGlobal.GetRectangle(e.Location, points[points.Count - 1]);
Rectangle invalid = Rectangle.Union(newRect, oldRect);
invalid.Inflate(20, 20);
Map.Invalidate(invalid);
}
// Begin snapping changes
_mousePosition = this.isSnapped ? Map.ProjToPixel(snappedCoord) : e.Location;
DoMouseMoveForSnapDrawing(prevWasSnapped, _mousePosition);
// End snapping changes
base.OnMouseMove(e);
}