示例#1
0
 public EnemyPropertyForm(EnemyLabel point, EnemyLabelManager mgr)
 {
     enemyLabel = point;
     labelMgr   = mgr;
     this.Text  = "Feature";
     InitializeComponent();
 }
示例#2
0
        private void viewerPictureBox_MouseClick(object sender, MouseEventArgs e)
        {
            if (formState == FormState.ADD_FEATURE)
            {
                FeatureLabel feature = this.infoMgr.featureMgr.CreateLabel();
                feature.pos = new Point(e.X, e.Y);
                FeaturePropertyForm propertyForm = new FeaturePropertyForm(feature, this.infoMgr.featureMgr);

                propertyForm.ShowDialog();
                Refresh();
            }
            else if (formState == FormState.ADD_INDOOR)
            {
                MouseEventArgs mouseEvent = (MouseEventArgs)e;
                if (mouseEvent.Button == MouseButtons.Right)
                {
                    // pop to choose "complete" or "cancel"
                    this.polygonContextMenuStrip.Show(this.Left + e.X, this.Top + e.Y);
                }
                else if (mouseEvent.Button == MouseButtons.Left)
                {
                    if (this.tempIndoorLabel == null)
                    {
                        this.tempIndoorLabel = this.infoMgr.indoorMgr.CreateLabel();
                    }
                    this.tempIndoorLabel.AddVertice(new Point(e.X, e.Y));
                }

                Refresh();
            }
            else if (formState == FormState.ADD_OUTDOOR)
            {
                MouseEventArgs mouseEvent = (MouseEventArgs)e;
                if (mouseEvent.Button == MouseButtons.Right)
                {
                    // pop to choose "complete" or "cancel"
                    this.polygonContextMenuStrip.Show(this.Left + e.X, this.Top + e.Y);
                }
                else if (mouseEvent.Button == MouseButtons.Left)
                {
                    if (this.tempOutdoorLabel == null)
                    {
                        this.tempOutdoorLabel = this.infoMgr.outdoorMgr.CreateLabel();
                    }
                    this.tempOutdoorLabel.AddVertice(new Point(e.X, e.Y));
                }

                Refresh();
            }
            else if (formState == FormState.ADD_ENEMY)
            {
                EnemyLabel enemy = this.infoMgr.enemyMgr.CreateLabel();
                enemy.pos = new Point(e.X, e.Y);
                EnemyPropertyForm propertyForm = new EnemyPropertyForm(enemy, this.infoMgr.enemyMgr);

                propertyForm.ShowDialog();
                Refresh();
            }
            else
            {
                MouseEventArgs mouseEvent = (MouseEventArgs)e;
                if (mouseEvent.Button == MouseButtons.Right)
                {
                    this.editContextMenuStrip.Show(this.Left + e.X, this.Top + e.Y);
                }
                Refresh();
            }
        }