//------------------------------------------------------- public string MakeScriptLayer( ) { if (tsg == null) { return(string.Empty); } string ret = ScriptLoad(m_ScriptLayerPath); if (ret == "") { ret = AE_RemapExceed.Properties.Resources.ScriptLayer; } string oName = "RX"; Regex r = new Regex("<RX>", RegexOptions.IgnoreCase); ret = r.Replace(ret, oName); r = new Regex("<frameCount>", RegexOptions.IgnoreCase); ret = r.Replace(ret, tsd.FrameCount.ToString()); r = new Regex("<frameRate>", RegexOptions.IgnoreCase); ret = r.Replace(ret, ((int)tsd.FrameRate).ToString()); r = new Regex("<caption>", RegexOptions.IgnoreCase); ret = r.Replace(ret, "\"" + tsd.CellCaption(tsg.sel.Index) + "\""); string cellData = ""; string lineHead = "\t" + oName + ".setKeyData("; string lineFoot = ");\n"; int[] c = tsd.GetCellDataTrue(tsg.sel.Index); if (c.Length > 0) { cellData += lineHead + "0," + c[0].ToString() + lineFoot; for (int j = 1; j < c.Length; j++) { if (c[j - 1] != c[j]) { cellData += lineHead + j.ToString() + "," + c[j].ToString() + lineFoot; } } } r = new Regex("<cellData>", RegexOptions.IgnoreCase); ret = r.Replace(ret, cellData); return(ret); }
//****************************************************** private string GetCaption(int idx) { if (tsd == null) { return(string.Empty); } return(tsd.CellCaption(idx)); }
//--------------------------------------------------------------------- private void DrawCaption(Graphics g, int cell) { if (tsg == null) { return; } int x0 = cell * tsd.CellWidth; int y0 = 0; int w = tsd.CellWidth; int h = this.Height; int x1 = x0 + w; int y1 = y0 + h; //画面外なら何もしない if ((x0 > this.Width) || (x1 < 0)) { return; } SolidBrush b = new SolidBrush(cols.CaptionBase); Pen p = new Pen(cols.CapLine, 1); Rectangle rct = new Rectangle(x0, y0, w, h); try { //セルを背景色で塗る if (cell == tsg.CellIndex) { b.Color = cols.CaptionSelection; } g.FillRectangle(b, x0, y0, w, h); string s; s = tsd.CellCaption(cell); b.Color = cols.Text; g.DrawString(s, this.Font, b, rct, format); g.DrawLine(p, x0, y0, x0, y1); //g.DrawLine(p, x0, y0, x1, y0); } finally { b.Dispose(); p.Dispose(); } }
//---------------------------------------------------------- public List <string> SetSaveData( ) { List <string> lines = new List <string>(); if (data == null) { return(lines); } //ヘッダー lines.Add(D_Header); lines.Add(""); //コメント lines.Add(D_Comment); if (data.Comment.Count > 0) { foreach (string s in data.Comment) { lines.Add(s); } } lines.Add(""); //パラメータブロック data.ChkTimes(); lines.Add(D_Param); data.ToParams(); foreach (ard_prms p in data.Params) { lines.Add(p.Tag + TAB + p.Value); } lines.Add(""); //CellName lines.Add(D_CellName); for (int i = 0; i < data.CellCount; i++) { string s = i.ToString() + TAB + data.CellCaption(i); lines.Add(s); } lines.Add(""); //Memo lines.Add(D_Memo); for (int i = 0; i < data.FrameCount; i++) { string s = data.Memo(i); if (s != string.Empty) { s = FrameStr(i + 1) + TAB + s; lines.Add(s); } } lines.Add(""); //FrameEnabled lines.Add(D_FrameEnabled); int[] fe = data.getFrameEnabled(); for (int i = 0; i < fe.Length; i++) { if (fe[i] < 0) { fe[i] = 1; } else { fe[i] = 0; } } lines.Add(FrameStr(1) + TAB + fe[0].ToString()); for (int i = 1; i < fe.Length; i++) { if (fe[i - 1] != fe[i]) { lines.Add(FrameStr(i + 1) + TAB + fe[i].ToString()); } } lines.Add(""); //cellData lines.Add(D_CellDataStart); for (int i = 0; i < data.CellCount; i++) { if (data.IsCellData(i)) { lines.Add(D_Cell + TAB + i.ToString()); int c = data.GetCellData(i, 0); lines.Add(FrameStr(1) + TAB + c.ToString()); int bef = c; for (int frm = 1; frm < data.FrameCount; frm++) { c = data.GetCellData(i, frm); if (c != bef) { lines.Add(FrameStr(frm + 1) + TAB + c.ToString()); } bef = c; } lines.Add(D_CellEnd + TAB + i.ToString()); } } lines.Add(D_End); return(lines); }