コード例 #1
0
        /// <summary>Set up this control for Ldr script</summary>
        public static ScintillaControl ConfigLdr(this ScintillaControl sc, bool dark)
        {
            sc.ClearDocumentStyle();
            sc.IndentationGuides = Sci.EIndentView.Lookboth;
            sc.AutoIndent        = true;
            sc.TabWidth          = 4;
            sc.Indent            = 4;
            sc.CaretFore         = dark ? 0xFFffffff : 0xFF000000;
            sc.CaretPeriod       = 400;
            sc.ConvertEOLs(Sci.EEndOfLine.Lf);
            sc.EOLMode = Sci.EEndOfLine.Lf;
            sc.Property("fold", "1");
            sc.MultipleSelection         = true;
            sc.AdditionalSelectionTyping = true;
            sc.VirtualSpace = Sci.EVirtualSpace.Rectangularselection;

            Debug.Assert(LdrDark.Length == LdrLight.Length);
            sc.ApplyStyles(dark ? LdrDark : LdrLight);

            sc.MarginTypeN(0, Sci.EMarginType.Number);
            sc.MarginTypeN(1, Sci.EMarginType.Symbol);
            sc.MarginMaskN(1, unchecked ((uint)Sci.SC_MASK_FOLDERS));
            sc.MarginWidthN(0, sc.TextWidth(Sci.STYLE_LINENUMBER, "_9999"));
            sc.MarginWidthN(1, 0);

            // set marker symbol for marker type 0 - bookmark
            sc.MarkerDefine(0, Sci.SC_MARK_CIRCLE);

            //// display all margins
            //DisplayLinenumbers(TRUE);
            //SetDisplayFolding(TRUE);
            //SetDisplaySelection(TRUE);

            // Initialise UTF-8 with the ldr lexer
            sc.CodePage = Sci.SC_CP_UTF8;
            sc.Lexer    = Sci.ELexer.Ldr;
            sc.LexerLanguage("ldr");

            return(sc);
        }