public Editor(ZoneEditorData ze,string path) { InitializeComponent(); zoneData = ze; buildImage(path); this.Name = "ZoneDrawer"; this.Text = "ZoneDrawer"; Graphics g = this.CreateGraphics(); var zoom = ((float)pictureBox1.Width / (float)image.Width) * (image.HorizontalResolution / g.DpiX); PanAndZoom.setZoom(zoom); pictureBox1.Paint += new PaintEventHandler(OnPaint); pictureBox1.MouseDown += PanAndZoom.MouseDown; pictureBox1.MouseMove += PanAndZoom.MouseMove; pictureBox1.MouseUp += PanAndZoom.MouseUp; pictureBox1.MouseClick += new MouseEventHandler(pictureBox1_Click); pictureBox1.MouseWheel += PanAndZoom.MouseWheel; pictureBox1.Select(); //contextMenuStrip1 PanAndZoom.redraw = redraw; contextMenuStrip1.Items[1].Click += ze.AddZone; var spawns=contextMenuStrip1.Items[2] as ToolStripMenuItem; spawns.DropDown.Items[0].Click += ze.AddLandSpawn; spawns.DropDown.Items[1].Click += ze.AddAirSpawn; spawns.DropDown.Items[2].Click += ze.AddSeaSpawn; var positions = contextMenuStrip1.Items[3] as ToolStripMenuItem; positions.DropDown.Items[0].Click += ze.AddCV; positions.DropDown.Items[1].Click += ze.AddFOB; this.button1.Click += new System.EventHandler(ze.deleteItem); //outline = new Outline(pictureBox1); //pictureBox1.Paint += new PaintEventHandler(outline.paint); }
private void ZoneEditorExecute(object obj) { var ndfEditor = new NdfEditorMainViewModel(ScenarioFile.NdfBinary); zoneEditor=new ZoneEditorData(ScenarioFile, ndfEditor,OwnerFile.Path); Console.WriteLine("Launch Editor"); }