예제 #1
0
파일: Chart.cs 프로젝트: Alshain01/SaltMaps
 private void SeaChart_MouseDown(object sender, MouseEventArgs e)
 {
     mouseDownLoc = e.Location;
     if (e.Button == MouseButtons.Left)
     {
         this.Cursor = Cursors.NoMove2D;
     }
     else if (e.Button == MouseButtons.Right)
     {
         if (btnTwoByTwo.Checked &&
             (map.HasWaypoint(Coordinates.FromPoint(new Point(e.Location.X + 40, e.Location.Y)).ToPoint()) ||
              map.HasWaypoint(Coordinates.FromPoint(new Point(e.Location.X, e.Location.Y + 40)).ToPoint()) ||
              map.HasWaypoint(Coordinates.FromPoint(new Point(e.Location.X + 40, e.Location.Y + 40)).ToPoint())))
         {
             return;
         }
         else if (btnStamp.Checked)
         {
             AddStamp(e.Location);
         }
         else
         {
             AddWaypoint(e.Location);
         }
     }
 }
예제 #2
0
 // Constructor for new Waypoint Generation
 public Waypoint(Point p, MarkerType marker, IslandType island)
 {
     this.Location = Coordinates.FromPoint(p);
     this.Island   = island;
     this.Marker   = marker;
     this.Name     = string.Empty;
     this.Notes    = String.Empty;
 }
예제 #3
0
파일: Chart.cs 프로젝트: Alshain01/SaltMaps
        private void SeaChart_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                DragMap(e.Location);
            }
            else if (e.Button == MouseButtons.None)
            {
                Coordinates coord = Coordinates.FromPoint(e.Location);
                statusCoord.Text = coord.ToString();

                // Debug information
                statusPoint.Text         = string.Format("Point: {0},{1}", e.Location.X, e.Location.Y);
                statusRawCoord.Text      = string.Format("Raw Coordinate: {0},{1}", coord.X, coord.Y);
                statusChartLocation.Text = string.Format("Chart Location: {0}, {1}", SeaChart.Location.X, SeaChart.Location.Y);
            }
        }