Browse Source

Some functions removed

jungervin 7 years ago
parent
commit
e0be0e39c0

+ 3 - 0
EsPy/App.config

@@ -71,6 +71,9 @@
             <setting name="PyServerPort" serializeAs="String">
                 <value>5005</value>
             </setting>
+            <setting name="EspFlashMode" serializeAs="String">
+                <value>3</value>
+            </setting>
         </EsPy.Properties.Settings>
         <EPy.Properties.Settings>
             <setting name="PortName" serializeAs="String">

+ 10 - 10
EsPy/Components/CompletionForm.cs

@@ -82,15 +82,15 @@ namespace EsPy.Components
             this.listBox.Items.Clear();
         }
 
-        public void Add(Completion item)
-        {
-            this.listBox.Items.Add(item);
-        }
+        //public void Add(Completion item)
+        //{
+        //    this.listBox.Items.Add(item);
+        //}
 
-        public void AddRange(List<Completion> list)
-        {
-            this.listBox.Items.AddRange(list.ToArray());
-        }
+        //public void AddRange(List<Completion> list)
+        //{
+        //    this.listBox.Items.AddRange(list.ToArray());
+        //}
 
         public int Count
         { get { return this.listBox.Items.Count; } }
@@ -119,8 +119,8 @@ namespace EsPy.Components
         //    this.SelectedIndex = this.listBox.Items.Count - 1;
         //}
 
-        public BaseDefinition SelectedItem
-        { get { return this.listBox.SelectedItem as BaseDefinition; } }
+        //public BaseDefinition SelectedItem
+        //{ get { return this.listBox.SelectedItem as BaseDefinition; } }
 
         public void SelectPrevious()
         {

+ 1 - 1
EsPy/Components/ExListBox.cs

@@ -1,4 +1,4 @@
-using EsPy.Python.Jedi;
+//using EsPy.Python.Jedi;
 using System;
 using System.Collections.Generic;
 using System.Drawing;

+ 267 - 267
EsPy/Components/ExScintilla.cs

@@ -1,5 +1,5 @@
-using EsPy.Python;
-using EsPy.Python.Jedi;
+//using EsPy.Python;
+//using EsPy.Python.Jedi;
 using EsPy.Utility;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
@@ -38,8 +38,8 @@ namespace EsPy.Components
         {
             this.InitializeComponent();
             this.CompletionEnabled = false;
-            this.Completions = new List<Completion>(500);
-            this.MouseDwellTime = 500;
+            //this.Completions = new List<Completion>(500);
+            //this.MouseDwellTime = 500;
         }
 
         public bool CompletionEnabled
@@ -62,97 +62,97 @@ namespace EsPy.Components
 
         }
 
-        private CompletionForm FCompletionForm = null;
-        public void HideCompletions()
-        {
-            if (this.FCompletionForm != null)
-            {
-                this.FCompletionForm.Dispose();
-                this.FCompletionForm = null;
-            }
-        }
+        //private CompletionForm FCompletionForm = null;
+        //public void HideCompletions()
+        //{
+        //    if (this.FCompletionForm != null)
+        //    {
+        //        this.FCompletionForm.Dispose();
+        //        this.FCompletionForm = null;
+        //    }
+        //}
 
-        public void CompletionFormDisposing(object sender, EventArgs e)
-        {
-            this.FCompletionForm.FormDisposing -= CompletionFormDisposing;
-            this.FCompletionForm = null;
-        }
+        //public void CompletionFormDisposing(object sender, EventArgs e)
+        //{
+        //    this.FCompletionForm.FormDisposing -= CompletionFormDisposing;
+        //    this.FCompletionForm = null;
+        //}
 
-        public void ShowCompletion()
-        {
-            //this.Capture = true;
-            this.HideCompletions();
-            this.FCompletionForm = new CompletionForm();
-            this.FCompletionForm.FormDisposing += CompletionFormDisposing;
-            this.FCompletionForm.Scintilla = this;
-
-            int word_start_pos = Utility.TextHelper.KeywordStartPosition(this.Text, this.CurrentPosition - 1) + 1;
-            int x = this.PointXFromPosition(word_start_pos);
-            int y = this.PointYFromPosition(word_start_pos);
-
-            this.FCompletionForm.Show();
-
-            Point p = this.PointToScreen(new Point(x, y));
-
-            this.FCompletionForm.TopLevel = true;
-            this.FCompletionForm.TopMost = true;
-            this.FCompletionForm.Top = p.Y + (int)(this.Font.Height * 1.2);
-            this.FCompletionForm.Left = p.X;
-            this.Focus();
-            this.SetFilter(0);
-        }
+        //public void ShowCompletion()
+        //{
+        //    //this.Capture = true;
+        //    this.HideCompletions();
+        //    this.FCompletionForm = new CompletionForm();
+        //    this.FCompletionForm.FormDisposing += CompletionFormDisposing;
+        //    this.FCompletionForm.Scintilla = this;
+
+        //    int word_start_pos = Utility.TextHelper.KeywordStartPosition(this.Text, this.CurrentPosition - 1) + 1;
+        //    int x = this.PointXFromPosition(word_start_pos);
+        //    int y = this.PointYFromPosition(word_start_pos);
+
+        //    this.FCompletionForm.Show();
+
+        //    Point p = this.PointToScreen(new Point(x, y));
+
+        //    this.FCompletionForm.TopLevel = true;
+        //    this.FCompletionForm.TopMost = true;
+        //    this.FCompletionForm.Top = p.Y + (int)(this.Font.Height * 1.2);
+        //    this.FCompletionForm.Left = p.X;
+        //    this.Focus();
+        //    this.SetFilter(0);
+        //}
 
-        private List<Completion> Completions
-        {get; set; }
+        //private List<Completion> Completions
+        //{get; set; }
 
-        private void SetFilter(int dx)
-        {
-            this.FCompletionForm.Clear();
-            Line line = this.Lines[this.CurrentLine];
-            int l = this.CurrentLine + dx;
-            int c = this.CurrentPosition - line.Position;
+        //private void SetFilter(int dx)
+        //{
+        //    this.FCompletionForm.Clear();
+        //    Line line = this.Lines[this.CurrentLine];
+        //    int l = this.CurrentLine + dx;
+        //    int c = this.CurrentPosition - line.Position;
 
-            Words words = TextHelper.FindWords(line.Text, c + dx);
+        //    Words words = TextHelper.FindWords(line.Text, c + dx);
             
-            List<Completion> list = this.Completions.Where(k => k.name.ToLower().StartsWith(words.Filter.ToLower())).ToList();
+        //    List<Completion> list = this.Completions.Where(k => k.name.ToLower().StartsWith(words.Filter.ToLower())).ToList();
 
-            // Todo: Add/Remove items
-            this.FCompletionForm.AddRange(list);
+        //    // Todo: Add/Remove items
+        //    this.FCompletionForm.AddRange(list);
 
-            if (words.Filter != "" && this.FCompletionForm.Count > 0)
-            {
-                this.FCompletionForm.SelectedIndex = 0;
-            }
-            else
-            {
+        //    if (words.Filter != "" && this.FCompletionForm.Count > 0)
+        //    {
+        //        this.FCompletionForm.SelectedIndex = 0;
+        //    }
+        //    else
+        //    {
                 
-            }
-        }
+        //    }
+        //}
 
-        private void Complete()
-        {
+        //private void Complete()
+        //{
             
-            if (this.FCompletionForm.SelectedItem != null)
-            {
-                string name = this.FCompletionForm.SelectedItem.name;
-                // prevent Delete & Insert events!!)
-                this.HideCompletions();
+        //    if (this.FCompletionForm.SelectedItem != null)
+        //    {
+        //        string name = this.FCompletionForm.SelectedItem.name;
+        //        // prevent Delete & Insert events!!)
+        //        this.HideCompletions();
 
-                if (name != null)
-                {
-                    Line line = this.Lines[this.CurrentLine];
-                    int l = this.CurrentLine + 1;
-                    int c = this.CurrentPosition - line.Position;
+        //        if (name != null)
+        //        {
+        //            Line line = this.Lines[this.CurrentLine];
+        //            int l = this.CurrentLine + 1;
+        //            int c = this.CurrentPosition - line.Position;
 
-                    Words words = TextHelper.FindWords(line.Text, c);
+        //            Words words = TextHelper.FindWords(line.Text, c);
 
-                    this.DeleteRange(line.Position + words.Pos, words.Filter.Length);
-                    this.InsertText(line.Position + words.Pos, name);
-                    this.GotoPosition(line.Position + words.Pos + name.Length);                    
-                }
-            }
-            else this.HideCompletions();
-        }
+        //            this.DeleteRange(line.Position + words.Pos, words.Filter.Length);
+        //            this.InsertText(line.Position + words.Pos, name);
+        //            this.GotoPosition(line.Position + words.Pos + name.Length);                    
+        //        }
+        //    }
+        //    else this.HideCompletions();
+        //}
          
         //protected override void WndProc(ref Message m)
         //{
@@ -167,150 +167,150 @@ namespace EsPy.Components
         //    base.WndProc(ref m);
         //}
 
