/// <summary> /// 行番号割り振り処理 /// </summary> /// <param name="clMotion">モーション管理クラス</param> public void RefreshLineNo(ClsDatMotion clMotion) { //以下、表示しなくてはいけない種別かどうかチェックする処理 bool isDraw = ClsDatOption.IsDraw(this.mTypeOption); if (isDraw) { //以下、行番号設定 this.mLineNo = clMotion.mWorkLineNo; clMotion.mWorkLineNo++; } }
/// <summary> /// エレメントのコントロール描画処理 /// </summary> /// <param name="g">描画管理クラス</param> /// <param name="inSelectLineNo">選択中のライン番号</param> /// <param name="inWidth">描画先の幅</param> /// <param name="inHeight">描画先の高さ</param> /// <param name="clFont">フォント管理クラス</param> public void DrawControl(Graphics g, int inSelectLineNo, int inWidth, int inHeight, Font clFont) { //以下、表示しなくてはいけない種別かどうかチェックする処理 bool isDraw = ClsDatOption.IsDraw(this.mTypeOption); if (!isDraw) { return; } //以下、横ライン描画処理 int inY = FormControl.CELL_HEIGHT; //g.DrawLine(Pens.Black, 0, inY, inWidth, inY); //以下、背景を塗る処理 if (inSelectLineNo == this.mLineNo) { //選択中Elementsの背景強調 SolidBrush sb = new SolidBrush(Color.DarkGreen); g.FillRectangle(sb, 0, this.mLineNo * FormControl.CELL_HEIGHT, inWidth, FormControl.CELL_HEIGHT); } else { if (this.mLineNo % 2 == 0) { SolidBrush sb = new SolidBrush(Color.Black); g.FillRectangle(sb, 0, this.mLineNo * FormControl.CELL_HEIGHT, inWidth, FormControl.CELL_HEIGHT); } else { SolidBrush sb = new SolidBrush(Color.FromArgb(0xFF, 20, 20, 30)); g.FillRectangle(sb, 0, this.mLineNo * FormControl.CELL_HEIGHT, inWidth, FormControl.CELL_HEIGHT); } } //以下、名前描画処理 string clName = ClsTool.CnvTypeOption2Name(this.mTypeOption); if (!string.IsNullOrEmpty(clName)) { string clBlank = this.GetTabBlank(); g.DrawString(clBlank + clName, clFont, Brushes.White, 69, this.mLineNo * FormControl.CELL_HEIGHT + 2); } }
/// <summary> /// エレメントのタイムライン描画処理 /// </summary> /// <param name="g">描画管理クラス</param> /// <param name="inSelectLineNo">選択中のライン番号</param> /// <param name="inSelectFrameNo">選択中のフレーム</param> /// <param name="inMaxFrameNum">最大フレーム数</param> /// <param name="inWidth">描画先の幅</param> /// <param name="inHeight">描画先の高さ</param> public void DrawTime(Graphics g, int inSelectLineNo, int inSelectFrameNo, int inMaxFrameNum, int inWidth, int inHeight) { //以下、表示しなくてはいけない種別かどうかチェックする処理 bool isDraw = ClsDatOption.IsDraw(this.mTypeOption); if (!isDraw) { return; } //以下、背景を塗る処理 SolidBrush clBrush; int inX = inSelectFrameNo * FormControl.CELL_WIDTH; int inY = this.mLineNo * FormControl.CELL_HEIGHT; if (inSelectLineNo == this.mLineNo) { //選択中Elementsの背景強調 clBrush = new SolidBrush(Color.DarkGreen); g.FillRectangle(clBrush, 0, inY, inWidth, FormControl.CELL_HEIGHT); } else { if (this.mLineNo % 2 == 0) { clBrush = new SolidBrush(Color.Black); g.FillRectangle(clBrush, 0, inY, inWidth, FormControl.CELL_HEIGHT); } else { clBrush = new SolidBrush(Color.FromArgb(0xFF, 20, 20, 30)); g.FillRectangle(clBrush, 0, inY, inWidth, FormControl.CELL_HEIGHT); } } //以下、フレームの背景(Tweenの影響下にあるかどうか)を表示する処理 Color stColorTween = Color.FromArgb(128, Color.LightBlue); SolidBrush clBrushTween = new SolidBrush(stColorTween); bool isFlag = false; int inFrameNo = 0; for (inFrameNo = 0; inFrameNo < inMaxFrameNum; inFrameNo++) { //以下、キーフレームが存在するかチェックする処理 if (inFrameNo == 0) { isFlag = true; } else { bool isExist = this.IsExistKeyFrame(inFrameNo); if (isExist) { ClsDatKeyFrame clKeyFrame = this.GetKeyFrame(inFrameNo); isFlag = (clKeyFrame.mTween1 != null || clKeyFrame.mTween2 != null); } } if (!isFlag) { continue; } inX = inFrameNo * FormControl.CELL_WIDTH; inY = this.mLineNo * FormControl.CELL_HEIGHT; g.FillRectangle(clBrushTween, inX, inY + 10, FormControl.CELL_WIDTH, FormControl.CELL_HEIGHT / 2 - 4); } //以下、選択中のフレーム描画処理 inX = inSelectFrameNo * FormControl.CELL_WIDTH; inY = this.mLineNo * FormControl.CELL_HEIGHT; if (inSelectLineNo == this.mLineNo) { Color stColor = Color.FromArgb(128, Color.Green); clBrush = new SolidBrush(stColor); } else { Color stColor = Color.FromArgb(128, Color.DarkGreen); clBrush = new SolidBrush(stColor); } g.FillRectangle(clBrush, inX, inY, FormControl.CELL_WIDTH, FormControl.CELL_HEIGHT); //以下、境界線描画処理 Pen clPen = new Pen(Color.Green); inY = this.mLineNo * FormControl.CELL_HEIGHT + FormControl.CELL_HEIGHT - 1; g.DrawLine(clPen, 0, inY, inWidth, inY); //以下、キーフレーム表示処理 for (inFrameNo = 0; inFrameNo < inMaxFrameNum; inFrameNo++) { bool isExist = this.mDicKeyFrame.ContainsKey(inFrameNo); if (!isExist) { continue; } g.DrawImage(Properties.Resources.markRed, inFrameNo * FormControl.CELL_WIDTH + 2, this.mLineNo * FormControl.CELL_HEIGHT + 1); } }