Beispiel #1
0
        public FireEditorTabItem()
        {
            InitializeComponent();

            _EditorControl = new CodeEditorControl();
            _EditorControl.Dock = System.Windows.Forms.DockStyle.Fill;

            _EditorControl.ContextMenuStrip = contextMenuStrip1;

            _EditorControl.Name = "codeeditor";

            this.Controls.Add(_EditorControl);

            this.Text = "Blank*";

            _EditorControl.FileNameChanged += new EventHandler(_EditorControl_FileNameChanged);

            _EditorControl.FileSavedChanged += new EventHandler(_EditorControl_FileSaved);

            _EditorControl.FontName = "Courier New";

            _EditorControl.FontSize = 10;

            
      

            _EditorControl.LineNumberForeColor = Color.SteelBlue;
            _EditorControl.LineNumberBorderColor = Color.SteelBlue;
        }
        public CodeEditorIDETextBox(string fileExtension)
        {
            InitializeComponent();
            Dock = DockStyle.Fill;

            codeEditorControl = new CodeEditorControl();

            switch (fileExtension)
            {
                case ".cs":
                    codeEditorControl.Document.SyntaxFile = "SyntaxFiles\\CSharp.syn";
                    break;
                case ".py":
                    codeEditorControl.Document.SyntaxFile = "SyntaxFiles\\IronPython.syn";
                    break;
                default:
                    codeEditorControl.Document.SyntaxFile = "SyntaxFiles\\AutoIt.syn";
                    break;
            }

            codeEditorControl.Dock = DockStyle.Fill;
            codeEditorControl.Document.ModifiedChanged += Document_ModifiedChanged;
            Controls.Add(codeEditorControl);
        }
Beispiel #3
0
 public static void SetSyntax(CodeEditorControl editor, string filename)
 {
     editor.Document.Parser.Init(CodeEditorSyntaxLoader.LanguageList.GetLanguageFromFile(filename));
 }
Beispiel #4
0
        public static void SetSyntax(CodeEditorControl editor, SyntaxLanguage language)
        {
            Stream xml = GetSyntaxStream(GetSyntaxFileName(language));

            editor.Document.Parser.Init(Language.FromSyntaxFile(xml));
        }
Beispiel #5
0
		/// <summary>
		/// Default constructor for the SyntaxBoxControl
		/// </summary>
		public EditViewControl(CodeEditorControl Parent) : base()
		{
			_CodeEditor = Parent;


            Painter = new Painter_GDI(this);
			_Selection = new Selection(this);
			_Caret = new Caret(this);

			_Caret.Change += new EventHandler(this.CaretChanged);
			_Selection.Change += new EventHandler(this.SelectionChanged);


			//	this.AttachDocument (_SyntaxBox.Document);


			InitializeComponent();


			CreateAutoList();
			//CreateFindForm ();
			CreateInfoTip();

            this.SetStyle(ControlStyles.AllPaintingInWmPaint, false);
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
			this.SetStyle(ControlStyles.Selectable, true);
			this.SetStyle(ControlStyles.ResizeRedraw, true);
			this.SetStyle(ControlStyles.Opaque, true);
			this.SetStyle(ControlStyles.UserPaint, true);
           // this.SetStyle(ControlStyles.UserMouse, true);
		}
