コード例 #1
0
ファイル: MapViewerForm.cs プロジェクト: dtbinh/SVNBackup
        private void completeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (formState == FormState.ADD_OUTDOOR)
            {
                if (this.tempOutdoorLabel != null)
                {
                    this.tempOutdoorLabel.Complete();
                    OutdoorPropertyForm propertyForm = new OutdoorPropertyForm(this.tempOutdoorLabel, this.infoMgr.outdoorMgr);
                    propertyForm.ShowDialog();

                    //this.outdoors.Add(this.tempOutdoorLabel);
                    this.tempOutdoorLabel = null;
                }
            }
            else if (formState == FormState.ADD_INDOOR)
            {
                if (this.tempIndoorLabel != null)
                {
                    this.tempIndoorLabel.Complete();
                    IndoorPropertyForm propertyForm = new IndoorPropertyForm(this.tempIndoorLabel, this.infoMgr.indoorMgr);
                    propertyForm.ShowDialog();

                    //this.indoors.Add(this.tempIndoorLabel);
                    this.tempIndoorLabel = null;
                }
            }

            Refresh();
        }
コード例 #2
0
 public OutdoorPropertyForm(OutdoorLabel outdoor, OutdoorLabelManager mgr)
 {
     outdoorLabel  = outdoor;
     this.labelMgr = mgr;
     this.Text     = "Outdoor";
     InitializeComponent();
 }
コード例 #3
0
ファイル: MapViewerForm.cs プロジェクト: dtbinh/SVNBackup
        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();
            }
        }