Exemplo n.º 1
0
        /// <summary>
        /// 現在選択中のアイテムを削除する
        /// </summary>
        private void RemoveItemFromSelectLineNo()
        {
            ClsDatMotion clMotion = ClsSystem.GetSelectMotion();

            if (clMotion == null)
            {
                return;
            }

            int inLineNo = ClsSystem.GetSelectLineNo();

            if (inLineNo < 0)
            {
                return;
            }

            //以下、アイテム削除処理
            clMotion.RemoveItemFromLineNo(inLineNo, false, true);

            //以下、行番号振り直し処理
            clMotion.RefreshLineNo();

            //以下、コントロール更新処理
            this.RefreshControl();
            this.panel_Control.Refresh();
            this.panel_Time.Refresh();
            this.mFormMain.Refresh();
        }
Exemplo n.º 2
0
        /// <summary>
        /// モーションのタイムライン描画処理
        /// </summary>
        /// <param name="g">描画管理クラス</param>
        /// <param name="inWidth">描画先の幅</param>
        /// <param name="inHeight">描画先の高さ</param>
        public void DrawTime(Graphics g, int inWidth, int inHeight)
        {
            int inLineNo  = ClsSystem.GetSelectLineNo();
            int inFrameNo = ClsSystem.GetSelectFrameNo();

            //以下、選択中フレームのラインを表示する処理
            Brush clBrush = new SolidBrush(Color.DarkGreen);
            int   inX     = inFrameNo * FormControl.CELL_WIDTH;

            g.FillRectangle(clBrush, inX, 0, FormControl.CELL_WIDTH, inHeight);

            //以下、エレメント描画処理
            int inCnt, inMax = this.mListElem.Count;

            for (inCnt = 0; inCnt < inMax; inCnt++)
            {
                ClsDatElem clElem = this.mListElem[inCnt];
                clElem.DrawTime(g, inLineNo, inFrameNo, this.mMaxFrameNum, inWidth, inHeight);
            }

            //以下、最終フレームの境界線描画処理
            Pen clPen = new Pen(Color.Green);

            inX = this.mMaxFrameNum * FormControl.CELL_WIDTH;
            g.DrawLine(clPen, inX, 0, inX, inHeight);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 選択中のオプションを取得する処理
        /// </summary>
        /// <returns>選択中のオプション</returns>
        public static ClsDatOption GetOptionFromSelectLineNo()
        {
            int inLineNo = ClsSystem.GetSelectLineNo();

            if (inLineNo < 0)
            {
                return(null);
            }

            ClsDatOption clOption = ClsSystem.GetOptionFromLineNo(inLineNo);

            return(clOption);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 選択中のアイテムを取得する処理
        /// </summary>
        /// <returns>選択中のアイテム</returns>
        private static ClsDatItem GetItemFromSelectLineNo()
        {
            int inLineNo = ClsSystem.GetSelectLineNo();

            if (inLineNo < 0)
            {
                return(null);
            }

            ClsDatItem clItem = ClsSystem.GetItemFromLineNo(inLineNo);

            return(clItem);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 現在選択中のエレメントを取得する
        /// オプションを選択中の場合は、その親のエレメントを取得する
        /// </summary>
        /// <returns>現在選択中のエレメント</returns>
        public static ClsDatElem GetElemFromSelectLineNo()
        {
            int inLineNo = ClsSystem.GetSelectLineNo();

            if (inLineNo < 0)
            {
                return(null);
            }

            ClsDatElem clElem = ClsSystem.GetElemFromLineNo(inLineNo);

            return(clElem);
        }
Exemplo n.º 6
0
        /// <summary>
        /// モーションのコントロール描画処理
        /// </summary>
        /// <param name="g">描画管理クラス</param>
        /// <param name="inWidth">描画先の幅</param>
        /// <param name="inHeight">描画先の高さ</param>
        /// <param name="clFont">フォント管理クラス</param>
        public void DrawControl(Graphics g, int inWidth, int inHeight, Font clFont)
        {
            int inLineNo = ClsSystem.GetSelectLineNo();

            //以下、エレメント描画処理
            int inCnt, inMax = this.mListElem.Count;

            for (inCnt = 0; inCnt < inMax; inCnt++)
            {
                ClsDatElem clElem = this.mListElem[inCnt];
                clElem.DrawControl(g, inLineNo, inWidth, inHeight, clFont);
            }
        }
Exemplo n.º 7
0
        private void button_ItemDown_Click(object sender, EventArgs e)
        {
            ClsDatMotion clMotion = ClsSystem.GetSelectMotion();

            if (clMotion == null)
            {
                return;
            }

            int inLineNo = ClsSystem.GetSelectLineNo();

            if (inLineNo < 0)
            {
                return;
            }

            ClsDatItem clItem = clMotion.GetItemFromLineNo(inLineNo);

            if (clItem == null)
            {
                return;
            }
            if (clItem.mTypeItem != ClsDatItem.TYPE_ITEM.ELEM)
            {
                return;
            }

            //以下、一つ下に移動する処理
            ClsDatElem clElem = clItem as ClsDatElem;

            if (clElem.mElem == null)
            {
                clMotion.MoveDown(clElem);
            }
            else
            {
                clElem.mElem.MoveElemDown(clElem);
            }

            //以下、行番号振り直し処理
            clMotion.RefreshLineNo();

            //以下、改めてアイテムを選択する処理
            ClsSystem.SetSelectFromLineNo(clItem.mLineNo);   //上記の RefreshLineNo 関数内でmLineNoが変わっているはず

            //以下、コントロール更新処理
            this.RefreshControl();
            this.panel_Control.Refresh();
            this.panel_Time.Refresh();
            this.mFormMain.Refresh();
        }
Exemplo n.º 8
0
        private void contextMenuStrip_Opening(object sender, CancelEventArgs e)
        {
            ClsDatMotion clMotion = ClsSystem.GetSelectMotion();

            if (clMotion == null)
            {
                return;
            }

            bool isRemoveElementEnable = false;
            bool isAddOptionEnable     = false;
            bool isRemoveOptionEnable  = false;

            int inLineNo = ClsSystem.GetSelectLineNo();

            if (inLineNo >= 0)
            {
                ClsDatItem clItem = clMotion.GetItemFromLineNo(inLineNo);
                if (clItem != null)
                {
                    isRemoveElementEnable = true;
                    isAddOptionEnable     = true;
                }

                ClsDatOption clOption = ClsSystem.GetOptionFromLineNo(inLineNo);
                if (clOption != null)
                {
                    bool isRemoveOK = clOption.IsRemoveOK();
                    if (isRemoveOK)
                    {
                        isRemoveOptionEnable = true;
                    }
                }
            }

            this.ToolStripMenuItem_RemoveElement.Enabled = isRemoveElementEnable;
            this.ToolStripMenuItem_AddOption.Enabled     = isAddOptionEnable;
            this.ToolStripMenuItem_RemoveOption.Enabled  = isRemoveOptionEnable;
        }
Exemplo n.º 9
0
        private void RefreshControl()
        {
            ClsDatMotion clMotion = ClsSystem.GetSelectMotion();

            if (clMotion == null)
            {
                return;
            }

            int        inSelectFrameNo = ClsSystem.GetSelectFrameNo();
            int        inMaxFrameNum   = clMotion.GetMaxFrameNum();
            int        inSelectLineNo  = ClsSystem.GetSelectLineNo();
            ClsDatItem clItem          = clMotion.GetItemFromLineNo(inSelectLineNo);

            //以下、削除ボタン有効化設定
            bool isEnable = false;

            if (clItem != null)
            {
                if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.ELEM)
                {
                    isEnable = true;
                }
                else if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.OPTION)
                {
                    ClsDatOption clOption = clItem as ClsDatOption;
                    isEnable = clOption.IsRemoveOK();
                }
            }
            this.button_ItemRemove.Enabled = isEnable;

            //以下、アトリビュートウィンドウ設定
            if (this.mFormMain != null)
            {
                if (this.mFormMain.mFormAttribute != null)
                {
                    ClsDatElem clElem = ClsSystem.GetElemFromSelectLineNo();
                    this.mFormMain.mFormAttribute.Init(clElem, inSelectFrameNo, inMaxFrameNum);
                }
            }

            //以下、上ボタン有効化設定
            isEnable = false;
            if (clItem != null)
            {
                ClsDatElem clElem = null;
                if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.ELEM)
                {
                    clElem = clItem as ClsDatElem;
                    if (clElem.mElem == null)
                    {
                        isEnable = clMotion.CanMoveUp(clElem);
                    }
                    else
                    {
                        //isEnable = clElem.mElem.CanMoveUp(clElem);    //自分が長男かチェックする
                    }
                }

/*
 *              else if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.OPTION)
 *              {
 *                  ClsDatOption clOption = clItem as ClsDatOption;
 *                  clElem = clOption.mElem;
 * //                  isEnable = clElem.CanMoveUp(clOption);
 *              }
 */
            }
            this.button_ItemUp.Enabled = isEnable;

            //以下、下ボタン有効化設定
            isEnable = false;
            if (clItem != null)
            {
                ClsDatElem clElem = null;
                if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.ELEM)
                {
                    clElem = clItem as ClsDatElem;
                    if (clElem.mElem == null)
                    {
                        isEnable = clMotion.CanMoveDown(clElem);
                    }
                    else
                    {
                    }
                }

/*
 *              else if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.OPTION)
 *              {
 *                  ClsDatOption clOption = clItem as ClsDatOption;
 *                  clElem = clOption.mElem;
 * //                  isEnable = clElem.CanMoveDown(clOption);
 *              }
 */
            }
            this.button_ItemDown.Enabled = isEnable;
        }
Exemplo n.º 10
0
        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();
            }
        }