Beispiel #6
0
        /// <summary>
        /// 根据keyword弹出参数提示
        /// </summary>
        /// <param name="keyword">函数全名</param>
        /// <param name="index">活动参数位置</param>
        /// <param name="codeEditor">luaEditorControl引用</param>
        private void PopInfo(string keyword, int index, string strNs, CodeEditorControl codeEditor)
        {
            string content = "";
            QueryEventsArgs queryEventArgs = new QueryEventsArgs();

            // 先看本文档里有没有
            foreach (FunctionList functionList in cmbFunctionList.Items)
            {
                if (keyword == functionList.FunctionName)
                {
                    content = functionList.FullText;
                    break;
                }
            }

            // 没有啊,那么去查标准库
            if (content == "")
            {
                queryEventArgs.keyword = keyword;
                content = StandardLib.GetFunctionInfo(keyword);
            }

            // 标准库里查不到,那就去反射缓存里查查
            if (content == "")
            {
                content = ParameterCache.FindMethodParameterByFullName(keyword, strNs);
            }

            //缓存里也没有,那就只能回调了
            if (content == "" && queryParms != null)
            {
                queryParms(this, queryEventArgs);         /*回调,获取Parms列表*/
            }


            if (content != "")
            {
                string[] spec = { "<%newline%>" };
                string[] aspp = content.Split(spec, StringSplitOptions.RemoveEmptyEntries);
                foreach (string sitem in aspp)
                {
                    queryEventArgs.parms_list.Add(sitem.Replace("\r\n", "<BR>"));
                }
            }

            //把重载了的参数放进去
            if (queryEventArgs.parms_list.Count > 0)
            {
                codeEditor.InfoTipPosition = new TextPoint(codeEditor.Caret.Position.X + 1, codeEditor.Caret.Position.Y);
                codeEditor.InfoTipCount = queryEventArgs.parms_list.Count;

                for (int i = 0; i < queryEventArgs.parms_list.Count; i++)
                {
                    codeEditor.InfoTipSelectedIndex = i;
                    string argIn = queryEventArgs.parms_list[i];
                    if(argIn.IndexOf("<BR>") == -1)
                    {
                        argIn += "<BR>";
                    }

                    try 
                    {
                        string sc1 = argIn.Substring(0, argIn.IndexOf("<BR>"));
                        if(sc1.IndexOf('(') != -1)
                        {
                            string s1 = sc1.Substring(0, sc1.LastIndexOf('('));
                            string s2 = sc1.Substring(sc1.LastIndexOf('(') + 1);
                            s2 = s2.Substring(0, s2.Length - 1);
                            string s3 = argIn.Substring(argIn.IndexOf("<BR>"));

                            string[] asp = { "," };
                            string[] argIns = s2.Split(asp, StringSplitOptions.RemoveEmptyEntries);
                            if (argIns.Length > index - 1)
                            {
                                string t = argIns[index - 1].Trim();
                                if (t.Substring(t.Length - 1) == "[")
                                    argIns[index - 1] = "<b>" + t.Substring(0, t.Length - 1) + "</b>[";
                                else if (t.Substring(t.Length - 1) == "]")
                                    argIns[index - 1] = "<b>" + t.Substring(0, t.Length - 1) + "</b>]";
                                else
                                    argIns[index - 1] = "<b>" + t + "</b>";
                            }
                            s2 = string.Join(",", argIns);
                            codeEditor.InfoTipText = s1 + "(" + s2 + ")" + s3;         
                        }
                    }
                    catch
                    {
                        codeEditor.InfoTipText = argIn;
                        throw;
                    }

                }
                codeEditor.InfoTipVisible = true;
                inputState = InputState.PARMSLIST_OPEN;
            }
        }
