From 84561f1ac145329f49544dd6d6666f9f2f571c18 Mon Sep 17 00:00:00 2001 From: Anton Mukhin Date: Thu, 11 May 2023 14:00:37 +0300 Subject: [PATCH] rich text box test 1 --- McBitFont/Export.cs | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/McBitFont/Export.cs b/McBitFont/Export.cs index 94f9fcb..3d320d2 100644 --- a/McBitFont/Export.cs +++ b/McBitFont/Export.cs @@ -124,7 +124,7 @@ namespace McBitFont { } private void btnGenerate_Click(object sender, EventArgs e) { - //string output = ""; + string output = ""; txtOutput.Clear(); bool com = cbComments.Checked; bool hdr = cbHeader.Checked; @@ -132,21 +132,21 @@ namespace McBitFont { if (com) { //Header comments - txtOutput.AppendText(comments["header"]); - txtOutput.AppendText(comments["scan_order"] + cbOrder.Text + "\n"); - txtOutput.AppendText(comments["scan_hdir"] + cbHDir.Text + "\n"); - txtOutput.AppendText(comments["scan_vdir"] + cbVDir.Text + "\n\n"); + output += comments["header"]; + output += comments["scan_order"] + cbOrder.Text + "\n"; + output += comments["scan_hdir"] + cbHDir.Text + "\n"; + output += comments["scan_vdir"] + cbVDir.Text + "\n\n"; - txtOutput.AppendText(comments["num_bit_order"] + cbBitOrder.Text + "\n"); - txtOutput.AppendText(comments["num_base"] + cbNumBase.Text + "\n"); - txtOutput.AppendText(comments["num_size"] + cbNumSize.Text + "\n\n"); + output += comments["num_bit_order"] + cbBitOrder.Text + "\n"; + output += comments["num_base"] + cbNumBase.Text + "\n"; + output += comments["num_size"] + cbNumSize.Text + "\n\n"; - txtOutput.AppendText(comments["text_format"] + cbFormat.Text + "\n"); - txtOutput.AppendText(comments["text_lines"] + cbLines.Text + "\n\n"); + output += comments["text_format"] + cbFormat.Text + "\n"; + output += comments["text_lines"] + cbLines.Text + "\n\n"; if (hdr) { // comment about meta header map - txtOutput.AppendText(comments["font_header_map"] + "\n\n"); + output += comments["font_header_map"] + "\n\n"; } } @@ -240,9 +240,9 @@ namespace McBitFont { } //Array definition - txtOutput.AppendText("const " + dataType + " " + mainForm.prjName + "[] = {\n"); + output += "const " + dataType + " " + mainForm.prjName + "[] = {\n"; - if (com) txtOutput.AppendText(" // Data:\n"); + if (com) output += " // Data:\n"; foreach ( MainForm.FrameMiniature f in mainForm.frames) { // For each frame string str; @@ -252,7 +252,7 @@ namespace McBitFont { if (com && lines != 1) { // Comments enabled and other than "1 symbol per line" selected // Print a symbol comment before its data - txtOutput.AppendText(" // " + f.code.ToString() + " --> \n"); + output += " // " + f.code.ToString() + " --> \n"; } for (int i = imin; i != imax; i += idir) { str = " "; @@ -283,16 +283,17 @@ namespace McBitFont { str += pref + Convert.ToString(b, nbase).PadLeft(pad, '0') + ','; } } - txtOutput.AppendText(str); - txtOutput.AppendText(Environment.NewLine); + output += str; + output += Environment.NewLine; } - txtOutput.AppendText(Environment.NewLine); + output += Environment.NewLine; } // Close array definition - txtOutput.AppendText("};\n"); + output += "};\n"; - txtOutput.SelectAll(); - ParseText(); + txtOutput.Text = output; + //txtOutput.SelectAll(); + //ParseText(); txtOutput.SelectionStart = 0; txtOutput.ScrollToCaret(); }