/// <summary> /// 挿入可能マークからエレメントを検索する処理 /// </summary> /// <param name="enMark">挿入可能マーク</param> /// <returns>エレメント</returns> public ClsDatElem FindElemFromMark(EnmMarkElement enMark) { this.mWorkElem = null; int inCnt, inMax = this.mListElem.Count; for (inCnt = 0; inCnt < inMax; inCnt++) { ClsDatElem clElem = this.mListElem[inCnt]; clElem.FindElemFromMark(this, enMark); if (this.mWorkElem != null) { return(this.mWorkElem); } } return(null); }
private void panel_Control_MouseMove(object sender, MouseEventArgs e) { ClsDatMotion clMotion = ClsSystem.GetSelectMotion(); if (clMotion == null) { return; } //以下、エレメント移動処理 if (e.Button == MouseButtons.Left) { bool isExist = false; if (this.mFormDragLabel != null) { if (!this.mFormDragLabel.IsDisposed) { isExist = true; } } //以下、挿入マーククリア処理 clMotion.ClearInsertMark(); if (isExist) { int inSelectLineNo = ClsSystem.GetSelectLineNo(); int inLineNo = this.GetLineNoFromPositionY(e.Y); if (inSelectLineNo != inLineNo) { //以下、挿入先チェック処理 ClsDatItem clItem = clMotion.GetItemFromLineNo(inLineNo); if (clItem != null) { //以下、挿入先のエレメントに通知する処理 ClsDatElem clElem = null; EnmMarkElement enMark = EnmMarkElement.NONE; if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.ELEM) { clElem = clItem as ClsDatElem; int inY = e.Y % FormControl.CELL_HEIGHT; bool isUp = (inY < FormControl.CELL_HEIGHT / 2); enMark = (isUp) ? EnmMarkElement.UP : EnmMarkElement.IN; } else if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.OPTION) { ClsDatOption clOption = clItem as ClsDatOption; clElem = clOption.mElemParent; if (inSelectLineNo == clElem.mLineNo) { clElem = null; } enMark = EnmMarkElement.IN; } if (clElem != null) { //以下、挿入可能な旨をエレメントに通知する処理 clElem.SetInsertMark(enMark); } } } } else { //以下、掴んでいるエレメントを別ウィンドウで表示する処理 int inLineNo = ClsSystem.GetSelectLineNo(); ClsDatItem clItem = clMotion.FindItemFromLineNo(inLineNo); if (clItem != null) { int inXDiff = (Cursor.Position.X - this.mCatchPosStart.X); int inYDiff = (Cursor.Position.Y - this.mCatchPosStart.Y); double doLen = Math.Sqrt(inXDiff * inXDiff + inYDiff * inYDiff); if (doLen >= 5.0) { ClsDatElem clElem = clItem as ClsDatElem; this.mFormDragLabel = new FormDragLabel(clElem); this.mFormDragLabel.Show(); } } } //以下、コントロール更新処理 this.RefreshControl(); this.panel_Control.Refresh(); this.panel_Time.Refresh(); this.mFormMain.Refresh(); } }