Beispiel #7
0
        /// <summary>
        /// 显示提示选项
        /// </summary>
        /// <param name="eKey">按键信息</param>
        /// <param name="codeEditor">当前编辑控件</param>
        private void ShowAutoList(KeyPressEventArgs eKey, CodeEditorControl codeEditor)
        {
            if (eKey.KeyChar > 128)
            {
                return;
            }

            //获取完整对象名                     
            string keyWord = codeEditor.Caret.CurrentRow.Text.Substring(0, codeEditor.Caret.Position.X);
            string objectFullName = GetObjectFullName(keyWord);

            string functionName = "";
            int cursorPosition = 0;

            if (!((eKey.KeyChar >= 'a' && eKey.KeyChar <= 'z') || (eKey.KeyChar >= 'A' && eKey.KeyChar <= 'Z') || (eKey.KeyChar >= '0' && eKey.KeyChar <= '9') || eKey.KeyChar == '_'))
            {
                // 过滤之前的参数,获取函数名,以及光标参数所在的位置
                if (eKey.KeyChar == '\b')
                {
                    if (keyWord.Length > 0)
                    {
                        keyWord = keyWord.Substring(0, keyWord.Length - 1);
                    }
                }
                else
                {
                    keyWord += eKey.KeyChar.ToString(); // 把','也追加后面去吧
                }

                functionName = GetFunctionFullNameAndTurns(keyWord);
                int index = functionName.IndexOf("##");
                cursorPosition = int.Parse(functionName.Substring(index + 2));
                functionName = functionName.Substring(0, index);                
                
                // 获取命名空间(说白了就是函数名)
                Segment segment = codeEditor.Caret.CurrentSegment();
                
                // 看看如果是注释内,或者是引号内,就拉倒
                segment = codeEditor.Caret.CurrentSegment();

                if (segment != null)
                {
                    if (segment.BlockType.Style.Name == "Lua Comment")
                    {
                        return;
                    }

                    if (segment.BlockType.Style.Name == "Lua String")
                    {
                        return;
                    }
                    
                    string currentText = codeEditor.Caret.CurrentRow.Text;
                    currentText = currentText.Substring(0, codeEditor.Caret.Position.X);
                    currentText = currentText.Trim(invalidChartArray);

                    if (currentText.StartsWith("--"))
                    {
                        return;
                    }

                    if ((currentText.Replace("'", "").Length - currentText.Length) % 2 == 1)
                    {
                        return;
                    }

                    if ((currentText.Replace("\"", "").Length - currentText.Length) % 2 == 1)
                    {
                        return;
                    }                    
                }
            }     
               
            switch (eKey.KeyChar)
            {
                case ':':
                    {
                        goto case '.';
                    }
                case '.':
                    {
                        switch (inputState)
                        {
                            case InputState.FUNCTIONLIST_OPEN:
                                {
                                    codeEditor.AutoListVisible = false;
                                    inputState = InputState.NORMAL;

                                    break;
                                }
                            case InputState.OBJECTLIST_OPEN:
                                {
                                    goto case InputState.FUNCTIONLIST_OPEN;
                                }
                            case InputState.INTELLISENCE_OPEN:
                                {
                                    goto case InputState.FUNCTIONLIST_OPEN;
                                }
                            default:
                                {
                                    break;
                                }
                        }

                        if (objectFullName != "")
                        {
                            // 触发事件
                            QueryEventsArgs queryEventsArg = new QueryEventsArgs();
                            queryEventsArg.keyword = objectFullName;
                            List<string> objectList = StandardLib.GetObjectList(objectFullName);

                            if (objectList.Count == 0)
                            {
                                objectList = ParameterCache.findMethodInfoByFullName(objectFullName, strNs);
                            }
        
                            foreach (string objectInfo in objectList)
                            {
                                string[] infoArray = objectInfo.Split(queryObjectStringArray, StringSplitOptions.RemoveEmptyEntries);
                                string type = infoArray[1];
                                string value = infoArray[0];

                                if (!queryEventsArg.leTable.ContainsKey(objectInfo))
                                {
                                    queryEventsArg.leTable.Add(objectInfo, new LuaEditorTableItem(value, type, value, ""));
                                }
                            }

                            objectList.Clear();

                            if (queryEventsArg.leTable.Count > 0)
                            {
                                codeEditor.AutoListBeginLoad();
                                codeEditor.AutoListClear();

                                m_list_context = "";

                                foreach (LuaEditorTableItem tableItem in queryEventsArg.leTable.Values)
                                {
                                    switch (tableItem.ItemType)
                                    {
                                        case "method":
                                            {
                                                if (eKey.KeyChar == ':')
                                                {
                                                    codeEditor.AutoListAdd(tableItem.Name, tableItem.ItemValue.ToString(), tableItem.Info, 1);
                                                }

                                                break;
                                            }                                            
                                        case "function":
                                            {
                                                if (eKey.KeyChar == '.')
                                                {
                                                    codeEditor.AutoListAdd(tableItem.Name, tableItem.ItemValue.ToString(), tableItem.Info, 6);
                                                }

                                                break;
                                            }                                            
                                        case "table":
                                            {
                                                if (eKey.KeyChar == '.')
                                                {
                                                    codeEditor.AutoListAdd(tableItem.Name, tableItem.ItemValue.ToString(), tableItem.Info, 3);
                                                }

                                                break;
                                            }
                                            
                                        case "var":
                                            {
                                                if (eKey.KeyChar == '.')
                                                {
                                                    codeEditor.AutoListAdd(tableItem.Name, tableItem.ItemValue.ToString(), tableItem.Info, 4);
                                                }

                                                break;
                                            }          
                                        default:
                                            {
                                                break;
                                            }
                                    }

                                    m_list_context += "|" + tableItem.Name;
                                }

                                codeEditor.AutoListEndLoad();
                                codeEditor.AutoListPosition = new TextPoint(codeEditor.Caret.Position.X + 1, codeEditor.Caret.Position.Y);
                                codeEditor.AutoListVisible = true;
                                inputState = InputState.OBJECTLIST_OPEN;
                            }
                        }

                        break;
                    }                                      
                case ' ':
                    {
                        switch (inputState)
                        {
                            case InputState.FUNCTIONLIST_OPEN:
                                {
                                    codeEditor.AutoListVisible = false;
                                    inputState = InputState.NORMAL;

                                    break;
                                }
                            case InputState.OBJECTLIST_OPEN:
                                {
                                    goto case InputState.OBJECTLIST_OPEN;
                                }
                            case InputState.INTELLISENCE_OPEN:
                                {
                                    codeEditor.AutoListVisible = false;
                                    inputState = InputState.NORMAL;

                                    goto case InputState.NORMAL;
                                }
                            case InputState.NORMAL:
                                {
                                    break;
                                }
                            default:
                                {
                                    break;
                                }
                        }
                       
                        break;
                    }
                case ')':
                    {
                        codeEditor.InfoTipVisible = false;
                        codeEditor.AutoListVisible = false;
                        inputState = InputState.NORMAL;

                        break;
                    }
                    
                case ',':
                    {
                        switch (inputState)
                        {
                            case InputState.INTELLISENCE_OPEN:
                                {
                                    codeEditor.AutoListVisible = false;
                                    codeEditor.InfoTipVisible = false;
                                    inputState = InputState.NORMAL;

                                    break;
                                }
                            case InputState.FUNCTIONLIST_OPEN:
                                {
                                    goto case InputState.INTELLISENCE_OPEN;
                                }
                            default:
                                {
                                    break;
                                }
                        }

                        if (functionName != "")
                        {
                            PopInfo(functionName, cursorPosition, strNs, codeEditor);
                        }

                        break;
                    }                    
                case '(' :
                    {
                        switch (inputState)
                        {
                            case InputState.FUNCTIONLIST_OPEN:
                                {
                                    codeEditor.AutoListVisible = false;
                                    inputState = InputState.NORMAL;

                                    break;
                                }
                            case InputState.OBJECTLIST_OPEN:
                                {
                                    goto case InputState.OBJECTLIST_OPEN;

                                    break;
                                }
                            default:
                                {
                                    break;
                                }
                        }                        

                        if (objectFullName != "")
                        {
                            PopInfo(objectFullName, 1, strNs, codeEditor);
                        }

                        break;
                    }
                    
                case '\r':
                    {
                        switch (inputState)
                        {
                            case InputState.FUNCTIONLIST_OPEN:
                                {
                                    codeEditor.AutoListVisible = false;
                                    inputState = InputState.NORMAL;

                                    break;
                                }
                            case InputState.OBJECTLIST_OPEN:
                                {
                                    goto case InputState.FUNCTIONLIST_OPEN;
                                }
                            case InputState.INTELLISENCE_OPEN:
                                {
                                    goto case InputState.FUNCTIONLIST_OPEN;
                                }
                            default:
                                {
                                    // 尝试模拟执行当前行语句
                                    Row currentRow = codeEditor.Document[codeEditor.Caret.Position.Y - 1];
                                    CodeLineScan(currentRow.Text, strNs);

                                    // 尝试自动缩进
                                    IndentText(codeEditor);

                                    break;
                                }
                        }

                        break;
                    }
                case '\b':
                    {
                        if (inputState == InputState.INTELLISENCE_OPEN)
                        {
                            if (objectFullName == "")
                            {
                                codeEditor.AutoListVisible = false;
                                inputState = InputState.NORMAL;                                
                            }
                        }

                        break;
                    }
                case '=':
                    {
                        if (inputState != InputState.NORMAL)
                        {
                            codeEditor.AutoListVisible = false;
                            inputState = InputState.NORMAL;
                        }

                        break;
                    }
                case '+':
                    {
                        goto case '=';
                    }
                case '-':
                    {
                        goto case '=';
                    }
                case '*':
                    {
                        goto case '=';
                    }
                case '/':
                    {
                        goto case '=';
                    }
                case '?':
                    {
                        goto case '=';
                    }
                default:
                    {
                        if (inputState == InputState.NORMAL)
                        {
                            if ((eKey.KeyChar >= 'a' && eKey.KeyChar <= 'z') || (eKey.KeyChar >= 'A' && eKey.KeyChar <= 'Z') || (eKey.KeyChar >= '0' && eKey.KeyChar <= '9') || eKey.KeyChar == '_')
                            {
                                // 智能感知>
                                List<string> wordList;
                                wordList = ParameterCache.GetIntelliSenceWordList(objectFullName + eKey.KeyChar.ToString(), strNs);

                                if (wordList.Count > 0)
                                {
                                    codeEditor.AutoListBeginLoad();
                                    codeEditor.AutoListClear();

                                    m_list_context = "";

                                    foreach (string s in wordList)
                                    {
                                        codeEditor.AutoListAdd(s, s, s, 1);
                                        m_list_context += "|" + s;
                                    }

                                    codeEditor.AutoListEndLoad();
                                    
                                    codeEditor.AutoListPosition = new TextPoint(codeEditor.Caret.Position.X/* + 1*/, codeEditor.Caret.Position.Y);
                                    codeEditor.AutoListVisible = true;
                                    inputState = InputState.INTELLISENCE_OPEN;
                                }

                                if (m_list_context.ToLower().IndexOf(string.Format("|{0}{1}", objectFullName, eKey.KeyChar).ToLower()) == -1) // 输入前几个字母不匹配,则干掉列表
                                {
                                    codeEditor.AutoListVisible = false;
                                    inputState = InputState.NORMAL;
                                }

                                if (string.Format("{0}|", m_list_context).IndexOf(string.Format("|{0}{1}|", objectFullName, eKey.KeyChar)) != -1)  // 完全匹配也干掉列表
                                {
                                    codeEditor.AutoListVisible = false;
                                    inputState = InputState.NORMAL;
                                }
                            }
                        }

                        break;
                    }
            }
        }
