/// <summary> /// 货架单元格鼠标离开事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void wareHouseControl1_CellMouseLeave(object sender, CellMouseEventArgs e) { this.wareHouseControl1.HideCellinfoTip(); }
/// <summary> /// 货架单元格的鼠标进入事件,触发仓位信息弹出显示事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void wareHouseControl1_CellMouseEnter(object sender, CellMouseEventArgs e) { //wareHouseControl1_DisplayCell(e.CurCellCoord); OnCellPopupDisp(e.CurCellCoord); }
/// <summary> /// 货架单元格鼠标单击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void wareHouseControl1_CellClick(object sender, CellMouseEventArgs e) { this.comboBoxLayerlist.SelectedIndex = e.CurCellCoord.L - 1; this.comboBoxRowlist.SelectedIndex = e.CurCellCoord.R - 1; this.comboBoxColumnList.SelectedIndex = e.CurCellCoord.C - 1; }
/// <summary> /// 仓库监控控件鼠标进入货架单元的事件处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Warehouse_mouseEnter(object sender, CellMouseEventArgs e) { this.comboBoxLayerlist.SelectedItem = e.CurCellCoord.L; this.comboBoxRowlist.SelectedItem = e.CurCellCoord.R; this.comboBoxColumnList.SelectedItem = e.CurCellCoord.C; }
/// <summary> /// 仓库控件鼠标按下事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void panelWareCells_MouseDown(object sender, MouseEventArgs e) { this._MouseDownPt.X = e.X; this._MouseDownPt.Y = e.Y; if (_mouseOpMode == MouseOpMode.MOUSE_SELECT && e.Button == MouseButtons.Left) { HouseCell cellCur = GetCellByMousePt(this._MouseCurPt); if (cellCur != null) { cellCur.CellMouse = CellMouseStatus.MOUSE_DOWN; Rectangle redrawRect = new Rectangle(cellCur.ltCornerPos, cellCur.CellSize); redrawRect.Inflate(_CellColumnWidth, _CellRowHeight); rectScale(zoomScale / 100.0f, ref redrawRect); rectTranslate(this.panelWareCells.AutoScrollPosition.X, this.panelWareCells.AutoScrollPosition.Y, ref redrawRect); this.panelWareCells.Invalidate(redrawRect); if (this.CellClick != null) { CellMouseEventArgs cellE = new CellMouseEventArgs(cellCur.CellCoord); CellClick.Invoke(this, cellE); } } } else if (e.Button == MouseButtons.Right) { this.contextMenu1.Show(this, e.X, e.Y); } }
/// <summary> /// 设置货架单元格状态 /// </summary> /// <param name="cell"></param> /// <param name="s"></param> public void SetCellCaptureStatus(HouseCell cell, CellMouseStatus s) { if (cell != null) { cell.CellMouse = s; //重绘 Rectangle redrawRect = new Rectangle(cell.ltCornerPos, cell.CellSize); redrawRect.Inflate(_CellColumnWidth, _CellRowHeight); rectScale(zoomScale / 100.0f, ref redrawRect); rectTranslate(this.panelWareCells.AutoScrollPosition.X, this.panelWareCells.AutoScrollPosition.Y, ref redrawRect); // redrawRect.Offset(this.panelWareCells.AutoScrollPosition.X, this.panelWareCells.AutoScrollPosition.Y); this.panelWareCells.Invalidate(redrawRect); switch (s) { case CellMouseStatus.MOUSE_ENTER: { //触发enter事件 if (CellMouseEnter != null) { CellMouseEventArgs cellE = new CellMouseEventArgs(cell.CellCoord); CellMouseEnter(cell, cellE); } break; } case CellMouseStatus.MOUSE_LEAVE: { //触发leave事件 if (CellMouseLeave != null) { CellMouseEventArgs cellE = new CellMouseEventArgs(cell.CellCoord); CellMouseLeave(cell, cellE); } break; } case CellMouseStatus.MOUSE_NONE: { break; } } } }