private void MainForm_Load(object sender, EventArgs e) { //if (!Ros_CSharp.ROS.()) //{ // MessageBox.Show("主机连接失败!请检查配置。"); // Application.Exit(); // return; //} // Create draw area drawArea = new DrawArea(); drawArea.Location = new Point(0, 0); drawArea.Size = new Size(10, 10); drawArea.Owner = this; Controls.Add(drawArea); // Helper objects (DocManager and others) InitializeHelperObjects(); drawArea.Initialize(this, docManager); ResizeDrawArea(); LoadSettingsFromRegistry(); // Submit to Idle event to set controls state at idle time Application.Idle += delegate { SetStateOfControls(); }; // Open file passed in the command line if (ArgumentFile.Length > 0) { OpenDocument(ArgumentFile); } // Subscribe to DropDownOpened event for each popup menu // (see details in MainForm_DropDownOpened) foreach (ToolStripItem item in menuStrip1.Items) { if (item.GetType() == typeof(ToolStripMenuItem)) { ((ToolStripMenuItem)item).DropDownOpened += MainForm_DropDownOpened; } } timer1.Start(); //增加地图图元 drawMap = new ROS.DrawMap(drawArea); //drawMap.GetStaticMap("static_map"); drawMap.SubscribeToMap("/map"); AddNewObject(drawArea, drawMap); }
private void MainForm_Load(object sender, EventArgs e) { // Create draw area drawArea = new DrawArea(); drawArea.Location = new System.Drawing.Point(0, 0); drawArea.Size = new System.Drawing.Size(10, 10); drawArea.Owner = this; this.Controls.Add(drawArea); // Helper objects (DocManager and others) InitializeHelperObjects(); drawArea.Initialize(this, docManager); ResizeDrawArea(); LoadSettingsFromRegistry(); // Submit to Idle event to set controls state at idle time Application.Idle += delegate(object o, EventArgs a) { SetStateOfControls(); }; // Open file passed in the command line if (ArgumentFile.Length > 0) { OpenDocument(ArgumentFile); } // Subscribe to DropDownOpened event for each popup menu // (see details in MainForm_DropDownOpened) foreach (ToolStripItem item in menuStrip1.Items) { if (item.GetType() == typeof(ToolStripMenuItem)) { ((ToolStripMenuItem)item).DropDownOpened += MainForm_DropDownOpened; } } }
public DrawForm(StationMapForm mainform, int childnum, string stationId) { InitializeComponent(); this.mainform = mainform; num = childnum; // Create draw area drawArea = new DrawArea(stationId); drawArea.Location = new System.Drawing.Point(0, 0); drawArea.Size = new System.Drawing.Size(10, 10); drawArea.Owner = this; drawArea.Dock = DockStyle.Fill; this.Controls.Add(drawArea); // Helper objects (DocManager and others) InitializeHelperObjects(); drawArea.Initialize(this, docManager); //ResizeDrawArea(); LoadSettingsFromRegistry(); // Open file passed in the command line if (ArgumentFile.Length > 0) { OpenDocument(ArgumentFile); } // Subscribe to DropDownOpened event for each popup menu // (see details in MainForm_DropDownOpened) foreach (ToolStripItem item in mainform.menuStrip1.Items) { if (item.GetType() == typeof(ToolStripMenuItem)) { ((ToolStripMenuItem)item).DropDownOpened += DrawForm_DropDownOpened; } } }
private void MainForm_Load(object sender, EventArgs e) { // Create draw area drawArea = new DrawArea(); drawArea.Location = new System.Drawing.Point(0, 0); drawArea.Size = new System.Drawing.Size(10, 10); drawArea.Owner = this; this.Controls.Add(drawArea); // Helper objects (DocManager and others) InitializeHelperObjects(); drawArea.Initialize(this, docManager); ResizeDrawArea(); LoadSettingsFromRegistry(); // Submit to Idle event to set controls state at idle time Application.Idle += delegate(object o, EventArgs a) { SetStateOfControls(); }; // Open file passed in the command line if (ArgumentFile.Length > 0) OpenDocument(ArgumentFile); // Subscribe to DropDownOpened event for each popup menu // (see details in MainForm_DropDownOpened) foreach (ToolStripItem item in menuStrip1.Items) { if (item.GetType() == typeof(ToolStripMenuItem)) { ((ToolStripMenuItem)item).DropDownOpened += MainForm_DropDownOpened; } } }