Beispiel #8
0
        /// <summary>
        /// 缩进文本
        /// </summary>
        /// <param name="codeEditor">当前编辑控件</param>
        private void IndentText(CodeEditorControl codeEditor)
        {
            Row currentRow = codeEditor.Document[codeEditor.Caret.Position.Y - 1];

            if (currentRow != null)
            {
                Row nextRow = codeEditor.Document[codeEditor.Caret.Position.Y + 1];

                if (nextRow == null || nextRow.Text.TrimStart(invalidChartArray) == "")
                {
                    string rowText = currentRow.Text.TrimStart(invalidChartArray);

                    foreach (string keyWord in switchRowKeyWordArray)
                    {
                        if (rowText.StartsWith(keyWord))
                        {
                            SendMessage(this.Handle, WM_CW_SCANCODE_FALSE, IntPtr.Zero, "");
                            break;
                        }
                    }
                }
            }  
        }
Beispiel #9
0
        /// <summary>
        /// 显示提示选项
        /// </summary>
        /// <param name="eKey">按键信息</param>
        /// <param name="codeEditor">当前编辑控件</param>
        private void ShowAutoList4GameLuaEditor(KeyPressEventArgs eKey, CodeEditorControl codeEditor)
        {
            // 强制规定,如果ascii码>130,那么131为F1,132为F2。。。。。
            // 不管三七二十一,先关闭列表再说
            codeEditor.AutoListVisible = false;
            codeEditor.InfoTipVisible = false;

            //计算当前输入的东东以及位置
            int nOffset = 0;
            QueryEventsArgs queryEventsArgs = new QueryEventsArgs();

            if (eKey.KeyChar != '\b' && eKey.KeyChar <= 128)
            {
                queryEventsArgs.szCode = string.Format("{0}{1}{2}", 
                                                       codeEditor.Document.Text.Substring(0, codeEditor.Selection.LogicalSelStart),
                                                       eKey.KeyChar,
                                                       codeEditor.Document.Text.Substring(codeEditor.Selection.LogicalSelStart));
                queryEventsArgs.nPos = codeEditor.Selection.LogicalSelStart + 1;

                nOffset++;
            }
            else
            {
                queryEventsArgs.szCode = codeEditor.Document.Text;
                queryEventsArgs.nPos = codeEditor.Selection.LogicalSelStart;
            }

            // 如果什么也没输入,只是按下了热键
            if (eKey.KeyChar > 128)
            {
                int ikey = (int)eKey.KeyChar - 130;
                queryEventsArgs.keyword = ikey.ToString();
            }

            // 由于Lua很变态,认为汉字的长度为2,所以我得手工看看有多少中文,然后加在长度上
            int nAdd = 0;

            for (int i = 0; i < queryEventsArgs.nPos; i++ )
            {
                if (queryEventsArgs.szCode[i] > 128)
                {
                    nAdd++;
                }
            }
            queryEventsArgs.nPos += nAdd;

            if (eKey.KeyChar == '\b')
            {
                queryEventsArgs.nPos *= -1;
            }

            // 获取新列表
            if (queryObjects != null && !codeEditorControl.ReadOnly) // 调试模式下不用启动自动完成功能
            {
                queryObjects(this, queryEventsArgs);
                bool querySuccess = false;

                if (queryEventsArgs.parms_list.Count > 0)
                {
                    codeEditor.InfoTipPosition = new TextPoint(codeEditor.Caret.Position.X + 1, codeEditor.Caret.Position.Y);
                    codeEditor.InfoTipCount = queryEventsArgs.parms_list.Count;

                    for (int i = 0; i < queryEventsArgs.parms_list.Count; i++)
                    {
                        codeEditor.InfoTipSelectedIndex = i;
                        string argIn = queryEventsArgs.parms_list[i];
                        codeEditor.InfoTipText = argIn;
                    }

                    codeEditor.InfoTipVisible = true;
                    querySuccess = true;
                }

                if (queryEventsArgs.leTable.Count > 0)
                {
                    codeEditor.AutoListBeginLoad();
                    codeEditor.AutoListClear();

                    foreach (LuaEditorTableItem tableItem in queryEventsArgs.leTable.Values)
                    {
                        codeEditor.AutoListAdd(tableItem.Name, tableItem.ItemValue.ToString(), tableItem.Info, int.Parse(tableItem.ItemType));                        
                    }

                    codeEditor.AutoListEndLoad();
                    codeEditor.AutoListPosition = new TextPoint(codeEditor.Caret.Position.X + nOffset, codeEditor.Caret.Position.Y);
                    codeEditor.AutoListPosition.X -= queryEventsArgs.nOverLen;

                    if (codeEditor.AutoListPosition.X < 0)
                    {
                        codeEditor.AutoListPosition.X = 0;
                    }

                    codeEditor.AutoListVisible = true;
                    querySuccess = true;
                }

                switch (eKey.KeyChar)
                {
                    case '\r':
                        {
                            IndentText(codeEditor);                           

                            break;
                        }
                        
                    default:
                        {
                            break;
                        }                    
                }

                if (!querySuccess)
                {
                    // ShowAutoList(eKey, codeEditor);
                }
            }            
        }
