예제 #1
0
 private void ManRack_VisibleChanged(object sender, System.EventArgs e)
 {
     if (!base.Visible && this.toolTip1 != null)
     {
         this.rdl = null;
         this.toolTip1.Close();
     }
 }
예제 #2
0
 public void closetips()
 {
     if (this.toolTip1 != null)
     {
         this.rdl = null;
         this.toolTip1.Close();
     }
 }
예제 #3
0
 private void dgvSetDevice_MouseLeave(object sender, System.EventArgs e)
 {
     if (this.toolTip1 == null)
     {
         return;
     }
     this.rdl = null;
     this.toolTip1.Close();
 }
예제 #4
0
        private void Rack_MouseDown(object sender, MouseEventArgs e)
        {
            if (this.toolTip1 != null)
            {
                this.rdl = null;
                this.toolTip1.Close();
            }
            DataGridView.HitTestInfo hitTestInfo = this.dgvSetDevice.HitTest(e.X, e.Y);
            this.rowIndexFromMouseDown = hitTestInfo.RowIndex;
            if (this.rowIndexFromMouseDown < 0)
            {
                return;
            }
            this.colIndexFromMouseDown = hitTestInfo.ColumnIndex;
            if (this.colIndexFromMouseDown < 0)
            {
                return;
            }
            DataGridViewSpanCell dataGridViewSpanCell = (DataGridViewSpanCell)this.dgvSetDevice.Rows[this.rowIndexFromMouseDown].Cells[this.colIndexFromMouseDown];

            if (dataGridViewSpanCell.GetColumnSpan() == 0 && dataGridViewSpanCell.GetRowSpan() == 0)
            {
                this.dragBoxFromMouseDown = Rectangle.Empty;
                return;
            }
            if (dataGridViewSpanCell.GetColumnSpan() < 0)
            {
                this.colIndexFromMouseDown--;
            }
            if (dataGridViewSpanCell.GetRowSpan() < 0)
            {
                this.rowIndexFromMouseDown--;
            }
            long     key      = (long)dataGridViewSpanCell.Tag;
            RackInfo rackInfo = this.m_MapID2Rack[key];

            this.lbRack.SelectedItem = rackInfo.GetDisplayRackName(EcoGlobalVar.RackFullNameFlag);
            if (this.dragBoxFromMouseDown != Rectangle.Empty && this.dragBoxFromMouseDown.Contains(e.X, e.Y))
            {
                return;
            }
            Size dragSize = SystemInformation.DragSize;

            this.dragBoxFromMouseDown = new Rectangle(new Point(e.X - dragSize.Width / 2, e.Y - dragSize.Height / 2), dragSize);
            this.dgvSetDevice.DoDragDrop(this.dgvSetDevice.Rows[this.rowIndexFromMouseDown].Cells[this.colIndexFromMouseDown], DragDropEffects.Move);
        }
예제 #5
0
        private void Rack_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
        {
            int rowIndex = e.RowIndex;

            if (rowIndex < 0)
            {
                return;
            }
            int columnIndex = e.ColumnIndex;

            if (columnIndex < 0)
            {
                return;
            }
            DataGridViewSpanCell dataGridViewSpanCell = (DataGridViewSpanCell)this.dgvSetDevice.Rows[rowIndex].Cells[columnIndex];

            if (dataGridViewSpanCell.GetColumnSpan() == 0 && dataGridViewSpanCell.GetRowSpan() == 0)
            {
                if (this.toolTip1 != null)
                {
                    this.rdl = null;
                    this.toolTip1.Close();
                }
                return;
            }
            long   num    = (long)dataGridViewSpanCell.Tag;
            string devIDs = dataGridViewSpanCell.Value.ToString();

            if (this.rdl != null)
            {
                if (this.rdl.RacKID == num)
                {
                    return;
                }
                this.rdl = null;
            }
            if (this.toolTip1 != null)
            {
                this.toolTip1.Close();
            }
            RackInfo rackInfo = this.m_MapID2Rack[num];

            this.rdl = new rackDeviceListUC(num, rackInfo.GetDisplayRackName(EcoGlobalVar.RackFullNameFlag), devIDs);
            Screen[] allScreens = Screen.AllScreens;
            int      width      = allScreens[0].Bounds.Width;
            int      height     = allScreens[0].Bounds.Height;
            int      x          = Control.MousePosition.X + 1;
            int      y          = Control.MousePosition.Y + 1;

            if (width - Control.MousePosition.X < this.rdl.Size.Width)
            {
                x = Control.MousePosition.X - this.rdl.Size.Width;
            }
            if (height - Control.MousePosition.Y < this.rdl.Size.Height)
            {
                y = Control.MousePosition.Y - this.rdl.Size.Height;
            }
            Rectangle area = new Rectangle(x, y, 1, 1);

            this.toolTip1                  = new Popup(this.rdl);
            this.toolTip1.AutoClose        = false;
            this.toolTip1.FocusOnOpen      = false;
            this.toolTip1.ShowingAnimation = (this.toolTip1.HidingAnimation = PopupAnimations.Blend);
            this.toolTip1.Show(area);
        }