Added Python support

This commit is contained in:
CreepyCrafter24 2018-09-09 09:49:07 +02:00
parent 929b482a12
commit 1cb9faaa1d
7 changed files with 457 additions and 78 deletions

269
cashew/Form1.Designer.cs generated
View File

@ -30,7 +30,7 @@
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MAIN));
this.metroTabControl1 = new MetroFramework.Controls.MetroTabControl();
this.languageTabControl = new MetroFramework.Controls.MetroTabControl();
this.cstab = new MetroFramework.Controls.MetroTabPage();
this.cslive = new MetroFramework.Controls.MetroTile();
this.csinftc = new MetroFramework.Controls.MetroTabControl();
@ -43,17 +43,18 @@
this.csediterrors = new MetroFramework.Controls.MetroLabel();
this.cseditref = new MetroFramework.Controls.MetroTile();
this.cslivetp = new MetroFramework.Controls.MetroTabPage();
this.cslivenotyetimplemented = new MetroFramework.Controls.MetroLabel();
this.csedit = new MetroFramework.Controls.MetroTile();
this.htmltab = new MetroFramework.Controls.MetroTabPage();
this.htmlSep = new System.Windows.Forms.SplitContainer();
this.htmlRefreshTile = new MetroFramework.Controls.MetroTile();
this.livehider = new MetroFramework.Controls.MetroPanel();
this.htmlUpdateToggle = new MetroFramework.Controls.MetroToggle();
this.htmlLiveLabel = new MetroFramework.Controls.MetroLabel();
this.htmlLoad = new MetroFramework.Controls.MetroTile();
this.htmlSave = new MetroFramework.Controls.MetroTile();
this.htmlOptionsTile = new MetroFramework.Controls.MetroTile();
this.htmltext = new MetroFramework.Controls.MetroTextBox();
this.livehider = new MetroFramework.Controls.MetroPanel();
this.htmlUpdateToggle = new MetroFramework.Controls.MetroToggle();
this.htmlLoadIndicator = new MetroFramework.Controls.MetroProgressSpinner();
this.htmltitle = new MetroFramework.Controls.MetroLabel();
this.htmldisplay = new System.Windows.Forms.WebBrowser();
@ -69,6 +70,7 @@
this.hTMLStructureSetupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.linkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.imageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.centercenterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.textToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.headingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.heading1h1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -77,6 +79,7 @@
this.heading4h4ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.heading5h5ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.heading6h6ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.paragraphpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.boldbToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.underlineuToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.italiciToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -129,10 +132,15 @@
this.htmlSaveFileDialog = new System.Windows.Forms.SaveFileDialog();
this.htmlOpenFileDialog = new System.Windows.Forms.OpenFileDialog();
this.nightmodehide = new MetroFramework.Controls.MetroPanel();
this.cslivenotyetimplemented = new MetroFramework.Controls.MetroLabel();
this.centercenterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.paragraphpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.metroTabControl1.SuspendLayout();
this.pythontab = new MetroFramework.Controls.MetroTabPage();
this.pythonSave = new MetroFramework.Controls.MetroTile();
this.pythonRun = new MetroFramework.Controls.MetroTile();
this.pythonOpen = new MetroFramework.Controls.MetroTile();
this.pythonCode = new MetroFramework.Controls.MetroTextBox();
this.pythonExtract = new MetroFramework.Controls.MetroTile();
this.pythonOpenFileDialog = new System.Windows.Forms.OpenFileDialog();
this.pythonSaveFileDialog = new System.Windows.Forms.SaveFileDialog();
this.languageTabControl.SuspendLayout();
this.cstab.SuspendLayout();
this.csinftc.SuspendLayout();
this.csedittp.SuspendLayout();
@ -145,22 +153,24 @@
this.htmlSep.SuspendLayout();
this.infotab.SuspendLayout();
this.htmlOptionsMenu.SuspendLayout();
this.pythontab.SuspendLayout();
this.SuspendLayout();
//
// metroTabControl1
// languageTabControl
//
this.metroTabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
this.languageTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.metroTabControl1.Controls.Add(this.cstab);
this.metroTabControl1.Controls.Add(this.htmltab);
this.metroTabControl1.Controls.Add(this.infotab);
this.metroTabControl1.Location = new System.Drawing.Point(23, 63);
this.metroTabControl1.Name = "metroTabControl1";
this.metroTabControl1.SelectedIndex = 0;
this.metroTabControl1.Size = new System.Drawing.Size(797, 432);
this.metroTabControl1.TabIndex = 0;
this.metroTabControl1.UseSelectable = true;
this.languageTabControl.Controls.Add(this.cstab);
this.languageTabControl.Controls.Add(this.htmltab);
this.languageTabControl.Controls.Add(this.pythontab);
this.languageTabControl.Controls.Add(this.infotab);
this.languageTabControl.Location = new System.Drawing.Point(23, 63);
this.languageTabControl.Name = "languageTabControl";
this.languageTabControl.SelectedIndex = 2;
this.languageTabControl.Size = new System.Drawing.Size(797, 432);
this.languageTabControl.TabIndex = 0;
this.languageTabControl.UseSelectable = true;
//
// cstab
//
@ -364,6 +374,20 @@
this.cslivetp.VerticalScrollbarHighlightOnWheel = false;
this.cslivetp.VerticalScrollbarSize = 10;
//
// cslivenotyetimplemented
//
this.cslivenotyetimplemented.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.cslivenotyetimplemented.AutoSize = true;
this.cslivenotyetimplemented.FontSize = MetroFramework.MetroLabelSize.Tall;
this.cslivenotyetimplemented.FontWeight = MetroFramework.MetroLabelWeight.Bold;
this.cslivenotyetimplemented.Location = new System.Drawing.Point(240, 143);
this.cslivenotyetimplemented.Name = "cslivenotyetimplemented";
this.cslivenotyetimplemented.Size = new System.Drawing.Size(220, 25);
this.cslivenotyetimplemented.TabIndex = 2;
this.cslivenotyetimplemented.Text = "NOT YET IMPLEMENTED";
//
// csedit
//
this.csedit.ActiveControl = null;
@ -432,34 +456,6 @@
this.htmlRefreshTile.UseSelectable = true;
this.htmlRefreshTile.Click += new System.EventHandler(this.htmlRefreshTile_Click);
//
// livehider
//
this.livehider.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.livehider.HorizontalScrollbarBarColor = true;
this.livehider.HorizontalScrollbarHighlightOnWheel = false;
this.livehider.HorizontalScrollbarSize = 10;
this.livehider.Location = new System.Drawing.Point(238, 3);
this.livehider.Name = "livehider";
this.livehider.Size = new System.Drawing.Size(45, 17);
this.livehider.TabIndex = 4;
this.livehider.VerticalScrollbarBarColor = true;
this.livehider.VerticalScrollbarHighlightOnWheel = false;
this.livehider.VerticalScrollbarSize = 10;
//
// htmlUpdateToggle
//
this.htmlUpdateToggle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.htmlUpdateToggle.AutoSize = true;
this.htmlUpdateToggle.Checked = true;
this.htmlUpdateToggle.CheckState = System.Windows.Forms.CheckState.Checked;
this.htmlUpdateToggle.Location = new System.Drawing.Point(255, 3);
this.htmlUpdateToggle.Name = "htmlUpdateToggle";
this.htmlUpdateToggle.Size = new System.Drawing.Size(80, 17);
this.htmlUpdateToggle.TabIndex = 4;
this.htmlUpdateToggle.Text = "An";
this.htmlUpdateToggle.UseSelectable = true;
this.htmlUpdateToggle.CheckedChanged += new System.EventHandler(this.metroToggle2_CheckedChanged);
//
// htmlLiveLabel
//
this.htmlLiveLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@ -550,6 +546,34 @@
this.htmltext.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
this.htmltext.TextChanged += new System.EventHandler(this.htmltext_TextChanged);
//
// livehider
//
this.livehider.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.livehider.HorizontalScrollbarBarColor = true;
this.livehider.HorizontalScrollbarHighlightOnWheel = false;
this.livehider.HorizontalScrollbarSize = 10;
this.livehider.Location = new System.Drawing.Point(238, 3);
this.livehider.Name = "livehider";
this.livehider.Size = new System.Drawing.Size(45, 17);
this.livehider.TabIndex = 4;
this.livehider.VerticalScrollbarBarColor = true;
this.livehider.VerticalScrollbarHighlightOnWheel = false;
this.livehider.VerticalScrollbarSize = 10;
//
// htmlUpdateToggle
//
this.htmlUpdateToggle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.htmlUpdateToggle.AutoSize = true;
this.htmlUpdateToggle.Checked = true;
this.htmlUpdateToggle.CheckState = System.Windows.Forms.CheckState.Checked;
this.htmlUpdateToggle.Location = new System.Drawing.Point(255, 3);
this.htmlUpdateToggle.Name = "htmlUpdateToggle";
this.htmlUpdateToggle.Size = new System.Drawing.Size(80, 17);
this.htmlUpdateToggle.TabIndex = 4;
this.htmlUpdateToggle.Text = "An";
this.htmlUpdateToggle.UseSelectable = true;
this.htmlUpdateToggle.CheckedChanged += new System.EventHandler(this.metroToggle2_CheckedChanged);
//
// htmlLoadIndicator
//
this.htmlLoadIndicator.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@ -603,11 +627,9 @@
this.infoPanel.AutoSize = true;
this.infoPanel.Location = new System.Drawing.Point(3, 0);
this.infoPanel.Name = "infoPanel";
this.infoPanel.Size = new System.Drawing.Size(473, 95);
this.infoPanel.Size = new System.Drawing.Size(532, 95);
this.infoPanel.TabIndex = 2;
this.infoPanel.Text = "This Program uses MetroModernUI by Dennis Magno.\r\nFunctionality:\r\n- Select a cate" +
"gory (Top bar) and use the provided functions to write programs.\r\n\r\nIF YOU WANT " +
"A PROFESSIONAL PROGRAM, DON\'T USE THIS!";
this.infoPanel.Text = resources.GetString("infoPanel.Text");
//
// nightmodeToggle
//
@ -695,6 +717,13 @@
this.imageToolStripMenuItem.Text = "Image";
this.imageToolStripMenuItem.Click += new System.EventHandler(this.imageToolStripMenuItem_Click);
//
// centercenterToolStripMenuItem
//
this.centercenterToolStripMenuItem.Name = "centercenterToolStripMenuItem";
this.centercenterToolStripMenuItem.Size = new System.Drawing.Size(191, 22);
this.centercenterToolStripMenuItem.Text = "Center <center>";
this.centercenterToolStripMenuItem.Click += new System.EventHandler(this.centercenterToolStripMenuItem_Click);
//
// textToolStripMenuItem
//
this.textToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -765,6 +794,13 @@
this.heading6h6ToolStripMenuItem.Text = "Heading 6 <h6>";
this.heading6h6ToolStripMenuItem.Click += new System.EventHandler(this.heading6h6ToolStripMenuItem_Click);
//
// paragraphpToolStripMenuItem
//
this.paragraphpToolStripMenuItem.Name = "paragraphpToolStripMenuItem";
this.paragraphpToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
this.paragraphpToolStripMenuItem.Text = "Paragraph <p>";
this.paragraphpToolStripMenuItem.Click += new System.EventHandler(this.paragraphpToolStripMenuItem_Click);
//
// boldbToolStripMenuItem
//
this.boldbToolStripMenuItem.Name = "boldbToolStripMenuItem";
@ -1170,33 +1206,111 @@
this.nightmodehide.VerticalScrollbarHighlightOnWheel = false;
this.nightmodehide.VerticalScrollbarSize = 10;
//
// cslivenotyetimplemented
// pythontab
//
this.cslivenotyetimplemented.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
this.pythontab.Controls.Add(this.pythonExtract);
this.pythontab.Controls.Add(this.pythonSave);
this.pythontab.Controls.Add(this.pythonRun);
this.pythontab.Controls.Add(this.pythonOpen);
this.pythontab.Controls.Add(this.pythonCode);
this.pythontab.HorizontalScrollbarBarColor = true;
this.pythontab.HorizontalScrollbarHighlightOnWheel = false;
this.pythontab.HorizontalScrollbarSize = 10;
this.pythontab.Location = new System.Drawing.Point(4, 38);
this.pythontab.Name = "pythontab";
this.pythontab.Size = new System.Drawing.Size(789, 390);
this.pythontab.TabIndex = 3;
this.pythontab.Text = "Python";
this.pythontab.VerticalScrollbarBarColor = true;
this.pythontab.VerticalScrollbarHighlightOnWheel = false;
this.pythontab.VerticalScrollbarSize = 10;
//
// pythonSave
//
this.pythonSave.ActiveControl = null;
this.pythonSave.Location = new System.Drawing.Point(84, 3);
this.pythonSave.Name = "pythonSave";
this.pythonSave.Size = new System.Drawing.Size(75, 38);
this.pythonSave.TabIndex = 8;
this.pythonSave.Text = "Save";
this.pythonSave.UseSelectable = true;
this.pythonSave.Click += new System.EventHandler(this.pythonSave_Click);
//
// pythonRun
//
this.pythonRun.ActiveControl = null;
this.pythonRun.Location = new System.Drawing.Point(165, 3);
this.pythonRun.Name = "pythonRun";
this.pythonRun.Size = new System.Drawing.Size(75, 38);
this.pythonRun.TabIndex = 7;
this.pythonRun.Text = "Run";
this.pythonRun.UseSelectable = true;
this.pythonRun.Click += new System.EventHandler(this.pythonRun_Click);
//
// pythonOpen
//
this.pythonOpen.ActiveControl = null;
this.pythonOpen.Location = new System.Drawing.Point(3, 3);
this.pythonOpen.Name = "pythonOpen";
this.pythonOpen.Size = new System.Drawing.Size(75, 38);
this.pythonOpen.TabIndex = 9;
this.pythonOpen.Text = "Open";
this.pythonOpen.UseSelectable = true;
this.pythonOpen.Click += new System.EventHandler(this.pythonOpen_Click);
//
// pythonCode
//
this.pythonCode.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.cslivenotyetimplemented.AutoSize = true;
this.cslivenotyetimplemented.FontSize = MetroFramework.MetroLabelSize.Tall;
this.cslivenotyetimplemented.FontWeight = MetroFramework.MetroLabelWeight.Bold;
this.cslivenotyetimplemented.Location = new System.Drawing.Point(240, 143);
this.cslivenotyetimplemented.Name = "cslivenotyetimplemented";
this.cslivenotyetimplemented.Size = new System.Drawing.Size(220, 25);
this.cslivenotyetimplemented.TabIndex = 2;
this.cslivenotyetimplemented.Text = "NOT YET IMPLEMENTED";
//
// centercenterToolStripMenuItem
//
this.centercenterToolStripMenuItem.Name = "centercenterToolStripMenuItem";
this.centercenterToolStripMenuItem.Size = new System.Drawing.Size(191, 22);
this.centercenterToolStripMenuItem.Text = "Center <center>";
this.centercenterToolStripMenuItem.Click += new System.EventHandler(this.centercenterToolStripMenuItem_Click);
//
// paragraphpToolStripMenuItem
this.pythonCode.CustomButton.Image = null;
this.pythonCode.CustomButton.Location = new System.Drawing.Point(445, 2);
this.pythonCode.CustomButton.Name = "";
this.pythonCode.CustomButton.Size = new System.Drawing.Size(335, 335);
this.pythonCode.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
this.pythonCode.CustomButton.TabIndex = 1;
this.pythonCode.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
this.pythonCode.CustomButton.UseSelectable = true;
this.pythonCode.CustomButton.Visible = false;
this.pythonCode.Lines = new string[] {
"import time",
"print(\"Hello World!\")",
"time.sleep(3)"};
this.pythonCode.Location = new System.Drawing.Point(3, 47);
this.pythonCode.MaxLength = 32767;
this.pythonCode.Multiline = true;
this.pythonCode.Name = "pythonCode";
this.pythonCode.PasswordChar = '\0';
this.pythonCode.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.pythonCode.SelectedText = "";
this.pythonCode.SelectionLength = 0;
this.pythonCode.SelectionStart = 0;
this.pythonCode.ShortcutsEnabled = true;
this.pythonCode.Size = new System.Drawing.Size(783, 340);
this.pythonCode.TabIndex = 6;
this.pythonCode.Text = "import time\r\nprint(\"Hello World!\")\r\ntime.sleep(3)";
this.pythonCode.UseSelectable = true;
this.pythonCode.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
this.pythonCode.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
//
this.paragraphpToolStripMenuItem.Name = "paragraphpToolStripMenuItem";
this.paragraphpToolStripMenuItem.Size = new System.Drawing.Size(183, 22);
this.paragraphpToolStripMenuItem.Text = "Paragraph <p>";
this.paragraphpToolStripMenuItem.Click += new System.EventHandler(this.paragraphpToolStripMenuItem_Click);
// pythonExtract
//
this.pythonExtract.ActiveControl = null;
this.pythonExtract.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pythonExtract.Location = new System.Drawing.Point(684, 3);
this.pythonExtract.Name = "pythonExtract";
this.pythonExtract.Size = new System.Drawing.Size(102, 38);
this.pythonExtract.TabIndex = 10;
this.pythonExtract.Text = "Extract Python";
this.pythonExtract.UseSelectable = true;
this.pythonExtract.Click += new System.EventHandler(this.metroTile1_Click);
//
// pythonSaveFileDialog
//
this.pythonSaveFileDialog.Filter = "Python Files|*.py";
//
// MAIN
//
@ -1204,14 +1318,14 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(843, 518);
this.Controls.Add(this.nmtext);
this.Controls.Add(this.metroTabControl1);
this.Controls.Add(this.languageTabControl);
this.Controls.Add(this.nightmodehide);
this.Controls.Add(this.nightmodeToggle);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimumSize = new System.Drawing.Size(843, 518);
this.Name = "MAIN";
this.Text = "The Cashew Project";
this.metroTabControl1.ResumeLayout(false);
this.languageTabControl.ResumeLayout(false);
this.cstab.ResumeLayout(false);
this.csinftc.ResumeLayout(false);
this.csedittp.ResumeLayout(false);
@ -1229,6 +1343,7 @@
this.infotab.ResumeLayout(false);
this.infotab.PerformLayout();
this.htmlOptionsMenu.ResumeLayout(false);
this.pythontab.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@ -1236,7 +1351,7 @@
#endregion
private MetroFramework.Controls.MetroTabControl metroTabControl1;
private MetroFramework.Controls.MetroTabControl languageTabControl;
private MetroFramework.Controls.MetroTabPage cstab;
private MetroFramework.Controls.MetroTabPage infotab;
private MetroFramework.Controls.MetroToggle nightmodeToggle;
@ -1338,6 +1453,14 @@
private MetroFramework.Controls.MetroLabel cslivenotyetimplemented;
private System.Windows.Forms.ToolStripMenuItem centercenterToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem paragraphpToolStripMenuItem;
private MetroFramework.Controls.MetroTabPage pythontab;
private MetroFramework.Controls.MetroTile pythonSave;
private MetroFramework.Controls.MetroTile pythonRun;
private MetroFramework.Controls.MetroTile pythonOpen;
private MetroFramework.Controls.MetroTextBox pythonCode;
private MetroFramework.Controls.MetroTile pythonExtract;
private System.Windows.Forms.OpenFileDialog pythonOpenFileDialog;
private System.Windows.Forms.SaveFileDialog pythonSaveFileDialog;
}
}

