Ejemplo n.º 1
0
        private void Waypoint_MouseUp(object sender, MouseEventArgs e)
        {
            PictureBox pb = (PictureBox)sender;
            Waypoint   wp = map.GetWaypoint(pb.Location);

            this.Cursor = Cursors.Arrow;

            if (e.Button == MouseButtons.Left && mapBoxLoc.Equals(pb.Parent.Location))
            {
                var frm = new WaypointDetails(wp);
                frm.StartPosition = FormStartPosition.Manual;
                frm.Location      = new Point(Cursor.Position.X, Cursor.Position.Y);
                frm.ShowDialog(this);
            }
            else if (e.Button == MouseButtons.Right)
            {
                if (btnNoIsland.Checked && btnNoMarker.Checked)
                {
                    DeleteWaypoint(pb);
                }
                else if (btnStamp.Checked)
                {
                    AddStamp(new Point(pb.Location.X + e.Location.X, pb.Location.Y + e.Location.Y));
                }
                else if (btnTwoByTwo.Checked)
                {
                    return;
                }
                else
                {
                    IslandType island = ActiveIsland();
                    MarkerType marker = ActiveMarker();

                    if (wp.Island != island || wp.Marker != marker)
                    {
                        wp.Island = island;
                        wp.Marker = marker;
                        pb.Image  = wp.GetImage();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void Waypoint_MouseUp(object sender, MouseEventArgs e)
        {
            PictureBox pb = (PictureBox)sender;
            Waypoint wp = map.GetWaypoint(pb.Location);
            this.Cursor = Cursors.Arrow;

            if (e.Button == MouseButtons.Left && mapBoxLoc.Equals(pb.Parent.Location))
            {
                var frm = new WaypointDetails(wp);
                frm.StartPosition = FormStartPosition.Manual;
                frm.Location = new Point(Cursor.Position.X, Cursor.Position.Y);
                frm.ShowDialog(this);
            }
            else if (e.Button == MouseButtons.Right)
            {
                if (btnNoIsland.Checked && btnNoMarker.Checked)
                    DeleteWaypoint(pb);
                else if (btnStamp.Checked)
                    AddStamp(new Point(pb.Location.X + e.Location.X, pb.Location.Y + e.Location.Y));
                else if (btnTwoByTwo.Checked)
                    return;
                else
                {
                    IslandType island = ActiveIsland();
                    MarkerType marker = ActiveMarker();

                    if (wp.Island != island || wp.Marker != marker)
                    {
                        wp.Island = island;
                        wp.Marker = marker;
                        pb.Image = wp.GetImage();
                    }
                }
            }
        }