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); }
public ZoneEditor(ZoneEditorData ze) { InitializeComponent(); buildImage("portWonsan.png"); this.Name = "ZoneDrawer"; this.Text = "ZoneDrawer"; /*this.qqToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); tropicThunToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); nuclearWinterIsComingToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); pungjingValleyToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); apocalypseImminentToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); wonsanHarborToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); paddyFieldToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); hopAndGloryToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); toughJungleToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); chosinReservoirToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); jungleLAWToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); standoffInBarentsToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); bloodyRidgeToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); */ 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; /*var ms = new ContextMenuStrip(); ms.Items.Add("Add..."); ms.Items[0].Enabled = false; ms.Items.Add("Zone"); ms.Items.Add("Spawn"); var t = new ToolStripDropDownItem(); t. t.Items.Add("Land"); t.Items.Add("Air"); t.Items.Add("Sea"); ms.Items.Add(t); ms.Items.Add("Starting position"); pictureBox1.ContextMenuStrip=ms;*/ //pictureBox1.ContextMenuStrip = contextMenuStrip1; //contextMenuStrip1. /*contextMenuStrip1.Opening += new CancelEventHandler(delegate(object x, CancelEventArgs c) { //Console.WriteLine("aaa"); c.Cancel = true; });*/ //contextMenuStrip1. //contextMenuStrip1.ItemClicked += new ToolStripItemClickedEventHandler(menuStrip2_ItemClicked); 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; //outline = new Outline(pictureBox1); //pictureBox1.Paint += new PaintEventHandler(outline.paint); }
private void ZoneEditorExecute(object obj) { zoneEditor = new ZoneEditorData(ScenarioFile, OwnerFile.Path); Console.WriteLine("Launch Editor"); }
public ZoneEditor(ZoneEditorData ze) { InitializeComponent(); buildImage("portWonsan.png"); this.Name = "ZoneDrawer"; this.Text = "ZoneDrawer"; /*this.qqToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); * tropicThunToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); * nuclearWinterIsComingToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); * pungjingValleyToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); * apocalypseImminentToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); * wonsanHarborToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); * paddyFieldToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); * hopAndGloryToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); * toughJungleToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); * chosinReservoirToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); * jungleLAWToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); * standoffInBarentsToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); * bloodyRidgeToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); */ 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; /*var ms = new ContextMenuStrip(); * ms.Items.Add("Add..."); * ms.Items[0].Enabled = false; * ms.Items.Add("Zone"); * ms.Items.Add("Spawn"); * var t = new ToolStripDropDownItem(); * t. * t.Items.Add("Land"); * t.Items.Add("Air"); * t.Items.Add("Sea"); * ms.Items.Add(t); * ms.Items.Add("Starting position"); * pictureBox1.ContextMenuStrip=ms;*/ //pictureBox1.ContextMenuStrip = contextMenuStrip1; //contextMenuStrip1. /*contextMenuStrip1.Opening += new CancelEventHandler(delegate(object x, CancelEventArgs c) * { * //Console.WriteLine("aaa"); * c.Cancel = true; * });*/ //contextMenuStrip1. //contextMenuStrip1.ItemClicked += new ToolStripItemClickedEventHandler(menuStrip2_ItemClicked); 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; //outline = new Outline(pictureBox1); //pictureBox1.Paint += new PaintEventHandler(outline.paint); }