-        protected override bool ProcessCmdKey(ref Message msg, Keys key)
-        {
-            if (msg.Msg == WM_KEYDOWN || msg.Msg == WM_SYSKEYDOWN)
-            {
-                switch (key)
-                {
-                    case Keys.Control | Keys.Space:                      
-                        this.FindCompletions();
-                        return true;
-
-                    case Keys.Escape:
-                        this.HideCompletions();
-                        return true;
-
-                    case Keys.Enter:
-                    case Keys.Tab:
-                        if (this.FCompletionForm != null)
-                        {
-                            this.Complete();
-                            return true;
-                        }
-                        break;
-
-                    case Keys.Left:
-
-                        if (this.FCompletionForm != null)
-                        {
-                            int p = this.CurrentPosition - 1;
-                            char c = this.Text[p];
-                            if (c == '.' || char.IsWhiteSpace(c))
-                            {
-                                this.HideCompletions();
+        //protected override bool ProcessCmdKey(ref Message msg, Keys key)
+        //{
+        //    if (msg.Msg == WM_KEYDOWN || msg.Msg == WM_SYSKEYDOWN)
+        //    {
+        //        switch (key)
+        //        {
+        //            case Keys.Control | Keys.Space:                      
+        //                //this.FindCompletions();
+        //                return true;
+
+        //            case Keys.Escape:
+        //                //this.HideCompletions();
+        //                return true;
+
+        //            case Keys.Enter:
+        //            case Keys.Tab:
+        //                //if (this.FCompletionForm != null)
+        //                //{
+        //                //    this.Complete();
+        //                //    return true;
+        //                //}
+        //                break;
+
+        //            case Keys.Left:
+
+        //                //if (this.FCompletionForm != null)
+        //                //{
+        //                //    int p = this.CurrentPosition - 1;
+        //                //    char c = this.Text[p];
+        //                //    if (c == '.' || char.IsWhiteSpace(c))
+        //                //    {
+        //                //        this.HideCompletions();
                                 
-                            }
-                            else
-                            {
-                                this.SetFilter(-1);
-                            }
-                        }
-                        break;
-
-                    case Keys.Right:
-                        if (this.FCompletionForm != null)
-                        {
-                            int p = this.CurrentPosition ;
-                            char c = this.Text[p];
-                            if (c == '.' || char.IsWhiteSpace(c))
-                            {
-                                this.HideCompletions();
-                            }
-                            else
-                            {
-                                this.SetFilter(1);
-                            }
-                        }
-                        break;
-
-                    case Keys.Up:
-                        if (this.FCompletionForm != null)
-                        {
-                            this.FCompletionForm.SelectPrevious();
-                            return true;
-                        }
-                        break;
-
-                    case Keys.Down:
-                        if (this.FCompletionForm != null)
-                        {
-                            this.FCompletionForm.SelectNext();
-                            return true;
-                        }
-                        break;
-
-                    case Keys.Home:
-                        if (this.FCompletionForm != null)
-                        {
-                            this.HideCompletions();
-                        }
-                        break;
-
-                    case Keys.End:
-                        if (this.FCompletionForm != null)
-                        {
-                            this.HideCompletions();
-                        }
-                        break;
-                }
-            }
-            return base.ProcessCmdKey(ref msg, key);
-        }
+        //                //    }
+        //                //    else
+        //                //    {
+        //                //        this.SetFilter(-1);
+        //                //    }
+        //                //}
+        //                break;
+
+        //            case Keys.Right:
+        //                //if (this.FCompletionForm != null)
+        //                //{
+        //                //    int p = this.CurrentPosition ;
+        //                //    char c = this.Text[p];
+        //                //    if (c == '.' || char.IsWhiteSpace(c))
+        //                //    {
+        //                //        this.HideCompletions();
+        //                //    }
+        //                //    else
+        //                //    {
+        //                //        this.SetFilter(1);
+        //                //    }
+        //                //}
+        //                break;
+
+        //            case Keys.Up:
+        //                //if (this.FCompletionForm != null)
+        //                //{
+        //                //    this.FCompletionForm.SelectPrevious();
+        //                //    return true;
+        //                //}
+        //                break;
+
+        //            case Keys.Down:
+        //                //if (this.FCompletionForm != null)
+        //                //{
+        //                //    this.FCompletionForm.SelectNext();
+        //                //    return true;
+        //                //}
+        //                break;
+
+        //            case Keys.Home:
+        //                //if (this.FCompletionForm != null)
+        //                //{
+        //                //    this.HideCompletions();
+        //                //}
+        //                break;
+
+        //            case Keys.End:
+        //                //if (this.FCompletionForm != null)
+        //                //{
+        //                //    this.HideCompletions();
+        //                //}
+        //                break;
+        //        }
+        //    }
+        //    return base.ProcessCmdKey(ref msg, key);
+        //}
 
-        private int CompletionPosition = 0;
+        //private int CompletionPosition = 0;
 
-        private void FindCompletions()
-        {
-            Line line = this.Lines[this.CurrentLine];
-            int l = this.CurrentLine + 1;
-            int c = this.CurrentPosition - line.Position;
-            Words words = TextHelper.FindWords(line.Text, c);
-            this.CompletionPosition = line.Position + words.Pos;
-            this.FindCompletions(l, c);
-        }
+        //private void FindCompletions()
+        //{
+        //    Line line = this.Lines[this.CurrentLine];
+        //    int l = this.CurrentLine + 1;
+        //    int c = this.CurrentPosition - line.Position;
+        //    Words words = TextHelper.FindWords(line.Text, c);
+        //    this.CompletionPosition = line.Position + words.Pos;
+        //    this.FindCompletions(l, c);
+        //}
 