View File

@ -7,6 +7,7 @@ using System.IO;
using CCFunctions;
using System.Drawing;
using System.Runtime.Serialization.Formatters.Binary;
using System.Diagnostics;
#pragma warning disable IDE1006
namespace cashew {
public partial class MAIN : MetroForm {
@ -18,8 +19,8 @@ namespace cashew {
string[] cseditrefl;
public MAIN() {
InitializeComponent();
metroControls = new MetroFramework.Interfaces.IMetroControl[] { nmtext, metroTabControl1, cstab, infotab, nightmodeToggle, cseditopen, cseditrun, cseditsave, cseditcode, csedit, cslive, csediterrorpanel, csediterrors, cseditref, infoPanel, htmltab, csinftc, csedittp, cslivetp, htmltext, htmltitle, htmlOptionsTile, htmlOptionsMenu, htmlRefreshTile, htmlLoad, htmlSave,
htmlLoadIndicator, htmlUpdateToggle, htmlLiveLabel, livehider, nightmodehide, cslivenotyetimplemented};
metroControls = new MetroFramework.Interfaces.IMetroControl[] { nmtext, languageTabControl, cstab, infotab, nightmodeToggle, cseditopen, cseditrun, cseditsave, cseditcode, csedit, cslive, csediterrorpanel, csediterrors, cseditref, infoPanel, htmltab, csinftc, csedittp, cslivetp, htmltext, htmltitle, htmlOptionsTile, htmlOptionsMenu, htmlRefreshTile, htmlLoad, htmlSave,
htmlLoadIndicator, htmlUpdateToggle, htmlLiveLabel, livehider, nightmodehide, cslivenotyetimplemented, pythontab, pythonSave, pythonRun, pythonOpen, pythonCode, pythonExtract};
normalControls = new Control[] { htmlSep, htmldisplay };
menuItems = new ToolStripMenuItem[] { hTMLToolStripMenuItem, javaScriptToolStripMenuItem, cSSToolStripMenuItem, pHPToolStripMenuItem, hTMLStructureSetupToolStripMenuItem, javaStructureSetupToolStripMenuItem, cSSStructureSetupToolStripMenuItem, pHPStructureSetupToolStripMenuItem, linkToolStripMenuItem, imageToolStripMenuItem, textToolStripMenuItem, tableToolStripMenuItem,
listsToolStripMenuItem, functionToolStripMenuItem, textToolStripMenuItem1, alertBoxToolStripMenuItem, timeoutToolStripMenuItem, randomNumberToolStripMenuItem, cSSCustomizeTagToolStripMenuItem, cSSCustomTagPropertiesToolStripMenuItem, textToolStripMenuItem3, headingsToolStripMenuItem, boldbToolStripMenuItem, underlineuToolStripMenuItem, italiciToolStripMenuItem,
@ -34,7 +35,7 @@ namespace cashew {
csinftc.SizeMode = TabSizeMode.Fixed;
htmldisplay.DocumentText = htmltext.Text;
metroToggle1_CheckedChanged(this, new EventArgs());
metroTabControl1.SelectedTab = infotab;
languageTabControl.SelectedTab = infotab;
csinftc.SelectedTab = csedittp;
}
@ -72,6 +73,7 @@ namespace cashew {
Refresh();
}
#endregion
#region CS
System.Reflection.MethodInfo script;
private void metroLabel2_Click(object sender, EventArgs e) => MessageBox.Show(csediterrors.Text, "Errors");
@ -278,8 +280,41 @@ namespace cashew {
#endregion
#region Python
private void pythonOpen_Click(object sender, EventArgs e) {
if (pythonOpenFileDialog.ShowDialog() == DialogResult.OK) {
try {
pythonCode.Lines = File.ReadAllLines(pythonOpenFileDialog.FileName);
} catch (Exception e1) {
MessageBox.Show(e1.Message, "Loading Failed");
}
}
}
private void pythonSave_Click(object sender, EventArgs e) {
if (pythonSaveFileDialog.ShowDialog() == DialogResult.OK) {
try {
File.WriteAllLines(pythonSaveFileDialog.FileName, pythonCode.Lines);
}
catch (Exception e1) {
MessageBox.Show(e1.Message, "Saving Failed");
}
}
}
private void pythonRun_Click(object sender, EventArgs e) {
File.WriteAllLines(Path.GetTempPath() + @"Python\tmp.py",pythonCode.Lines);
Process process = Process.Start(new ProcessStartInfo { FileName = Path.GetTempPath() + @"Python\python.exe", Arguments = Path.GetTempPath() + @"Python\tmp.py", UseShellExecute = true });
}
private void metroTile1_Click(object sender, EventArgs e) {
if (Directory.Exists(Path.GetTempPath() + "Python")) {
Directory.Delete(Path.GetTempPath() + "Python");
}
try { Directory.CreateDirectory(Path.GetTempPath() + "Python"); } catch { }
File.WriteAllBytes(Path.GetTempPath() + "Python.zip", Resources.Python);
System.IO.Compression.ZipFile.ExtractToDirectory(Path.GetTempPath() + "Python.zip", Path.GetTempPath() + "Python");
}
#endregion
}
}
//CPP?
#endregion

View File

@ -131,6 +131,13 @@ namespace Project
}
}
}</value>
</data>
<data name="infoPanel.Text" xml:space="preserve">
<value>This Program uses MetroModernUI by Dennis Magno and Costura.Fody by Simon Cropp.
Functionality:
- Select a category (Top bar) and use the provided functions to write programs.
IF YOU WANT A PROFESSIONAL PROGRAM, DON'T USE THIS!</value>
</data>
<metadata name="csSaveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
@ -148,7 +155,13 @@ namespace Project
<value>574, 17</value>
</metadata>
<metadata name="htmlOpenFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>710, 17</value>
<value>730, 17</value>
</metadata>
<metadata name="pythonOpenFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>890, 17</value>
</metadata>
<metadata name="pythonSaveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1064, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

73
cashew/Resources.Designer.cs generated Normal file
View File

@ -0,0 +1,73 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace cashew {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("cashew.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] Python {
get {
object obj = ResourceManager.GetObject("Python", resourceCulture);
return ((byte[])(obj));
}
}
}
}

124
cashew/Resources.resx Normal file
View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Python" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\Python.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

BIN
cashew/Resources/Python.zip Normal file

Binary file not shown.

View File

@ -64,6 +64,7 @@
<Reference Include="System.IO.Compression">
<HintPath>..\..\T.O.F.U\Net_TOFU\bin\Release\System.IO.Compression.dll</HintPath>
</Reference>
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
@ -84,6 +85,11 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
@ -97,6 +103,10 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
@ -107,6 +117,7 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Resources\Python.zip" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />