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; }