public MapFile(string file) { InitializeComponent(); //map = new DesignXmlDraw(); // designer keeps deleting this code??!! Application.AddMessageFilter(this); // // manually add controls to the splitter. visual studio keeps deleting them // map = new DesignXmlDraw(); this.splitContainer1.Panel1.Controls.Add(this.map); // // map // this.map.Dock = System.Windows.Forms.DockStyle.Fill; this.map.Location = new System.Drawing.Point(0, 0); this.map.Name = "map"; this.map.Size = new System.Drawing.Size(620, 474); this.map.TabIndex = 0; this.map.Zoom = 1F; map.ZoomChange += new DesignXmlDraw.DrawEventHandler(map_ZoomChange); map.XmlChange += new DesignXmlDraw.DrawEventHandler(map_XmlChange); map.SelectionChange += new DesignXmlDraw.DrawEventHandler(map_SelectionChange); map.ToolChange += new DesignXmlDraw.DrawEventHandler(map_ToolChange); this.Closing += new CancelEventHandler(MapFile_Closing); if (file != null) { map.SetMapFile(file); if (map.MapDoc == null) // failed to open? map.SetNew(); // yes, just start a new one } else map.SetNew(); SetTitle(false); }
internal DialogFindByKey(DesignXmlDraw dxd) { _Draw = dxd; // // Required for Windows Form Designer support // InitializeComponent(); // populate the keys SortedList<string, string> keys = _Draw.GetAllKeys(); foreach (string key in keys.Keys) lbKeyList.Items.Add(key); return; }
void map_ZoomChange(DesignXmlDraw dxd) { string z = string.Format("{0}%", Math.Round(dxd.Zoom * 100, 0)); cbZoom.Text = z; }
void map_ToolChange(DesignXmlDraw dxd) { bToolStrip.Image = selectionToolStripMenuItem.Image; }
void map_XmlChange(DesignXmlDraw dxd) { pgXmlNode.Refresh(); if (map.Modified) // only need to process on the first change return; SetTitle(true); }
void map_SelectionChange(DesignXmlDraw dxd) { XmlNode sNode = dxd.SelectedItem; if (sNode == null) { pgXmlNode.SelectedObject = null; return; } switch (sNode.Name) { case "Text": pgXmlNode.SelectedObject = new PropertyText(this.map); break; case "Polygon": pgXmlNode.SelectedObject = new PropertyPolygon(this.map); // expand the Keys property. Makes it easier for user to identify the polygon GridItem keys = findPropertyItem("Keys", findPropertyRoot()); if (keys != null) keys.Expanded = true; break; case "Lines": pgXmlNode.SelectedObject = new PropertyLine(this.map); break; default: pgXmlNode.SelectedObject = null; break; } }
internal PropertyText(DesignXmlDraw d):base(d) { }
internal PropertyBase(DesignXmlDraw d) { _Draw = d; }
internal PropertyPolygon(DesignXmlDraw d):base(d) { }
internal PropertyLine(DesignXmlDraw d) : base(d) { }