-        private void FindCompletions(int line, int column)
-        {
-            if (Globals.PyClient != null && this.Lexer == Lexer.Python && this.CompletionEnabled)
-            {
-                this.HideCompletions();
-                this.Completions.Clear();
+        //private void FindCompletions(int line, int column)
+        //{
+        //    if (Globals.PyClient != null && this.Lexer == Lexer.Python && this.CompletionEnabled)
+        //    {
+        //        this.HideCompletions();
+        //        this.Completions.Clear();
 
-                Script script = new Script(this.Text, line, column);
+        //        Script script = new Script(this.Text, line, column);
 
-                PyRequest req = new CompletionRequest(script);
-                string json = JsonConvert.SerializeObject(req);
-                try
-                {
-                    JToken token = Globals.PyClient.DoRequest<JToken>(req);
-                    if (token != null && token["completions"] is JArray)
-                    {
-                        JArray items = token["completions"] as JArray;
-                        foreach (JToken t in items)
-                        {
-                            Completion comp = JsonConvert.DeserializeObject<Completion>(t.ToString());
-                            if (comp != null)
-                                this.Completions.Add(comp);
-                        }
-
-                        //Todo: move to Show
-                        if (this.Completions.Count > 0)
-                        {
-                            this.ShowCompletion();
-                        }
-                        else
-                        {
-                            this.CallTipShow(this.CurrentPosition, "No suggestions");
-                        }
-                    }
-                }
-                catch
-                { 
-                    this.CallTipShow(this.CurrentPosition, "Try again**");
-                }
-            }
-        }
+        //        PyRequest req = new CompletionRequest(script);
+        //        string json = JsonConvert.SerializeObject(req);
+        //        try
+        //        {
+        //            JToken token = Globals.PyClient.DoRequest<JToken>(req);
+        //            if (token != null && token["completions"] is JArray)
+        //            {
+        //                JArray items = token["completions"] as JArray;
+        //                foreach (JToken t in items)
+        //                {
+        //                    Completion comp = JsonConvert.DeserializeObject<Completion>(t.ToString());
+        //                    if (comp != null)
+        //                        this.Completions.Add(comp);
+        //                }
+
+        //                //Todo: move to Show
+        //                if (this.Completions.Count > 0)
+        //                {
+        //                    this.ShowCompletion();
+        //                }
+        //                else
+        //                {
+        //                    this.CallTipShow(this.CurrentPosition, "No suggestions");
+        //                }
+        //            }
+        //        }
+        //        catch
+        //        { 
+        //            this.CallTipShow(this.CurrentPosition, "Try again**");
+        //        }
+        //    }
+        //}
 
         private string GetAttr(XmlNode xnode, string attr)
         {
@@ -512,54 +512,54 @@ namespace EsPy.Components
 
         private void ExScintilla_CharAdded(object sender, CharAddedEventArgs e)
         {
-            var currentPos = this.CurrentPosition;
-            var wordStartPos = this.WordStartPosition(currentPos, true);
+            //var currentPos = this.CurrentPosition;
+            //var wordStartPos = this.WordStartPosition(currentPos, true);
 
-            char c = this.Text[this.CurrentPosition-1];
-            // Display the autocompletion list
-            var lenEntered = currentPos - wordStartPos;
-            if (e.Char == ' ' && this.FCompletionForm != null)
-            {
-                this.HideCompletions();
-            }
-            else if (e.Char == '(')
-            {
-                Application.DoEvents();
-                this.FindCompletions();
+            //char c = this.Text[this.CurrentPosition-1];
+            //// Display the autocompletion list
+            //var lenEntered = currentPos - wordStartPos;
+            //if (e.Char == ' ' && this.FCompletionForm != null)
+            //{
+            //    this.HideCompletions();
+            //}
+            //else if (e.Char == '(')
+            //{
+            //    Application.DoEvents();
+            //    this.FindCompletions();
 
-                if (this.Completions.Count == 1)
-                {
-                    Completion comp = this.Completions[0];
-                }
-            }
-            else if (e.Char == '.')
-            {
-                Application.DoEvents();
-                this.FindCompletions();
-            }
-            else if (this.FCompletionForm == null && lenEntered == 1)
-            {
-                this.FindCompletions();
-            }
-            else if (this.FCompletionForm != null)
-            {
-                this.SetFilter(0);
-            }
+            //    if (this.Completions.Count == 1)
+            //    {
+            //        Completion comp = this.Completions[0];
+            //    }
+            //}
+            //else if (e.Char == '.')
+            //{
+            //    Application.DoEvents();
+            //    this.FindCompletions();
+            //}
+            //else if (this.FCompletionForm == null && lenEntered == 1)
+            //{
+            //    this.FindCompletions();
+            //}
+            //else if (this.FCompletionForm != null)
+            //{
+            //    this.SetFilter(0);
+            //}
         }
 
         private void ExScintilla_Delete(object sender, ModificationEventArgs e)
         {
-            if (this.FCompletionForm != null)
-            {
-                if (e.Text.Contains('.') || e.Text.Contains("(") || e.Text.Contains(")") || this.CurrentPosition < this.CompletionPosition)
-                {
-                    this.HideCompletions();
-                }
-                else
-                {
-                    this.SetFilter(0);
-                }
-            }
+            //if (this.FCompletionForm != null)
+            //{
+            //    if (e.Text.Contains('.') || e.Text.Contains("(") || e.Text.Contains(")") || this.CurrentPosition < this.CompletionPosition)
+            //    {
+            //        this.HideCompletions();
+            //    }
+            //    else
+            //    {
+            //        this.SetFilter(0);
+            //    }
+            //}
 
         }
 
@@ -570,20 +570,20 @@ namespace EsPy.Components
 
         private void ExScintilla_Leave(object sender, EventArgs e)
         {
-            if (this.FCompletionForm != null && this.FCompletionForm.Visible)
-                this.HideCompletions();
+            //if (this.FCompletionForm != null && this.FCompletionForm.Visible)
+            //    this.HideCompletions();
         }
 
         private void ExScintilla_MouseDown(object sender, MouseEventArgs e)
         {
-            if (this.FCompletionForm != null)
-                this.HideCompletions();
+            //if (this.FCompletionForm != null)
+            //    this.HideCompletions();
         }
 
         private void ExScintilla_Resize(object sender, EventArgs e)
         {
-            if (this.FCompletionForm != null)
-                this.HideCompletions();
+            //if (this.FCompletionForm != null)
+            //    this.HideCompletions();
         }
 
         private void ExScintilla_DwellEnd(object sender, DwellEventArgs e)

+ 64 - 20
EsPy/Dialogs/EspToolDialog.Designer.cs

@@ -44,8 +44,11 @@
             this.button1 = new System.Windows.Forms.Button();
             this.label4 = new System.Windows.Forms.Label();
             this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.label9 = new System.Windows.Forms.Label();
             this.label8 = new System.Windows.Forms.Label();
+            this.FlashMode = new System.Windows.Forms.ComboBox();
             this.cbPort = new System.Windows.Forms.ComboBox();
+            this.label10 = new System.Windows.Forms.Label();
             this.cbBaudrate = new System.Windows.Forms.ComboBox();
             this.label7 = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
@@ -55,7 +58,7 @@
             this.label5 = new System.Windows.Forms.Label();
             this.linkLabel1 = new System.Windows.Forms.LinkLabel();
             this.linkLabel2 = new System.Windows.Forms.LinkLabel();
-            this.label9 = new System.Windows.Forms.Label();
+            this.label11 = new System.Windows.Forms.Label();
             this.groupBox1.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -140,19 +143,19 @@
             // textBox4
             // 
             this.textBox4.Font = new System.Drawing.Font("Courier New", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
-            this.textBox4.Location = new System.Drawing.Point(12, 221);
+            this.textBox4.Location = new System.Drawing.Point(12, 244);
             this.textBox4.Multiline = true;
             this.textBox4.Name = "textBox4";
             this.textBox4.ScrollBars = System.Windows.Forms.ScrollBars.Both;
-            this.textBox4.Size = new System.Drawing.Size(612, 185);
+            this.textBox4.Size = new System.Drawing.Size(612, 162);
             this.textBox4.TabIndex = 0;
             // 
             // btnErase
             // 
-            this.btnErase.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
-            this.btnErase.Location = new System.Drawing.Point(412, 412);
+            this.btnErase.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
+            this.btnErase.Location = new System.Drawing.Point(358, 413);
             this.btnErase.Name = "btnErase";
-            this.btnErase.Size = new System.Drawing.Size(100, 23);
+            this.btnErase.Size = new System.Drawing.Size(135, 23);
             this.btnErase.TabIndex = 4;
             this.btnErase.Text = "1. Erase...";
             this.btnErase.UseVisualStyleBackColor = true;
@@ -160,12 +163,12 @@
             // 
             // btnWrite
             // 
-            this.btnWrite.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
-            this.btnWrite.Location = new System.Drawing.Point(518, 412);
+            this.btnWrite.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
+            this.btnWrite.Location = new System.Drawing.Point(494, 412);
             this.btnWrite.Name = "btnWrite";
-            this.btnWrite.Size = new System.Drawing.Size(100, 23);
+            this.btnWrite.Size = new System.Drawing.Size(124, 23);
             this.btnWrite.TabIndex = 5;
-            this.btnWrite.Text = "2. Write + Verify...";
+            this.btnWrite.Text = "2. Write...";
             this.btnWrite.UseVisualStyleBackColor = true;
             this.btnWrite.Click += new System.EventHandler(this.btnWrite_Click);
             // 
@@ -209,9 +212,12 @@
             // 
             // groupBox1
             // 
+            this.groupBox1.Controls.Add(this.label11);
             this.groupBox1.Controls.Add(this.label9);
             this.groupBox1.Controls.Add(this.label8);
+            this.groupBox1.Controls.Add(this.FlashMode);
             this.groupBox1.Controls.Add(this.cbPort);
+            this.groupBox1.Controls.Add(this.label10);
             this.groupBox1.Controls.Add(this.cbBaudrate);
             this.groupBox1.Controls.Add(this.label7);
             this.groupBox1.Controls.Add(this.tbPython);
@@ -226,11 +232,22 @@
             this.groupBox1.Controls.Add(this.btnFirmware);
             this.groupBox1.Location = new System.Drawing.Point(12, 59);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(612, 156);
+            this.groupBox1.Size = new System.Drawing.Size(612, 179);
             this.groupBox1.TabIndex = 11;
             this.groupBox1.TabStop = false;
             this.groupBox1.Text = "Settings";
             // 
+            // label9
+            // 
+            this.label9.Image = global::EsPy.Properties.Resources.Warning;
+            this.label9.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            this.label9.Location = new System.Drawing.Point(378, 17);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(228, 23);
+            this.label9.TabIndex = 18;
+            this.label9.Text = "       Make sure the selected port is closed!";
+            this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
             // label8
             // 
             this.label8.AutoSize = true;
@@ -241,6 +258,22 @@
             this.label8.TabIndex = 7;
             this.label8.Text = "Default location: YourPython\\Lib\\site-packages\\esptool.py";
             // 
+            // FlashMode
+            // 
+            this.FlashMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.FlashMode.FormattingEnabled = true;
+            this.FlashMode.Items.AddRange(new object[] {
+            "keep",
+            "qio",
+            "qout",
+            "dio",
+            "dout"});
+            this.FlashMode.Location = new System.Drawing.Point(75, 144);
+            this.FlashMode.Name = "FlashMode";
+            this.FlashMode.Size = new System.Drawing.Size(104, 21);
+            this.FlashMode.TabIndex = 0;
+            this.FlashMode.Validating += new System.ComponentModel.CancelEventHandler(this.cbBaudrate_Validating);
+            // 
             // cbPort
             // 
             this.cbPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@@ -251,6 +284,15 @@
             this.cbPort.TabIndex = 0;
             this.cbPort.Validating += new System.ComponentModel.CancelEventHandler(this.cbBaudrate_Validating);
             // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Location = new System.Drawing.Point(7, 147);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(62, 13);
+            this.label10.TabIndex = 6;
+            this.label10.Text = "Flash Mode";
+            // 
             // cbBaudrate
             // 
             this.cbBaudrate.FormattingEnabled = true;
@@ -353,16 +395,15 @@
             this.linkLabel2.Text = "http://micropython.org/download#esp8266";
             this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
             // 
-            // label9
+            // label11
             // 
-            this.label9.Image = global::EsPy.Properties.Resources.Warning;
-            this.label9.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
-            this.label9.Location = new System.Drawing.Point(378, 17);
-            this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(228, 23);
-            this.label9.TabIndex = 18;
-            this.label9.Text = "       Make sure the selected port is closed!";
-            this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            this.label11.AutoSize = true;
+            this.label11.ForeColor = System.Drawing.Color.Maroon;
+            this.label11.Location = new System.Drawing.Point(207, 147);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(230, 13);
+            this.label11.TabIndex = 19;
+            this.label11.Text = "NodeMCU, Wemos D1: dio. Sonoff Relay: dout";
             // 
             // EspToolDialog
             // 
@@ -426,5 +467,8 @@
         private System.Windows.Forms.Label label7;
         private System.Windows.Forms.Label label8;
         private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.ComboBox FlashMode;
+        private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.Label label11;
     }
 }

