diff --git a/Form1.Designer.cs b/Form1.Designer.cs index 07a67d5..d891086 100644 --- a/Form1.Designer.cs +++ b/Form1.Designer.cs @@ -28,9 +28,6 @@ /// private void InitializeComponent() { - groupBox1 = new GroupBox(); - radioButton2 = new RadioButton(); - radioButton1 = new RadioButton(); panel1 = new Panel(); groupBox3 = new GroupBox(); button2 = new Button(); @@ -42,59 +39,29 @@ fileToolStripMenuItem = new ToolStripMenuItem(); helpToolStripMenuItem = new ToolStripMenuItem(); aboutToolStripMenuItem = new ToolStripMenuItem(); + renderToolStripMenuItem = new ToolStripMenuItem(); + fontFamilyToolStripMenuItem = new ToolStripMenuItem(); + serifToolStripMenuItem = new ToolStripMenuItem(); + sansSerifToolStripMenuItem = new ToolStripMenuItem(); + forceMonospaceToolStripMenuItem = new ToolStripMenuItem(); Opener = new OpenFileDialog(); Saver = new SaveFileDialog(); - groupBox1.SuspendLayout(); + groupBox4 = new GroupBox(); + chromiumWebBrowser1 = new CefSharp.WinForms.ChromiumWebBrowser(); + button4 = new Button(); + progressBar1 = new ProgressBar(); + button3 = new Button(); panel1.SuspendLayout(); groupBox3.SuspendLayout(); groupBox2.SuspendLayout(); menuStrip1.SuspendLayout(); + groupBox4.SuspendLayout(); SuspendLayout(); // - // groupBox1 - // - groupBox1.Controls.Add(radioButton2); - groupBox1.Controls.Add(radioButton1); - groupBox1.Dock = DockStyle.Left; - groupBox1.Location = new Point(0, 0); - groupBox1.Name = "groupBox1"; - groupBox1.Size = new Size(126, 67); - groupBox1.TabIndex = 0; - groupBox1.TabStop = false; - groupBox1.Text = "File mode"; - // - // radioButton2 - // - radioButton2.AutoSize = true; - radioButton2.Dock = DockStyle.Top; - radioButton2.FlatStyle = FlatStyle.System; - radioButton2.Location = new Point(3, 39); - radioButton2.Name = "radioButton2"; - radioButton2.Size = new Size(120, 20); - radioButton2.TabIndex = 1; - radioButton2.Text = "Render mode"; - radioButton2.UseVisualStyleBackColor = true; - // - // radioButton1 - // - radioButton1.AutoSize = true; - radioButton1.Checked = true; - radioButton1.Dock = DockStyle.Top; - radioButton1.FlatStyle = FlatStyle.System; - radioButton1.Location = new Point(3, 19); - radioButton1.Name = "radioButton1"; - radioButton1.Size = new Size(120, 20); - radioButton1.TabIndex = 0; - radioButton1.TabStop = true; - radioButton1.Text = "Converter mode"; - radioButton1.UseVisualStyleBackColor = true; - radioButton1.CheckedChanged += radioButton1_CheckedChanged; - // // panel1 // panel1.Controls.Add(groupBox3); panel1.Controls.Add(groupBox2); - panel1.Controls.Add(groupBox1); panel1.Dock = DockStyle.Top; panel1.Location = new Point(0, 24); panel1.Name = "panel1"; @@ -106,9 +73,9 @@ groupBox3.Controls.Add(button2); groupBox3.Controls.Add(textBox2); groupBox3.Dock = DockStyle.Fill; - groupBox3.Location = new Point(439, 0); + groupBox3.Location = new Point(401, 0); groupBox3.Name = "groupBox3"; - groupBox3.Size = new Size(361, 67); + groupBox3.Size = new Size(399, 67); groupBox3.TabIndex = 2; groupBox3.TabStop = false; groupBox3.Text = "Input file"; @@ -119,7 +86,7 @@ button2.FlatStyle = FlatStyle.System; button2.Location = new Point(3, 42); button2.Name = "button2"; - button2.Size = new Size(355, 22); + button2.Size = new Size(393, 22); button2.TabIndex = 3; button2.Text = "Select file"; button2.UseVisualStyleBackColor = true; @@ -131,7 +98,7 @@ textBox2.Location = new Point(3, 19); textBox2.Name = "textBox2"; textBox2.PlaceholderText = "Type path or select file below. "; - textBox2.Size = new Size(355, 23); + textBox2.Size = new Size(393, 23); textBox2.TabIndex = 2; // // groupBox2 @@ -139,9 +106,9 @@ groupBox2.Controls.Add(button1); groupBox2.Controls.Add(textBox1); groupBox2.Dock = DockStyle.Left; - groupBox2.Location = new Point(126, 0); + groupBox2.Location = new Point(0, 0); groupBox2.Name = "groupBox2"; - groupBox2.Size = new Size(313, 67); + groupBox2.Size = new Size(401, 67); groupBox2.TabIndex = 1; groupBox2.TabStop = false; groupBox2.Text = "Output file"; @@ -152,7 +119,7 @@ button1.FlatStyle = FlatStyle.System; button1.Location = new Point(3, 42); button1.Name = "button1"; - button1.Size = new Size(307, 22); + button1.Size = new Size(395, 22); button1.TabIndex = 1; button1.Text = "Select path"; button1.UseVisualStyleBackColor = true; @@ -164,12 +131,12 @@ textBox1.Location = new Point(3, 19); textBox1.Name = "textBox1"; textBox1.PlaceholderText = "Type path or select path below. "; - textBox1.Size = new Size(307, 23); + textBox1.Size = new Size(395, 23); textBox1.TabIndex = 0; // // menuStrip1 // - menuStrip1.Items.AddRange(new ToolStripItem[] { fileToolStripMenuItem, helpToolStripMenuItem }); + menuStrip1.Items.AddRange(new ToolStripItem[] { fileToolStripMenuItem, helpToolStripMenuItem, renderToolStripMenuItem }); menuStrip1.Location = new Point(0, 0); menuStrip1.Name = "menuStrip1"; menuStrip1.RenderMode = ToolStripRenderMode.System; @@ -198,6 +165,40 @@ aboutToolStripMenuItem.Text = "About"; aboutToolStripMenuItem.Click += aboutToolStripMenuItem_Click; // + // renderToolStripMenuItem + // + renderToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { fontFamilyToolStripMenuItem }); + renderToolStripMenuItem.Name = "renderToolStripMenuItem"; + renderToolStripMenuItem.Size = new Size(56, 20); + renderToolStripMenuItem.Text = "Render"; + // + // fontFamilyToolStripMenuItem + // + fontFamilyToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { serifToolStripMenuItem, sansSerifToolStripMenuItem, forceMonospaceToolStripMenuItem }); + fontFamilyToolStripMenuItem.Name = "fontFamilyToolStripMenuItem"; + fontFamilyToolStripMenuItem.Size = new Size(136, 22); + fontFamilyToolStripMenuItem.Text = "Font Family"; + // + // serifToolStripMenuItem + // + serifToolStripMenuItem.Name = "serifToolStripMenuItem"; + serifToolStripMenuItem.Size = new Size(176, 22); + serifToolStripMenuItem.Text = "Serif"; + // + // sansSerifToolStripMenuItem + // + sansSerifToolStripMenuItem.Checked = true; + sansSerifToolStripMenuItem.CheckState = CheckState.Checked; + sansSerifToolStripMenuItem.Name = "sansSerifToolStripMenuItem"; + sansSerifToolStripMenuItem.Size = new Size(176, 22); + sansSerifToolStripMenuItem.Text = "(Default) Sans serif"; + // + // forceMonospaceToolStripMenuItem + // + forceMonospaceToolStripMenuItem.Name = "forceMonospaceToolStripMenuItem"; + forceMonospaceToolStripMenuItem.Size = new Size(176, 22); + forceMonospaceToolStripMenuItem.Text = "(Force) Monospace"; + // // Opener // Opener.DefaultExt = "md"; @@ -210,18 +211,76 @@ Saver.DefaultExt = "html"; Saver.Filter = "HTML websites|*.html|All files|*.*"; // + // groupBox4 + // + groupBox4.Controls.Add(progressBar1); + groupBox4.Controls.Add(chromiumWebBrowser1); + groupBox4.Controls.Add(button4); + groupBox4.Dock = DockStyle.Fill; + groupBox4.Location = new Point(0, 91); + groupBox4.Name = "groupBox4"; + groupBox4.Size = new Size(800, 401); + groupBox4.TabIndex = 3; + groupBox4.TabStop = false; + groupBox4.Text = "Preview"; + // + // chromiumWebBrowser1 + // + chromiumWebBrowser1.ActivateBrowserOnCreation = false; + chromiumWebBrowser1.Dock = DockStyle.Fill; + chromiumWebBrowser1.Location = new Point(3, 42); + chromiumWebBrowser1.Name = "chromiumWebBrowser1"; + chromiumWebBrowser1.Size = new Size(794, 356); + chromiumWebBrowser1.TabIndex = 0; + chromiumWebBrowser1.LoadingStateChanged += chromiumWebBrowser1_LoadingStateChanged; + // + // button4 + // + button4.Dock = DockStyle.Top; + button4.FlatStyle = FlatStyle.System; + button4.Location = new Point(3, 19); + button4.Name = "button4"; + button4.Size = new Size(794, 23); + button4.TabIndex = 1; + button4.Text = "Render preview"; + button4.UseVisualStyleBackColor = true; + // + // progressBar1 + // + progressBar1.Dock = DockStyle.Top; + progressBar1.Location = new Point(3, 42); + progressBar1.Name = "progressBar1"; + progressBar1.Size = new Size(794, 2); + progressBar1.Style = ProgressBarStyle.Marquee; + progressBar1.TabIndex = 2; + // + // button3 + // + button3.BackColor = Color.Transparent; + button3.Dock = DockStyle.Bottom; + button3.FlatStyle = FlatStyle.Flat; + button3.Location = new Point(0, 469); + button3.Name = "button3"; + button3.Size = new Size(800, 23); + button3.TabIndex = 4; + button3.Text = "Convert"; + button3.UseVisualStyleBackColor = false; + button3.Click += button3_Click; + // // Form1 // AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(800, 492); + Controls.Add(button3); + Controls.Add(groupBox4); Controls.Add(panel1); Controls.Add(menuStrip1); MainMenuStrip = menuStrip1; + MinimumSize = new Size(633, 531); Name = "Form1"; Text = "MintHTML"; - groupBox1.ResumeLayout(false); - groupBox1.PerformLayout(); + Load += Form1_Load; panel1.ResumeLayout(false); groupBox3.ResumeLayout(false); groupBox3.PerformLayout(); @@ -229,15 +288,12 @@ groupBox2.PerformLayout(); menuStrip1.ResumeLayout(false); menuStrip1.PerformLayout(); + groupBox4.ResumeLayout(false); ResumeLayout(false); PerformLayout(); } #endregion - - private GroupBox groupBox1; - private RadioButton radioButton2; - private RadioButton radioButton1; private Panel panel1; private MenuStrip menuStrip1; private ToolStripMenuItem fileToolStripMenuItem; @@ -251,5 +307,15 @@ private TextBox textBox2; private OpenFileDialog Opener; private SaveFileDialog Saver; + private GroupBox groupBox4; + private Button button3; + private CefSharp.WinForms.ChromiumWebBrowser chromiumWebBrowser1; + private Button button4; + private ToolStripMenuItem renderToolStripMenuItem; + private ToolStripMenuItem fontFamilyToolStripMenuItem; + private ToolStripMenuItem serifToolStripMenuItem; + private ToolStripMenuItem sansSerifToolStripMenuItem; + private ToolStripMenuItem forceMonospaceToolStripMenuItem; + private ProgressBar progressBar1; } } diff --git a/Form1.cs b/Form1.cs index 8b03e2c..f8ddae5 100644 --- a/Form1.cs +++ b/Form1.cs @@ -1,3 +1,6 @@ +using CefSharp; +using CefSharp.WinForms; + namespace MintHTML { public partial class Form1 : Form @@ -7,11 +10,6 @@ namespace MintHTML InitializeComponent(); } - private void radioButton1_CheckedChanged(object sender, EventArgs e) - { - groupBox2.Enabled = radioButton1.Checked; - } - private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { MessageBox.Show("MintHTML is a simple Markdown converter and renderer made by SweeZero.", "About", MessageBoxButtons.OK); @@ -27,6 +25,22 @@ namespace MintHTML { Saver.ShowDialog(); textBox1.Text = Saver.FileName; + + } + + private void chromiumWebBrowser1_LoadingStateChanged(object sender, CefSharp.LoadingStateChangedEventArgs e) + { + + } + + private void Form1_Load(object sender, EventArgs e) + { + chromiumWebBrowser1.LoadHtml("

MintHTML

Open a markdown file and press \"Render preview\" to see the output here.

"); + } + + private void button3_Click(object sender, EventArgs e) + { + } } } diff --git a/Form1.resx b/Form1.resx index 3b1fcdc..9b078e8 100644 --- a/Form1.resx +++ b/Form1.resx @@ -121,9 +121,12 @@ 17, 17 - 132, 17 + 120, 18 - 271, 17 + 201, 20 + + + 64 \ No newline at end of file diff --git a/MintHTML.csproj b/MintHTML.csproj index 010590e..0be5af1 100644 --- a/MintHTML.csproj +++ b/MintHTML.csproj @@ -4,8 +4,13 @@ WinExe net6.0-windows7.0 enable - true + True enable + true + + + + \ No newline at end of file