Beispiel #10
0
        public void InitializeComponent()
        {
            components = new Container();
            var lineMarginRender1 = new LineMarginRender();
            Editor = new CodeEditorControl();
            Document = new SyntaxDocument(components);
            SuspendLayout();
            //
            // editor
            //
            Editor.ActiveView = ActiveView.BottomRight;
            Editor.AllowBreakPoints = false;
            Editor.AutoListPosition = null;
            Editor.AutoListSelectedText = "a123";
            Editor.AutoListVisible = false;
            Editor.ChildBorderStyle = ControlBorderStyle.None;
            Editor.CopyAsRTF = false;
            Editor.Dock = DockStyle.Fill;
            Editor.Document = Document;
            Editor.InfoTipCount = 1;
            Editor.InfoTipPosition = null;
            Editor.InfoTipSelectedIndex = 1;
            Editor.InfoTipVisible = false;
            lineMarginRender1.Bounds = new Rectangle(19, 0, 19, 16);
            Editor.LineMarginRender = lineMarginRender1;
            Editor.Location = new Point(0, 0);
            Editor.LockCursorUpdate = false;
            Editor.Name = "editor";
            Editor.ParseOnPaste = true;
            Editor.Saved = false;
            Editor.ShowScopeIndicator = false;
            Editor.ShowTabGuides = true;
            Editor.Size = new Size(680, 383);
            Editor.SmoothScroll = true;
            Editor.SplitView = false;
            Editor.SplitviewH = -4;
            Editor.SplitviewV = -4;
            Editor.TabGuideColor = Color.FromArgb(244, 243, 234);
            Editor.TabIndex = 0;
            Editor.TextDrawStyle = TextDrawType.SingleBorder;
            Editor.WhitespaceColor = SystemColors.ControlDark;
            Editor.Click += editor_Click;
            Editor.TextChanged += EditorTextChanged;

            Editor.FontName = "Courier New";
            Editor.FontSize = 10;
            //
            // document
            //
            Document.Lines = new[]{ "" };
            Document.MaxUndoBufferSize = 1000;
            Document.Modified = false;
            Document.UndoStep = 0;
            //
            // CodeTab
            //
            ClientSize = new Size(680, 383);
            Controls.Add(Editor);
            DockableAreas = DockAreas.Document;
            DoubleBuffered = true;
            FormBorderStyle = FormBorderStyle.FixedSingle;
            Name = "CodeTab";
            ShowIcon = false;
            ShowInTaskbar = false;
            TabText = "[ Document ]";
            Text = "[ Document ]";
            Load += CodeTab_Load;
            ResumeLayout(false);
        }