using SuperMap.Data; using System; using System.Collections.Generic; using WeifenLuo.WinFormsUI.Docking; using WWPipeLine.MapBasic.Conditions; using WWPipeLine.MapBasic; namespace WWPipeLine.MapTools.Conditions.Locations { public class DWzuobiao : ConditionPanel { private Sunny.UI.UITextBox tbY; private Sunny.UI.UITextBox tbX; private Sunny.UI.UILabel uiLabel2; private Sunny.UI.UILabel uiLabel1; public DWzuobiao() : base() { this.ConditionPanelName = "按照坐标定位"; InitializeComponent(); this.SetSize(400, 185); this.IsShowResultWindow = false; } public override object Do(DockPanel dockPanel = null) { double pointX = 0.0d; double pointY = 0.0d; if (!double.TryParse(tbX.Text, out pointX) || !double.TryParse(tbY.Text, out pointY)) { Sunny.UI.UIMessageTip.ShowError("请输入正确的坐标!仅能输入数字、小数点"); return false; } MapControl.Map.Center = new Point2D(pointX, pointY); MapControl.Map.Refresh(); return true; } private void InitializeComponent() { this.tbY = new Sunny.UI.UITextBox(); this.tbX = new Sunny.UI.UITextBox(); this.uiLabel2 = new Sunny.UI.UILabel(); this.uiLabel1 = new Sunny.UI.UILabel(); this.SuspendLayout(); // // tbY // this.tbY.Cursor = System.Windows.Forms.Cursors.IBeam; this.tbY.FillColor = System.Drawing.Color.White; this.tbY.Font = new System.Drawing.Font("微软雅黑", 12F); this.tbY.Location = new System.Drawing.Point(98, 53); this.tbY.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.tbY.Maximum = 2147483647D; this.tbY.Minimum = -2147483648D; this.tbY.MinimumSize = new System.Drawing.Size(1, 1); this.tbY.Name = "tbY"; this.tbY.Size = new System.Drawing.Size(253, 29); this.tbY.TabIndex = 7; this.tbY.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; this.tbY.KeyPress += new System.Windows.Forms.KeyPressEventHandler(ComsStatic.uiTextBox_num_KeyPress); // // tbX // this.tbX.Cursor = System.Windows.Forms.Cursors.IBeam; this.tbX.FillColor = System.Drawing.Color.White; this.tbX.Font = new System.Drawing.Font("微软雅黑", 12F); this.tbX.Location = new System.Drawing.Point(98, 10); this.tbX.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.tbX.Maximum = 2147483647D; this.tbX.Minimum = -2147483648D; this.tbX.MinimumSize = new System.Drawing.Size(1, 1); this.tbX.Name = "tbX"; this.tbX.Size = new System.Drawing.Size(253, 29); this.tbX.TabIndex = 6; this.tbX.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; this.tbX.KeyPress += new System.Windows.Forms.KeyPressEventHandler(ComsStatic.uiTextBox_num_KeyPress); // // uiLabel2 // this.uiLabel2.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel2.Location = new System.Drawing.Point(22, 59); this.uiLabel2.Name = "uiLabel2"; this.uiLabel2.Size = new System.Drawing.Size(69, 23); this.uiLabel2.TabIndex = 5; this.uiLabel2.Text = "Y坐标:"; this.uiLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // uiLabel1 // this.uiLabel1.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiLabel1.Location = new System.Drawing.Point(22, 16); this.uiLabel1.Name = "uiLabel1"; this.uiLabel1.Size = new System.Drawing.Size(69, 23); this.uiLabel1.TabIndex = 4; this.uiLabel1.Text = "X坐标:"; this.uiLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // DWzuobiao // this.Controls.Add(this.tbY); this.Controls.Add(this.tbX); this.Controls.Add(this.uiLabel2); this.Controls.Add(this.uiLabel1); this.Name = "DWzuobiao"; this.Size = new System.Drawing.Size(400, 100); this.ResumeLayout(false); } } }