当前位置: 首页>>代码示例>>C#>>正文


C# Controls.GeoMouseArgs类代码示例

本文整理汇总了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);
        }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:32,代码来源:MapFunctionZoomOut.cs

示例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);
        }
开发者ID:hanchao,项目名称:DotSpatial,代码行数:36,代码来源:MapFunctionIdentify.cs

示例3: OnGlpyhClick

 /// <inheritdoc/>
 protected override void OnGlpyhClick(GeoMouseArgs e)
 {
     using (var form = new ExtensionManagerForm())
     {
         form.App = Manager;
         form.ShowDialog();
     }
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:9,代码来源:AppFunction.cs

示例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);
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:14,代码来源:MapFunctionPan.cs

示例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);
 }
开发者ID:joelmuzz,项目名称:DotSpatial,代码行数:15,代码来源:MapFunctionSelect.cs

示例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);
        }
开发者ID:nikson898,项目名称:dot-spatial,代码行数:25,代码来源:MapFunctionIdentify.cs

示例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);
 }
开发者ID:Nucleotic,项目名称:Geometrix,代码行数:5,代码来源:StatusBarCoordinates.cs

示例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);
 }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:12,代码来源:MapFunction.cs

示例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);
 }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:12,代码来源:MapFunction.cs

示例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);
        }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:65,代码来源:MapFunctionMeasure.cs

示例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);
 }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:12,代码来源:MapFunction.cs

示例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;
     }
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:11,代码来源:MapFunctionGlyph.cs

示例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);
 }
开发者ID:nikson898,项目名称:dot-spatial,代码行数:17,代码来源:Map.cs

示例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);
 }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:8,代码来源:MapFunction.cs

示例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);
        }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:33,代码来源:AddShapeFunction.cs


注:本文中的DotSpatial.Controls.GeoMouseArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。