public WellDetailPopup(Form parent, BSE.Windows.Forms.Panel leftPanel, Well well, GPoint markerLocationOnParent, string dataConnString, Action<Well> updateMarkerPosition, Action<Well> deleteMarker) { this.FormClosing += Close_clicked; this.leftPanel = leftPanel; deleteMarkerAction = deleteMarker; updateMarkerPositionAction = updateMarkerPosition; connectionString = dataConnString; Owner = parent; StartPosition = FormStartPosition.Manual; Location = markerLocationOnParent; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; InitializeComponent(); this.well = well; editLngBox.Text = well.Latitude; editLatBox.Text = well.Longitude; imageEditBackup = well.WellImage; wellImage.Image = well.WellImage; wellImage.SizeMode = PictureBoxSizeMode.Zoom; }
public Boolean ShowMenuItem1(string xParent,string xOpNo, string SubMenuCode, BSE.Windows.Forms.XPanderPanel mainpanel) { //可以显示菜单项返回TRUE,否则返回FALSE SqlDataReader xRtn = Program.SqlReader("select * from MenuView where Parent='" + xParent + "'and LimitID= '" + xOpNo + "' and CanRun='1' order by code"); if (xRtn == null) { return false; mainpanel.Expand = false; } //xRtn.Close(); if (xRtn.HasRows == false) { xRtn.Close(); xRtn.Dispose(); return false; } //if (Controls.Contains(MenuPic)) //{ // Controls.Remove(MenuPic); // MenuPic.Dispose(); //} //int xTop = 30; //MenuPic = new PictureBox(); //MenuPic.Top = pictureBox2.Top; //MenuPic.Left = pictureBox2.Left; //MenuPic.Width = pictureBox2.Width; //MenuPic.Height = pictureBox2.Height; //MenuPic.BackColor = pictureBox2.BackColor; //MenuPic.BorderStyle = pictureBox2.BorderStyle; //Controls.Add(MenuPic); //pictureBox2.SendToBack(); if (xParent == "000") { while (xRtn.Read()) { xppanel = new BSE.Windows.Forms.XPanderPanel(); xppanel.Text = xRtn["Nam"].ToString().Trim(); xppanel.Tag = xRtn["code"].ToString().Trim(); xppanel.ColorScheme = BSE.Windows.Forms.ColorScheme.Professional; //BSE.Windows.Forms.ColorScheme.Custom; xppanel.ColorCaptionGradientBegin = System.Drawing.SystemColors.ControlLightLight; //System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(177)))), ((int)(((byte)(250)))));//System.Drawing.Color.Ivory;// System.Drawing.SystemColors.InactiveCaptionText;// System.Drawing.Color.Pink; xppanel.ColorCaptionGradientEnd = System.Drawing.Color.CornflowerBlue;//System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(53)))), ((int)(((byte)(145)))));//System.Drawing.Color.Green;//.ForestGreen;//System.Drawing.Color.RoyalBlue; //System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))); xppanel.ColorCaptionGradientMiddle = System.Drawing.Color.CornflowerBlue;//System.Drawing.Color.FromArgb(((int)(((byte)(82)))), ((int)(((byte)(127)))), ((int)(((byte)(208)))));//System.Drawing.Color.FromArgb(((int)(((byte)(82)))), ((int)(((byte)(127)))), ((int)(((byte)(208)))));//System.Drawing.Color.CornflowerBlue;// System.Drawing.Color.LightSalmon; // xppanel.Image =Res.I444.ToBitmap(); xppanel.Click += new EventHandler(xppanel_Click); xPanderPanelList1.Controls.Add(xppanel); if (xppanel.Text.Trim() == "制卡") { xppanel.AutoScroll = true; } else { xppanel.AutoScroll = false; } xppanel.Refresh(); } } else { xTop = 0; while (xRtn.Read()) { MenuButt = new Button(); MenuButt.Parent = mainpanel; MenuButt.Left = mainpanel.Left+25; MenuButt.Top = mainpanel .CaptionHeight+xTop ; MenuButt.Width = 105; MenuButt.Height = 53; MenuButt.Text = xRtn["Nam"].ToString().Trim(); MenuButt.ImageList = imageList1; MenuButt.ImageIndex = int.Parse(xRtn ["picid"].ToString ()); MenuButt.ImageAlign = System.Drawing.ContentAlignment.TopCenter; MenuButt.TextAlign = System.Drawing.ContentAlignment.BottomCenter; MenuButt.Click += new EventHandler(MenuButt_Click); mainpanel.Controls.Add(MenuButt); xTop = MenuButt.Top+ 33; } } xRtn.Close(); xRtn.Dispose(); return true; }
private void panel4_PanelCollapsing(object sender, BSE.Windows.Forms.XPanderStateChangeEventArgs e) { }
public void GameBitStreamSingleEncodingTest() { #region values assumed from blind reverse engineering const float k_expected_float1 = 2.00204468f; const uint k_expected_float1_bits = 0x8147; float result_float = BSE.DecodeSingle(k_expected_float1_bits, -200.0f, 200.0f, 16, true, true); Assert.AreEqual(k_expected_float1, result_float); uint result_bits = BSE.EncodeSingle(result_float, -200.0f, 200.0f, 16, true, true); Assert.AreEqual(k_expected_float1_bits, result_bits); const float k_expected_float2 = 1.50152588f; const uint k_expected_float2_bits = 0x80F5; result_float = BSE.DecodeSingle(k_expected_float2_bits, -200.0f, 200.0f, 16, true, true); Assert.AreEqual(k_expected_float2, result_float); result_bits = BSE.EncodeSingle(result_float, -200.0f, 200.0f, 16, true, true); Assert.AreEqual(k_expected_float2_bits, result_bits); #endregion #region values taken from debug session int k_bit_count = 16; float k_min = -2.00000000000000E+002f; float k_max = +2.00000000000000E+002f; float input; uint output; #region signed input = +1.45269775390625E+000f; output = 0x80ED; result_bits = BSE.EncodeSingle(input, k_min, k_max, k_bit_count, true, true); result_float = BSE.DecodeSingle(output, k_min, k_max, k_bit_count, true, true); Assert.AreEqual(output, result_bits); Assert.AreEqual(input, result_float); input = +1.59919738769531E+000f; output = 0x8105; result_bits = BSE.EncodeSingle(input, k_min, k_max, k_bit_count, true, true); result_float = BSE.DecodeSingle(output, k_min, k_max, k_bit_count, true, true); Assert.AreEqual(output, result_bits); Assert.AreEqual(input, result_float); input = +1.75178527832031E+000f; output = 0x811E; result_bits = BSE.EncodeSingle(input, k_min, k_max, k_bit_count, true, true); result_float = BSE.DecodeSingle(output, k_min, k_max, k_bit_count, true, true); Assert.AreEqual(output, result_bits); Assert.AreEqual(input, result_float); input = +1.50152587890625E+000f; output = 0x80F5; result_bits = BSE.EncodeSingle(input, k_min, k_max, k_bit_count, true, true); result_float = BSE.DecodeSingle(output, k_min, k_max, k_bit_count, true, true); Assert.AreEqual(output, result_bits); Assert.AreEqual(input, result_float); input = +2.00204467773438E+000f; output = 0x8147; result_bits = BSE.EncodeSingle(input, k_min, k_max, k_bit_count, true, true); result_float = BSE.DecodeSingle(output, k_min, k_max, k_bit_count, true, true); Assert.AreEqual(output, result_bits); Assert.AreEqual(input, result_float); #endregion #region unsigned k_bit_count = 30; k_min = +0.00000000000000E+000f; k_max = +1.00000000000000E+004f; input = +1.00000298023224E+000f; output = 0x1A36F; result_bits = BSE.EncodeSingle(input, k_min, k_max, k_bit_count, false, true); result_float = BSE.DecodeSingle(output, k_min, k_max, k_bit_count, false, true); Assert.AreEqual(output, result_bits); Assert.AreEqual(input, result_float); input = +7.00000076293945E+001f; output = 0x72B022; result_bits = BSE.EncodeSingle(input, k_min, k_max, k_bit_count, false, true); result_float = BSE.DecodeSingle(output, k_min, k_max, k_bit_count, false, true); Assert.AreEqual(output, result_bits); Assert.AreEqual(input, result_float); input = +3.00002276897430E-001f; output = 0x7DD5; result_bits = BSE.EncodeSingle(input, k_min, k_max, k_bit_count, false, true); result_float = BSE.DecodeSingle(output, k_min, k_max, k_bit_count, false, true); Assert.AreEqual(output, result_bits); Assert.AreEqual(input, result_float); #endregion #endregion k_bit_count = 20; k_min = 0f; k_max = 1000f; input = 14.000456f; output = 0x3959; result_bits = BSE.EncodeSingle(input, k_min, k_max, k_bit_count, true, true); result_float = BSE.DecodeSingle(output, k_min, k_max, k_bit_count, true, true); Assert.AreEqual(output, result_bits); Assert.AreEqual(input, result_float); input = 11.999641f; output = 0x3127; result_bits = BSE.EncodeSingle(input, k_min, k_max, k_bit_count, true, true); result_float = BSE.DecodeSingle(output, k_min, k_max, k_bit_count, true, true); Assert.AreEqual(output, result_bits); Assert.AreEqual(input, result_float); input = 9.9997807f; output = 0x28F6; result_bits = BSE.EncodeSingle(input, k_min, k_max, k_bit_count, true, true); result_float = BSE.DecodeSingle(output, k_min, k_max, k_bit_count, true, true); Assert.AreEqual(output, result_bits); Assert.AreEqual(input, result_float); }