+ 14 - 4
EsPy/Dialogs/EspToolDialog.cs

@@ -34,6 +34,8 @@ namespace EsPy.Dialogs
             {
                 this.cbPort.Items.AddRange(ports);
             }
+
+            this.FlashMode.SelectedIndex = Properties.Settings.Default.EspFlashMode;
         }
 
         public string PortName
@@ -236,11 +238,15 @@ namespace EsPy.Dialogs
         {
             if (this.CheckPaths())
             {
-                if (MessageBox.Show("Are you sure?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
+                if (MessageBox.Show("Are you sure? Did you erase the device?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                 {
-                    string args = String.Format("\"{0}\" -p {1} -b {2} write_flash --verify --flash_size=detect 0 \"{3}\"", this.tbEsptool.Text, this.PortName, this.BaudRate, this.tbFirmware.Text);
-
-                    args = String.Format("\"{0}\" -p {1} -b {2} write_flash -fm dio -ff 20m -fs detect 0x0000 \"{3}\"", this.tbEsptool.Text, this.PortName, this.BaudRate, this.tbFirmware.Text);
+                    //string args = String.Format("\"{0}\" -p {1} -b {2} write_flash --verify --flash_size=detect 0 \"{3}\"", this.tbEsptool.Text, this.PortName, this.BaudRate, this.tbFirmware.Text);
+                    string args = String.Format("\"{0}\" -p {1} -b {2} write_flash -fm {3} -ff 20m -fs detect 0x0000 \"{4}\"",
+                        this.tbEsptool.Text,
+                        this.PortName,
+                        this.BaudRate,
+                        this.FlashMode.Text,
+                        this.tbFirmware.Text);
 
                     this.textBox4.Text = this.Run(this.tbPython.Text, args);
                 }
@@ -289,6 +295,7 @@ namespace EsPy.Dialogs
                 Properties.Settings.Default.EspToolPy = this.tbEsptool.Text;
                 Properties.Settings.Default.FrimwareBin = this.tbFirmware.Text;
                 Properties.Settings.Default.EspToolBaud = this.BaudRate;
+                Properties.Settings.Default.EspFlashMode = this.FlashMode.SelectedIndex;
                 Properties.Settings.Default.Save();
                 this.DialogResult = DialogResult.OK;
             }
@@ -324,5 +331,8 @@ namespace EsPy.Dialogs
         private void EspToolDialog_Load(object sender, EventArgs e)
         {
         }
+
+      
+
     }
 }

+ 5 - 72
EsPy/EsPy.csproj

@@ -120,15 +120,6 @@
     </Reference>
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Components\CompletionForm.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="Components\CompletionForm.Designer.cs">
-      <DependentUpon>CompletionForm.cs</DependentUpon>
-    </Compile>
-    <Compile Include="Components\ExListBox.cs">
-      <SubType>Component</SubType>
-    </Compile>
     <Compile Include="Components\ExScintilla.cs">
       <SubType>Component</SubType>
     </Compile>
@@ -177,20 +168,14 @@
     <Compile Include="Forms\EditorForm.Designer.cs">
       <DependentUpon>EditorForm.cs</DependentUpon>
     </Compile>
-    <Compile Include="Forms\ErrorListForm.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="Forms\ErrorListForm.Designer.cs">
-      <DependentUpon>ErrorListForm.cs</DependentUpon>
-    </Compile>
     <Compile Include="Forms\IDeviceChange.cs" />
     <Compile Include="Forms\IDocument.cs" />
     <Compile Include="Forms\IForm.cs" />
-    <Compile Include="Forms\Splash.cs">
+    <Compile Include="Forms\About.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="Forms\Splash.Designer.cs">
-      <DependentUpon>Splash.cs</DependentUpon>
+    <Compile Include="Forms\About.Designer.cs">
+      <DependentUpon>About.cs</DependentUpon>
     </Compile>
     <Compile Include="Forms\TerminalForm.cs">
       <SubType>Form</SubType>
@@ -207,13 +192,6 @@
     </Compile>
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="Python\Jedi\BaseDefinition.cs" />
-    <Compile Include="Python\Jedi\Completion.cs" />
-    <Compile Include="Python\Jedi\CompletionRequest.cs" />
-    <Compile Include="Python\Jedi\Request.cs" />
-    <Compile Include="Python\Jedi\Script.cs" />
-    <Compile Include="Python\PyClient.cs" />
-    <Compile Include="Python\PyRequest.cs" />
     <Compile Include="Units\IPort.cs" />
     <Compile Include="Units\PySerial.cs" />
     <Compile Include="Units\PySerialEvents.cs" />
@@ -225,18 +203,10 @@
     <Compile Include="Utility\FileFormat.cs" />
     <Compile Include="Utility\FileFormats.cs" />
     <Compile Include="Utility\Helpers.cs" />
-    <Compile Include="Utility\Py.cs" />
     <Compile Include="Utility\TextHelper.cs" />
-    <None Include="pip.bat">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
     <Content Include="Helps\images\esp8266-wemos-d1-mini-pinout.png">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
-    <Content Include="Lib\umqtt\simple.py" />
-    <Content Include="Lib\ssd1306.py">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
     <Content Include="Release\EsPy.1.0.0.4.7z" />
     <None Include="Release\EsPy.1.0.0.5.7z" />
     <None Include="Release\EsPy.1.0.0.6.7z" />
@@ -245,40 +215,6 @@
     <None Include="Resources\compile.png" />
     <None Include="Resources\kservices.png" />
     <None Include="Resources\syntax.png" />
-    <Content Include="Lib\apa102.py">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Lib\dht.py">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Lib\ds18x20.py">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Lib\flashbdev.py" />
-    <Content Include="Lib\inisetup.py" />
-    <Content Include="Lib\machine.py">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Lib\neopixel.py" />
-    <Content Include="Lib\ntptime.py" />
-    <Content Include="Lib\onewire.py">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Lib\port_diag.py" />
-    <Content Include="Lib\upip.py" />
-    <Content Include="Lib\upip_utarfile.py" />
-    <Content Include="Lib\webrepl.py" />
-    <Content Include="Lib\webrepl_setup.py" />
-    <Content Include="Lib\websocket_helper.py" />
-    <Content Include="Scripts\PyHost.py">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <EmbeddedResource Include="Components\CompletionForm.resx">
-      <DependentUpon>CompletionForm.cs</DependentUpon>
-    </EmbeddedResource>
-    <EmbeddedResource Include="Components\ExListBox.resx">
-      <DependentUpon>ExListBox.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="Components\ExScintilla.resx">
       <DependentUpon>ExScintilla.cs</DependentUpon>
     </EmbeddedResource>
@@ -306,11 +242,8 @@
     <EmbeddedResource Include="Forms\EditorForm.resx">
       <DependentUpon>EditorForm.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="Forms\ErrorListForm.resx">
-      <DependentUpon>ErrorListForm.cs</DependentUpon>
-    </EmbeddedResource>
-    <EmbeddedResource Include="Forms\Splash.resx">
-      <DependentUpon>Splash.cs</DependentUpon>
+    <EmbeddedResource Include="Forms\About.resx">
+      <DependentUpon>About.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="Forms\TerminalForm.resx">
       <DependentUpon>TerminalForm.cs</DependentUpon>

+ 6 - 9
EsPy/Forms/Splash.Designer.cs → EsPy/Forms/About.Designer.cs

@@ -1,6 +1,6 @@
 namespace EsPy.Forms
 {
-    partial class Splash
+    partial class About
     {
         /// <summary>
         /// Required designer variable.
@@ -39,7 +39,6 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("Arial", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
-            this.label1.ForeColor = System.Drawing.Color.WhiteSmoke;
             this.label1.Location = new System.Drawing.Point(8, 9);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(50, 37);
@@ -61,7 +60,6 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
-            this.label3.ForeColor = System.Drawing.Color.WhiteSmoke;
             this.label3.Location = new System.Drawing.Point(12, 55);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(141, 15);
@@ -83,7 +81,7 @@
             this.linkLabel1.ActiveLinkColor = System.Drawing.Color.Gold;
             this.linkLabel1.AutoSize = true;
             this.linkLabel1.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
-            this.linkLabel1.LinkColor = System.Drawing.Color.Yellow;
+            this.linkLabel1.ForeColor = System.Drawing.SystemColors.ControlText;
             this.linkLabel1.Location = new System.Drawing.Point(12, 83);
             this.linkLabel1.Name = "linkLabel1";
             this.linkLabel1.Size = new System.Drawing.Size(194, 15);
@@ -93,11 +91,10 @@
             this.linkLabel1.VisitedLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
             this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
             // 
-            // Splash
+            // About
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
             this.ClientSize = new System.Drawing.Size(528, 154);
             this.ControlBox = false;
             this.Controls.Add(this.linkLabel1);
@@ -105,14 +102,14 @@
             this.Controls.Add(this.label3);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.label1);
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
             this.MaximizeBox = false;
             this.MinimizeBox = false;
-            this.Name = "Splash";
+            this.Name = "About";
             this.ShowIcon = false;
             this.ShowInTaskbar = false;
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "Splash";
+            this.Text = "About";
             this.Load += new System.EventHandler(this.Splash_Load);
             this.ResumeLayout(false);
             this.PerformLayout();

+ 3 - 4
EsPy/Forms/Splash.cs → EsPy/Forms/About.cs

@@ -1,5 +1,4 @@
-using EsPy.Python;
-using Newtonsoft.Json.Linq;
+using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -14,9 +13,9 @@ using System.Windows.Forms;
 
 namespace EsPy.Forms
 {
-    public partial class Splash : Form
+    public partial class About : Form
     {
-        public Splash()
+        public About()
         {
             InitializeComponent();
         }

+ 0 - 0
EsPy/Forms/Splash.resx → EsPy/Forms/About.resx


+ 2 - 16
EsPy/Forms/EditorForm.Designer.cs

@@ -84,7 +84,6 @@
             this.btnCut = new System.Windows.Forms.ToolStripButton();
             this.btnCopy = new System.Windows.Forms.ToolStripButton();
             this.btnPaste = new System.Windows.Forms.ToolStripButton();
-            this.btnPylint = new System.Windows.Forms.ToolStripButton();
             this.btnRun = new System.Windows.Forms.ToolStripButton();
             this.btnUpload = new System.Windows.Forms.ToolStripButton();
             this.scintilla = new EsPy.Components.ExScintilla();
@@ -124,7 +123,7 @@
             this.mnSave.MergeAction = System.Windows.Forms.MergeAction.Replace;
             this.mnSave.MergeIndex = 3;
             this.mnSave.Name = "mnSave";
-            this.mnSave.Size = new System.Drawing.Size(121, 22);
+            this.mnSave.Size = new System.Drawing.Size(152, 22);
             this.mnSave.Text = "Save";
             this.mnSave.Click += new System.EventHandler(this.mnSave_Click);
             // 
@@ -133,7 +132,7 @@
             this.mnSaveAs.MergeAction = System.Windows.Forms.MergeAction.Replace;
             this.mnSaveAs.MergeIndex = 4;
             this.mnSaveAs.Name = "mnSaveAs";
-            this.mnSaveAs.Size = new System.Drawing.Size(121, 22);
+            this.mnSaveAs.Size = new System.Drawing.Size(152, 22);
             this.mnSaveAs.Text = "Save as...";
             this.mnSaveAs.Click += new System.EventHandler(this.mnSaveAs_Click);
             // 
@@ -567,7 +566,6 @@
             this.btnCopy,
             this.btnPaste,
             this.toolStripSeparator3,
-            this.btnPylint,
             this.btnRun,
             this.btnUpload});
             this.toolStrip1.Location = new System.Drawing.Point(0, 0);
@@ -661,17 +659,6 @@
             this.btnPaste.Text = "Paste";
             this.btnPaste.Click += new System.EventHandler(this.mnPaste_Click);
             // 
-            // btnPylint
-            // 
-            this.btnPylint.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
-            this.btnPylint.Enabled = false;
-            this.btnPylint.Image = global::EsPy.Properties.Resources.syntax;
-            this.btnPylint.ImageTransparentColor = System.Drawing.Color.Magenta;
-            this.btnPylint.Name = "btnPylint";
-            this.btnPylint.Size = new System.Drawing.Size(36, 36);
-            this.btnPylint.Text = "Pylint";
-            this.btnPylint.Click += new System.EventHandler(this.btnPylint_Click);
-            // 
             // btnRun
             // 
             this.btnRun.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
@@ -801,6 +788,5 @@
         private System.Windows.Forms.ToolStripMenuItem cmShowWhitespace;
         private System.Windows.Forms.ToolStripMenuItem btnHelp;
         private System.Windows.Forms.ToolStripSeparator toolStripMenuItem5;
-        private System.Windows.Forms.ToolStripButton btnPylint;
     }
 }

+ 34 - 30
EsPy/Forms/EditorForm.cs

@@ -1,8 +1,8 @@
 using EsPy.Components;
 
 using EsPy.Dialogs;
-using EsPy.Python;
-using EsPy.Python.Jedi;
+//using EsPy.Python;
+//using EsPy.Python.Jedi;
 
 using EsPy.Units;
 using EsPy.Utility;
@@ -51,18 +51,42 @@ namespace EsPy.Forms
             this.Port = main_form.Port;
         }
 
-        public Lexer Lexer
+        //public Lexer Lexer
+        //{
+        //    get {
+
+        //        try
+        //        {
+        //            return this.scintilla.Lexer;
+        //        }
+        //        catch(Exception e)
+        //        {
+        //            Helpers.WarningBox("LEXER => " + e.Message);
+        //        }
+
+        //        return Lexer.Python;
+                
+        //    }
+        //    set
+        //    {
+        //        this.scintilla.Lexer = value;
+        //    }
+        //}
+
+        private bool IsRunnable
         {
-            get { return this.scintilla.Lexer; }
-            set
+            get
             {
-                this.scintilla.Lexer = value;
+                return this.Port != null &&
+                    this.Port.IsOpen &&
+                    !this.Port.Busy &&
+                    this.FileName != null &&
+                    Path.GetExtension(this.FileName) == ".py";
+                    //this.FileName.EndsWith == Lexer.Python;
+
             }
         }
 
-        private bool IsRunnable
-        { get { return this.Port != null && this.Port.IsOpen && !this.Port.Busy && this.Lexer == Lexer.Python; } }
-
         private PySerial FPort = null;
         public PySerial Port
         {
@@ -387,8 +411,7 @@ namespace EsPy.Forms
               this.btnSave.Enabled = this.scintilla.Modified;
 
             this.mnSelectAll.Enabled =
-                this.cmSelectAll.Enabled =
-                this.btnPylint.Enabled = this.scintilla.TextLength > 0;
+                this.cmSelectAll.Enabled = this.scintilla.TextLength > 0;
 
             this.mnFind.Enabled =
                 this.cmFind.Enabled =
@@ -844,25 +867,6 @@ namespace EsPy.Forms
 
         ////}
 
-        private void btnPylint_Click(object sender, EventArgs e)
-        {
-            Globals.MainForm.btnSaveAll_Click(this, null);
-            if (Globals.ErrorListForm != null)
-            {
-                int exitcode = 0;
-                string res = Utility.Py.Run("pylint", "" + this.FileName, out exitcode);
-                if (exitcode > 0)
-                {
-                    Globals.ErrorListForm.MkList(res, this.FileName);
-                    Globals.ErrorListForm.Show(Globals.MainForm.dockPanel1);
-                }
-                else
-                {
-                    Helpers.ErrorBox(exitcode, res);
-                }
-            }
-        }
-
 
         //public void UIStateChanged(object sender, UIChangedEventArgs e)
         //{

+ 18 - 5
EsPy/Forms/TerminalForm.Designer.cs

@@ -56,6 +56,7 @@
             this.advancedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.cmShowEOL = new System.Windows.Forms.ToolStripMenuItem();
             this.cmShowWhitespace = new System.Windows.Forms.ToolStripMenuItem();
+            this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
             this.scintilla = new EsPy.Components.Terminal();
             this.menuStrip1.SuspendLayout();
             this.toolStrip1.SuspendLayout();
@@ -226,16 +227,17 @@
             // toolStripSeparator2
             // 
             this.toolStripSeparator2.Name = "toolStripSeparator2";
-            this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
+            this.toolStripSeparator2.Size = new System.Drawing.Size(6, 39);
             // 
             // toolStrip1
             // 
             this.toolStrip1.ImageScalingSize = new System.Drawing.Size(32, 32);
             this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.toolStripSeparator2});
+            this.toolStripSeparator2,
+            this.toolStripButton1});
             this.toolStrip1.Location = new System.Drawing.Point(0, 0);
             this.toolStrip1.Name = "toolStrip1";
-            this.toolStrip1.Size = new System.Drawing.Size(664, 25);
+            this.toolStrip1.Size = new System.Drawing.Size(664, 39);
             this.toolStrip1.TabIndex = 1;
             this.toolStrip1.Text = "toolStrip1";
             this.toolStrip1.Visible = false;
@@ -408,6 +410,16 @@
             this.cmShowWhitespace.Text = "Show Whitespace";
             this.cmShowWhitespace.Click += new System.EventHandler(this.mnShowWhitespace_Click);
             // 
+            // toolStripButton1
+            // 
+            this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+            this.toolStripButton1.Image = global::EsPy.Properties.Resources.editclear;
+            this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
+            this.toolStripButton1.Name = "toolStripButton1";
+            this.toolStripButton1.Size = new System.Drawing.Size(36, 36);
+            this.toolStripButton1.Text = "toolStripButton1";
+            this.toolStripButton1.Click += new System.EventHandler(this.mnClean_Click);
+            // 
             // scintilla
             // 
             this.scintilla.AutoCAutoHide = false;
@@ -421,12 +433,12 @@
             this.scintilla.IndentationGuides = ScintillaNET.IndentView.LookForward;
             this.scintilla.IndentWidth = 4;
             this.scintilla.Lexer = ScintillaNET.Lexer.Python;
-            this.scintilla.Location = new System.Drawing.Point(0, 25);
+            this.scintilla.Location = new System.Drawing.Point(0, 0);
             this.scintilla.MouseDwellTime = 500;
             this.scintilla.Name = "scintilla";
             this.scintilla.Port = null;
             this.scintilla.ReadOnly = true;
-            this.scintilla.Size = new System.Drawing.Size(664, 237);
+            this.scintilla.Size = new System.Drawing.Size(664, 262);
             this.scintilla.TabIndex = 2;
             this.scintilla.ViewWhitespace = ScintillaNET.WhitespaceMode.VisibleAlways;
             this.scintilla.UpdateUI += new System.EventHandler<ScintillaNET.UpdateUIEventArgs>(this.terminal_UpdateUI);
@@ -496,5 +508,6 @@
         private System.Windows.Forms.ToolStripMenuItem advancedToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem cmShowEOL;
         private System.Windows.Forms.ToolStripMenuItem cmShowWhitespace;
+        private System.Windows.Forms.ToolStripButton toolStripButton1;
     }
 }

+ 45 - 46
EsPy/Globals.cs

@@ -1,6 +1,6 @@
 using EsPy.Components;
 using EsPy.Forms;
-using EsPy.Python;
+//using EsPy.Python;
 using EsPy.Utility;
 using Microsoft.Win32;
 using Newtonsoft.Json.Linq;
@@ -19,54 +19,54 @@ namespace EsPy
     public class Globals
     {
 
-        public static PyClient PyClient = null;
+        //public static PyClient PyClient = null;
 
-        public static void PyClientStart()
-        {
-           PyClient = new PyClient(new IPAddress(new byte[] { 127, 0, 0, 1 }),
-                Properties.Settings.Default.PyServerPort);
+        //public static void PyClientStart()
+        //{
+        //   PyClient = new PyClient(new IPAddress(new byte[] { 127, 0, 0, 1 }),
+        //        Properties.Settings.Default.PyServerPort);
 
-            try
-            {
-                Task t = new Task(() =>
-                {     
-                    Splash s = new Splash();
-                    s.TopMost = true;
-                    s.Show();
-                    Application.DoEvents();
-                    s.label2.Text = "Connecting...";                  
-                    Application.DoEvents();
-                    Thread.Sleep(2000);
-                    if (Globals.PyClient.Start())
-                    {
-                        s.label2.Text = "Connected!";
-                    }
-                    else
-                    {
-                        s.label2.Text = "Could not connect!";
-                        PyClient = null;
-                    }
-                    Application.DoEvents();
-                    Thread.Sleep(2000);
-                    s.Close();
-                    s.Dispose();
+        //    try
+        //    {
+        //        Task t = new Task(() =>
+        //        {     
+        //            Splash s = new Splash();
+        //            s.TopMost = true;
+        //            s.Show();
+        //            Application.DoEvents();
+        //            s.label2.Text = "Connecting...";                  
+        //            Application.DoEvents();
+        //            Thread.Sleep(2000);
+        //            if (Globals.PyClient.Start())
+        //            {
+        //                s.label2.Text = "Connected!";
+        //            }
+        //            else
+        //            {
+        //                s.label2.Text = "Could not connect!";
+        //                PyClient = null;
+        //            }
+        //            Application.DoEvents();
+        //            Thread.Sleep(2000);
+        //            s.Close();
+        //            s.Dispose();
 
-                    string python = Helpers.GetPythonPath();
-                    if (python == "")
-                    {
-                        string msg = "Python path is not configured or python.exe does not exists!!\r\n\r\nPlease set the %PATH% variable!";
-                        MessageBox.Show( msg, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                    }
+        //            string python = Helpers.GetPythonPath();
+        //            if (python == "")
+        //            {
+        //                string msg = "Python path is not configured or python.exe does not exists!!\r\n\r\nPlease set the %PATH% variable!";
+        //                MessageBox.Show( msg, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+        //            }
                    
-                });
+        //        });
 
-                t.Start();
-            }
-            catch (Exception ee)
-            {
-                PyClient = null;
-            }
-        }
+        //        t.Start();
+        //    }
+        //    catch (Exception ee)
+        //    {
+        //        PyClient = null;
+        //    }
+        //}
 
         //public static string PythonExe
         //{ get { return Properties.Settings.Default.PythonExe; } }
@@ -85,7 +85,6 @@ namespace EsPy
         public static Terminal Terminal
         { get { return MainForm.TerminalForm.scintilla; }  }
 
-        public static ErrorListForm ErrorListForm
-        { get { return MainForm.ErrorListForm; } }
+      
     }
 }

+ 8 - 0
EsPy/Helps/help.html

@@ -37,5 +37,13 @@
     <h2>Pins</h2>
     <img style="width:640px" src="images/esp8266-wemos-d1-mini-pinout.png" /> 
 
+
+    <h2>Sonoff</h2>
+        1. press button and power on
+        2. erase
+        3. power off
+        4. press button and power on
+        5. write
+
 </body>
 </html>

+ 57 - 33
EsPy/MainForm.Designer.cs

@@ -51,7 +51,6 @@
             this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.mnView = new System.Windows.Forms.ToolStripMenuItem();
             this.mnTerminal = new System.Windows.Forms.ToolStripMenuItem();
-            this.mnErrorList = new System.Windows.Forms.ToolStripMenuItem();
             this.mnDevice = new System.Windows.Forms.ToolStripMenuItem();
             this.mnPorts = new System.Windows.Forms.ToolStripMenuItem();
             this.mnFileManager = new System.Windows.Forms.ToolStripMenuItem();
@@ -60,6 +59,7 @@
             this.mnTools = new System.Windows.Forms.ToolStripMenuItem();
             this.mnWebREPL = new System.Windows.Forms.ToolStripMenuItem();
             this.mnHelp = new System.Windows.Forms.ToolStripMenuItem();
+            this.ePS8266ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.mnViewHelp = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
             this.mnAbout = new System.Windows.Forms.ToolStripMenuItem();
@@ -98,10 +98,13 @@
             this.vS2015LightTheme1 = new WeifenLuo.WinFormsUI.Docking.VS2015LightTheme();
             this.visualStudioToolStripExtender1 = new WeifenLuo.WinFormsUI.Docking.VisualStudioToolStripExtender(this.components);
             this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
-            this.JediState = new System.Windows.Forms.ToolStripStatusLabel();
+            this.FilePath = new System.Windows.Forms.ToolStripStatusLabel();
+            this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
+            this.mnOpenFileFolder = new System.Windows.Forms.ToolStripMenuItem();
             this.menuStrip1.SuspendLayout();
             this.toolStrip1.SuspendLayout();
             this.statusStrip1.SuspendLayout();
+            this.contextMenuStrip1.SuspendLayout();
             this.SuspendLayout();
             // 
             // menuStrip1
@@ -146,7 +149,7 @@
             this.mnNewOther});
             this.mnNew.Image = ((System.Drawing.Image)(resources.GetObject("mnNew.Image")));
             this.mnNew.Name = "mnNew";
-            this.mnNew.Size = new System.Drawing.Size(152, 22);
+            this.mnNew.Size = new System.Drawing.Size(121, 22);
             this.mnNew.Text = "New";
             // 
             // mnNewPython
@@ -207,20 +210,20 @@
             // 
             this.mnOpen.Image = ((System.Drawing.Image)(resources.GetObject("mnOpen.Image")));
             this.mnOpen.Name = "mnOpen";
-            this.mnOpen.Size = new System.Drawing.Size(152, 22);
+            this.mnOpen.Size = new System.Drawing.Size(121, 22);
             this.mnOpen.Text = "Open...";
             this.mnOpen.Click += new System.EventHandler(this.mnOpen_Click);
             // 
             // toolStripSeparator4
             // 
             this.toolStripSeparator4.Name = "toolStripSeparator4";
-            this.toolStripSeparator4.Size = new System.Drawing.Size(149, 6);
+            this.toolStripSeparator4.Size = new System.Drawing.Size(118, 6);
             // 
             // mnSave
             // 
             this.mnSave.Enabled = false;
             this.mnSave.Name = "mnSave";
-            this.mnSave.Size = new System.Drawing.Size(152, 22);
+            this.mnSave.Size = new System.Drawing.Size(121, 22);
             this.mnSave.Text = "Save";
             this.mnSave.Click += new System.EventHandler(this.mnSave_Click);
             // 
@@ -228,7 +231,7 @@
             // 
             this.mnSaveAs.Enabled = false;
             this.mnSaveAs.Name = "mnSaveAs";
-            this.mnSaveAs.Size = new System.Drawing.Size(152, 22);
+            this.mnSaveAs.Size = new System.Drawing.Size(121, 22);
             this.mnSaveAs.Text = "Save as...";
             this.mnSaveAs.Click += new System.EventHandler(this.mnSaveAs_Click);
             // 
@@ -236,19 +239,19 @@
             // 
             this.mnSaveAll.Image = global::EsPy.Properties.Resources.saveall;
             this.mnSaveAll.Name = "mnSaveAll";
-            this.mnSaveAll.Size = new System.Drawing.Size(152, 22);
+            this.mnSaveAll.Size = new System.Drawing.Size(121, 22);
             this.mnSaveAll.Text = "Save all";
             this.mnSaveAll.Click += new System.EventHandler(this.mnSaveAll_Click);
             // 
             // toolStripMenuItem2
             // 
             this.toolStripMenuItem2.Name = "toolStripMenuItem2";
-            this.toolStripMenuItem2.Size = new System.Drawing.Size(149, 6);
+            this.toolStripMenuItem2.Size = new System.Drawing.Size(118, 6);
             // 
             // exitToolStripMenuItem
             // 
             this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
-            this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+            this.exitToolStripMenuItem.Size = new System.Drawing.Size(121, 22);
             this.exitToolStripMenuItem.Text = "Exit";
             this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
             // 
@@ -272,8 +275,7 @@
             // mnView
             // 
             this.mnView.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.mnTerminal,
-            this.mnErrorList});
+            this.mnTerminal});
             this.mnView.Name = "mnView";
             this.mnView.Size = new System.Drawing.Size(44, 20);
             this.mnView.Text = "&View";
@@ -286,13 +288,6 @@
             this.mnTerminal.Text = "Terminal";
             this.mnTerminal.Click += new System.EventHandler(this.mnTerminal_Click);
             // 
-            // mnErrorList
-            // 
-            this.mnErrorList.Name = "mnErrorList";
-            this.mnErrorList.Size = new System.Drawing.Size(121, 22);
-            this.mnErrorList.Text = "Error List";
-            this.mnErrorList.Click += new System.EventHandler(this.mnErrorList_Click);
-            // 
             // mnDevice
             // 
             this.mnDevice.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -351,6 +346,7 @@
             // mnHelp
             // 
             this.mnHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.ePS8266ToolStripMenuItem,
             this.mnViewHelp,
             this.toolStripMenuItem1,
             this.mnAbout});
@@ -358,23 +354,30 @@
             this.mnHelp.Size = new System.Drawing.Size(44, 20);
             this.mnHelp.Text = "Help";
             // 
+            // ePS8266ToolStripMenuItem
+            // 
+            this.ePS8266ToolStripMenuItem.Name = "ePS8266ToolStripMenuItem";
+            this.ePS8266ToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
+            this.ePS8266ToolStripMenuItem.Text = "EPS8266...";
+            this.ePS8266ToolStripMenuItem.Click += new System.EventHandler(this.ePS8266ToolStripMenuItem_Click);
+            // 
             // mnViewHelp
             // 
             this.mnViewHelp.Name = "mnViewHelp";
-            this.mnViewHelp.Size = new System.Drawing.Size(127, 22);
-            this.mnViewHelp.Text = "View Help";
+            this.mnViewHelp.Size = new System.Drawing.Size(136, 22);
+            this.mnViewHelp.Text = "View Help...";
             this.mnViewHelp.Click += new System.EventHandler(this.mnViewHelp_Click);
             // 
             // toolStripMenuItem1
             // 
             this.toolStripMenuItem1.Name = "toolStripMenuItem1";
-            this.toolStripMenuItem1.Size = new System.Drawing.Size(124, 6);
+            this.toolStripMenuItem1.Size = new System.Drawing.Size(133, 6);
             // 
             // mnAbout
             // 
             this.mnAbout.Name = "mnAbout";
-            this.mnAbout.Size = new System.Drawing.Size(127, 22);
-            this.mnAbout.Text = "About";
+            this.mnAbout.Size = new System.Drawing.Size(136, 22);
+            this.mnAbout.Text = "About...";
             this.mnAbout.Click += new System.EventHandler(this.mnAbout_Click);
             // 
             // toolStrip1
@@ -632,7 +635,7 @@
             this.toolStripStatusLabel4,
             this.toolStripStatusLabel2,
             this.toolStripStatusLabel1,
-            this.JediState});
+            this.FilePath});
             this.statusStrip1.Location = new System.Drawing.Point(0, 398);
             this.statusStrip1.Name = "statusStrip1";
             this.statusStrip1.Size = new System.Drawing.Size(522, 22);
@@ -656,11 +659,14 @@
             // 
             // dockPanel1
             // 
+            this.dockPanel1.ContextMenuStrip = this.contextMenuStrip1;
             this.dockPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.dockPanel1.DockBackColor = System.Drawing.SystemColors.ControlDarkDark;
             this.dockPanel1.DocumentStyle = WeifenLuo.WinFormsUI.Docking.DocumentStyle.DockingWindow;
             this.dockPanel1.Location = new System.Drawing.Point(0, 55);
             this.dockPanel1.Name = "dockPanel1";
+            this.dockPanel1.ShowAutoHideContentOnHover = false;
+            this.dockPanel1.ShowDocumentIcon = true;
             this.dockPanel1.Size = new System.Drawing.Size(522, 343);
             this.dockPanel1.TabIndex = 3;
             this.dockPanel1.ActiveDocumentChanged += new System.EventHandler(this.dockPanel1_ActiveDocumentChanged);
@@ -673,14 +679,29 @@
             // toolStripStatusLabel1
             // 
             this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
-            this.toolStripStatusLabel1.Size = new System.Drawing.Size(30, 17);
-            this.toolStripStatusLabel1.Text = "Jedi:";
+            this.toolStripStatusLabel1.Size = new System.Drawing.Size(28, 17);
+            this.toolStripStatusLabel1.Text = "File:";
+            // 
+            // FilePath
+            // 
+            this.FilePath.Name = "FilePath";
+            this.FilePath.Size = new System.Drawing.Size(22, 17);
+            this.FilePath.Text = "---";
+            // 
+            // contextMenuStrip1
+            // 
+            this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.mnOpenFileFolder});
+            this.contextMenuStrip1.Name = "contextMenuStrip1";
+            this.contextMenuStrip1.Size = new System.Drawing.Size(153, 48);
+            this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening);
             // 
-            // JediState
+            // mnOpenFileFolder
             // 
-            this.JediState.Name = "JediState";
-            this.JediState.Size = new System.Drawing.Size(22, 17);
-            this.JediState.Text = "---";
+            this.mnOpenFileFolder.Name = "mnOpenFileFolder";
+            this.mnOpenFileFolder.Size = new System.Drawing.Size(152, 22);
+            this.mnOpenFileFolder.Text = "Open Folder...";
+            this.mnOpenFileFolder.Click += new System.EventHandler(this.mnOpenFileFolder_Click);
             // 
             // MainForm
             // 
@@ -705,6 +726,7 @@
             this.toolStrip1.PerformLayout();
             this.statusStrip1.ResumeLayout(false);
             this.statusStrip1.PerformLayout();
+            this.contextMenuStrip1.ResumeLayout(false);
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -777,10 +799,12 @@
         private System.Windows.Forms.ToolStripMenuItem btnNewOther;
         private System.Windows.Forms.ToolStripButton btnFileManager;
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
-        private System.Windows.Forms.ToolStripMenuItem mnErrorList;
         public WeifenLuo.WinFormsUI.Docking.DockPanel dockPanel1;
+        private System.Windows.Forms.ToolStripMenuItem ePS8266ToolStripMenuItem;
         private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
-        private System.Windows.Forms.ToolStripStatusLabel JediState;
+        private System.Windows.Forms.ToolStripStatusLabel FilePath;
+        private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
+        private System.Windows.Forms.ToolStripMenuItem mnOpenFileFolder;
     }
 }
 

+ 49 - 47
EsPy/MainForm.cs

@@ -34,13 +34,13 @@ namespace EsPy
 
         private DeserializeDockContent deserializeDockContent;
         public TerminalForm TerminalForm = null;
-        public ErrorListForm ErrorListForm = null;
+        //public ErrorListForm ErrorListForm = null;
         public MainForm()
         {
             InitializeComponent();
             Globals.MainForm = this;
 
-            Globals.PyClientStart();
+            //Globals.PyClientStart();
 
             AutoScaleMode = AutoScaleMode.Dpi;
 
@@ -263,11 +263,6 @@ namespace EsPy
                 this.TerminalForm.Show(this.dockPanel1);
             }
 
-            if (this.ErrorListForm == null)
-            {
-                this.ErrorListForm = new ErrorListForm();
-                this.ErrorListForm.Show(this.dockPanel1);
-            }
             //if (!this.ComportIsExists)
             //{
             //    this.btnConnect.Enabled = false;
@@ -342,8 +337,8 @@ namespace EsPy
                 }
             }
 
-            if (Globals.PyClient != null)
-                Globals.PyClient.Stop();
+            //if (Globals.PyClient != null)
+            //    Globals.PyClient.Stop();
         }
 
         private bool CanConnect
@@ -358,15 +353,16 @@ namespace EsPy
         {
   
             this.mnTerminal.Enabled = this.TerminalForm == null;
-            this.JediState.Text = Globals.PyClient != null ? "Connected" : "Not connected";
+            //this.JediState.Text = Globals.PyClient != null ? "Connected" : "Not connected";
         }
 
         private void SetSchema(object sender, System.EventArgs e)
         {
+            
             if (true)
             {
                 this.dockPanel1.Theme = this.vS2015BlueTheme1;
-                this.EnableVSRenderer(VisualStudioToolStripExtender.VsVersion.Vs2015, vS2015BlueTheme1);
+                this.EnableVSRenderer(VisualStudioToolStripExtender.VsVersion.Vs2008, vS2015BlueTheme1);
             }      
 
             if (dockPanel1.Theme.ColorPalette != null)
@@ -403,14 +399,14 @@ namespace EsPy
                 this.TerminalForm.IsHidden = false;
                 return this.TerminalForm;
             }
-            else if (persistString == typeof(ErrorListForm).ToString())
-            {
-                if (this.ErrorListForm != null)
-                    return this.ErrorListForm;
-                this.ErrorListForm = new ErrorListForm();
-                this.ErrorListForm.IsHidden = false;
-                return this.ErrorListForm;
-            }
+            //else if (persistString == typeof(ErrorListForm).ToString())
+            //{
+            //    if (this.ErrorListForm != null)
+            //        return this.ErrorListForm;
+            //    this.ErrorListForm = new ErrorListForm();
+            //    this.ErrorListForm.IsHidden = false;
+            //    return this.ErrorListForm;
+            //}
 
             else if (persistString == typeof(EditorForm).ToString())
             {
@@ -439,7 +435,6 @@ namespace EsPy
             ToolStripManager.RevertMerge(this.toolStrip1);
             if (this.dockPanel1.ActiveContent != null)
             {
-
                 if (this.dockPanel1.ActiveContent is IForm)
                 {
                     IForm form = this.dockPanel1.ActiveContent as IForm;
@@ -447,39 +442,23 @@ namespace EsPy
                         ToolStripManager.Merge(form.ToolStrip, this.toolStrip1);
                     if (form.MenuStrip != null)
                         ToolStripManager.Merge(form.MenuStrip, this.menuStrip1);
-
                 }
             }
             this.UpdateUI();
         }
+
         private void dockPanel1_ActiveDocumentChanged(object sender, EventArgs e)
         {
-            ToolStripManager.RevertMerge(this.menuStrip1);
-            ToolStripManager.RevertMerge(this.toolStrip1);
             if (this.dockPanel1.ActiveContent is IDocument)
             {
                 IDocument doc = this.dockPanel1.ActiveDocument as IDocument;
                 doc.CanPaste = Clipboard.ContainsText();
                 doc.UpdateUI();
-                IDocument form = this.dockPanel1.ActiveDocument as IDocument;
-                if (form.ToolStrip != null)
-                    ToolStripManager.Merge(form.ToolStrip, this.toolStrip1);
-                if (form.MenuStrip != null)
-                    ToolStripManager.Merge(form.MenuStrip, this.menuStrip1);
             }
-            //else if (this.dockPanel1.ActiveContent != null)
-            //{
-               
-            //    if (this.dockPanel1.ActiveContent is IForm)
-            //    {
-            //        IForm form = this.dockPanel1.ActiveContent as IForm;
-            //        if (form.ToolStrip != null)
-            //            ToolStripManager.Merge(form.ToolStrip, this.toolStrip1);
-            //        if (form.MenuStrip != null)
-            //            ToolStripManager.Merge(form.MenuStrip, this.menuStrip1);
-                    
-            //    }
-            //}
+            else
+            {
+                this.FilePath.Text = "";
+            }
             this.UpdateUI();
         }
         
@@ -950,6 +929,10 @@ namespace EsPy
                 d.ShowDialog();
                 d.Dispose();
             }
+            else
+            {
+                MessageBox.Show("Select a Port first!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+            }
         }
 
         private void mnFileManager_Click(object sender, EventArgs e)
@@ -971,7 +954,7 @@ namespace EsPy
 
         private void mnAbout_Click(object sender, EventArgs e)
         {
-            Splash s = new Splash();
+            About s = new About();
             s.ShowDialog();
             s.Dispose();
 
@@ -980,11 +963,11 @@ namespace EsPy
             //d.Dispose();
         }
 
-        private void mnErrorList_Click(object sender, EventArgs e)
-        {
-            if (this.ErrorListForm != null)
-                this.ErrorListForm.Show(this.dockPanel1);
-        }
+        //private void mnErrorList_Click(object sender, EventArgs e)
+        //{
+        //    if (this.ErrorListForm != null)
+        //        this.ErrorListForm.Show(this.dockPanel1);
+        //}
 
         private void MainForm_Deactivate(object sender, EventArgs e)
         {
@@ -1015,5 +998,24 @@ namespace EsPy
         {
 
         }
+
+        private void ePS8266ToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            System.Diagnostics.Process.Start("http://docs.micropython.org/en/latest/esp8266/");
+        }
+
+        private void mnOpenFileFolder_Click(object sender, EventArgs e)
+        {
+            if (this.dockPanel1.ActiveDocument != null && this.dockPanel1.ActiveDocument is IDocument)
+            {
+                IDocument d = this.dockPanel1.ActiveDocument as IDocument;
+                System.Diagnostics.Process.Start("explorer.exe", $"/select, \"{d.FileName}\"");
+            }
+        }
+
+        private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
+        {
+            mnOpenFileFolder.Enabled = this.dockPanel1.ActiveDocument != null && this.dockPanel1.ActiveDocument is IDocument;
+        }
     }
 }

+ 3 - 0
EsPy/MainForm.resx

@@ -463,6 +463,9 @@
   <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>237, 17</value>
   </metadata>
+  <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>833, 17</value>
+  </metadata>
   <metadata name="vS2015BlueTheme1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>353, 17</value>
   </metadata>

+ 2 - 2
EsPy/Properties/AssemblyInfo.cs

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers 
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.6")]
-[assembly: AssemblyFileVersion("1.0.0.6")]
+[assembly: AssemblyVersion("1.0.0.7")]
+[assembly: AssemblyFileVersion("1.0.0.7")]

+ 12 - 0
EsPy/Properties/Settings.Designer.cs

@@ -250,5 +250,17 @@ namespace EsPy.Properties {
                 this["PyServerPort"] = value;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("3")]
+        public int EspFlashMode {
+            get {
+                return ((int)(this["EspFlashMode"]));
+            }
+            set {
+                this["EspFlashMode"] = value;
+            }
+        }
     }
 }

+ 3 - 0
EsPy/Properties/Settings.settings

@@ -59,5 +59,8 @@
     <Setting Name="PyServerPort" Type="System.Int32" Scope="User">
       <Value Profile="(Default)">5005</Value>
     </Setting>
+    <Setting Name="EspFlashMode" Type="System.Int32" Scope="User">
+      <Value Profile="(Default)">3</Value>
+    </Setting>
   </Settings>
 </SettingsFile>

+ 1 - 0
EsPy/Units/PySerial.cs

@@ -35,6 +35,7 @@ namespace EsPy.Units
 
         public void SoftReset()
         {
+          
             this.Write(CTRL_D);
         }
 

+ 4 - 9
EsPy/Units/SerialPort.cs

@@ -30,10 +30,10 @@ namespace EsPy.Units
 
         public const string PROMPT = ">>> ";
         public const string DOTS = "... ";
-        private char C0 = '\0';
-        private char C1 = '\0';
-        private char C2 = '\0';
-        private char C3 = '\0';
+        //private char C0 = '\0';
+        //private char C1 = '\0';
+        //private char C2 = '\0';
+        //private char C3 = '\0';
 
         public SerialPort()
         {
@@ -249,7 +249,6 @@ namespace EsPy.Units
         }
 
         private char[] FPrompt = new char[] { '\0', '\0', '\0', '\0' };
-
         private void PromptShift(char c)
         {
             //for (int i = 0; i < this.FPrompt.Length - 1; i++)
@@ -283,11 +282,7 @@ namespace EsPy.Units
         {
             this.Busy = true;
             string part = this.SP.ReadExisting();
-
-
             this.Prompt(part);
-
-           
             return part;
         }
 

BIN
Images/Névtelen.xcf


BIN
Images/main.png