Exemplo n.º 1
0
        public void FindInFiles()
        {
            TextView view = mManager.ActiveView as TextView;

            if (view != null)
            {
                Scintilla.ScintillaControl scintilla = view.ScintillaControl;
                view.AutoSelect();
                mFindReplaceDialog.FindString = scintilla.GetSelectedText();
            }
            mFindReplaceDialog.FindInFiles();
        }
Exemplo n.º 2
0
        private void ConfigureScintillaControl(Scintilla.ScintillaControl control)
        {
            control.Configuration         = new Scintilla.Configuration.ScintillaConfig(TextPlugin.ScintillaProperties, "*.lua");
            control.ConfigurationLanguage = "lua";

            control.MarginWidthN(0, 0);
            control.MarginWidthN(1, 0);
            control.MarginWidthN(2, 0);
            control.MarginWidthN(3, 0);

            control.UseMonospaceFont(TextPlugin.ScintillaProperties.GetByKey("font.monospace"));
            control.TabWidth = 4;
        }
Exemplo n.º 3
0
        public Find(Scintilla.ScintillaControl control)
        {
            InitializeComponent();

              _scintilla = control;

              if (_scintilla.SelTextSize > 0)
              {
            textBoxFind.Text = _scintilla.SelText;
              }

              // reset
              _scintilla.GotoPos(0);
              _scintilla.SearchAnchor();
        }
Exemplo n.º 4
0
        private string ExportToHTML(Scintilla.ScintillaControl sc)
        {
            StringBuilder result = new StringBuilder();

            result.Append("<span>");


            int tabSize      = 4;
            int styleCurrent = sc.StyleAt(0);

            result.Append(String.Format("<span class=\"S{0:d}\">", styleCurrent));
            bool inStyleSpan = true;

            int lengthDoc = sc.Length;
            int column    = 0;

            for (int i = 0; i < lengthDoc; ++i)
            {
                char ch    = sc.CharAt(i);
                int  style = sc.StyleAt(i);

                if (style != styleCurrent)
                {
                    if (inStyleSpan)
                    {
                        result.Append("</span>");
                        inStyleSpan = false;
                    }
                    if (ch != '\r' && ch != '\n')
                    {                           // No need of a span for the EOL
                        result.Append(String.Format("<span class=\"S{0:d}\">", style));
                        inStyleSpan  = true;
                        styleCurrent = style;
                    }
                }
                if (ch == ' ')
                {
                    char prevCh = '\0';
                    if (column == 0)
                    {                           // At start of line, must put a &nbsp; because regular space will be collapsed
                        prevCh = ' ';
                    }
                    while (i < lengthDoc && sc.CharAt(i) == ' ')
                    {
                        if (prevCh != ' ')
                        {
                            result.Append(' ');
                        }
                        else
                        {
                            result.Append("&nbsp;");
                        }
                        prevCh = sc.CharAt(i);
                        i++;
                        column++;
                    }
                    i--;                     // the last incrementation will be done by the for loop
                }
                else if (ch == '\t')
                {
                    int ts = tabSize - (column % tabSize);
                    for (int itab = 0; itab < ts; itab++)
                    {
                        if (itab % 2 == 1)
                        {
                            result.Append(' ');
                        }
                        else
                        {
                            result.Append("&nbsp;");
                        }
                    }
                    column += ts;
                }
                else if (ch == '\r' || ch == '\n')
                {
                    if (inStyleSpan)
                    {
                        result.Append("</span>");
                        inStyleSpan = false;
                    }
                    if (ch == '\r' && sc.CharAt(i + 1) == '\n')
                    {
                        i++;                            // CR+LF line ending, skip the "extra" EOL char
                    }
                    column = 0;
                    result.Append("<br />");

                    styleCurrent = sc.StyleAt(i + 1);
                    result.Append('\n');

                    if (sc.CharAt(i + 1) != '\r' && sc.CharAt(i + 1) != '\n')
                    {
                        // We know it's the correct next style,
                        // but no (empty) span for an empty line
                        result.Append(String.Format("<span class=\"S{0:d}\">", styleCurrent));
                        inStyleSpan = true;
                    }
                }
                else
                {
                    switch (ch)
                    {
                    case '<':
                        result.Append("&lt;");
                        break;

                    case '>':
                        result.Append("&gt;");
                        break;

                    case '&':
                        result.Append("&amp;");
                        break;

                    default:
                        result.Append(ch);
                        break;
                    }
                    column++;
                }
            }

            if (inStyleSpan)
            {
                result.Append("</span>");
            }

            result.Append("</span>");

            return(result.ToString());
        }
Exemplo n.º 5
0
Arquivo: wTail.cs Projeto: kjk/kjkpub
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.scintillaControl1 = new Scintilla.ScintillaControl();
     this.btOpen = new System.Windows.Forms.Button();
     this.btClear = new System.Windows.Forms.Button();
     this.mainMenu1 = new System.Windows.Forms.MainMenu();
     this.menuItem1 = new System.Windows.Forms.MenuItem();
     this.menuFileOpen = new System.Windows.Forms.MenuItem();
     this.menuFileClose = new System.Windows.Forms.MenuItem();
     this.menuItem6 = new System.Windows.Forms.MenuItem();
     this.menuFileExit = new System.Windows.Forms.MenuItem();
     this.menuItem7 = new System.Windows.Forms.MenuItem();
     this.menuToolsClear = new System.Windows.Forms.MenuItem();
     this.menuItem3 = new System.Windows.Forms.MenuItem();
     this.menuToolsWrap = new System.Windows.Forms.MenuItem();
     this.menuToolsFont = new System.Windows.Forms.MenuItem();
     this.menuItem2 = new System.Windows.Forms.MenuItem();
     this.menuHelpAbout = new System.Windows.Forms.MenuItem();
     this.menuHelpWebsite = new System.Windows.Forms.MenuItem();
     this.btClose = new System.Windows.Forms.Button();
     this.SuspendLayout();
     //
     // scintillaControl1
     //
     this.scintillaControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
         | System.Windows.Forms.AnchorStyles.Left)
         | System.Windows.Forms.AnchorStyles.Right)));
     this.scintillaControl1.AnchorPosition = 0;
     this.scintillaControl1.BackSpaceUnIndents = false;
     this.scintillaControl1.BufferedDraw = true;
     this.scintillaControl1.CaretForeground = 0;
     this.scintillaControl1.CaretLineBackground = 65535;
     this.scintillaControl1.CaretLineVisible = false;
     this.scintillaControl1.CaretPeriod = 500;
     this.scintillaControl1.CaretWidth = 1;
     this.scintillaControl1.CodePage = 0;
     this.scintillaControl1.Configuration = null;
     this.scintillaControl1.ConfigurationLanguage = "";
     this.scintillaControl1.ControlCharSymbol = 0;
     this.scintillaControl1.CurrentPos = 0;
     this.scintillaControl1.CursorType = -1;
     this.scintillaControl1.EdgeColour = 12632256;
     this.scintillaControl1.EdgeColumn = 0;
     this.scintillaControl1.EdgeMode = 0;
     this.scintillaControl1.EndAtLastLine = true;
     this.scintillaControl1.EOLCharactersVisible = false;
     this.scintillaControl1.EOLMode = 0;
     this.scintillaControl1.focus = false;
     this.scintillaControl1.HighlightGuide = 0;
     this.scintillaControl1.HorizontalScrollBarVisible = true;
     this.scintillaControl1.Indent = 0;
     this.scintillaControl1.IndentationGuidesVisible = false;
     this.scintillaControl1.LayoutCache = 1;
     this.scintillaControl1.Lexer = 0;
     this.scintillaControl1.LexerLanguage = null;
     this.scintillaControl1.Location = new System.Drawing.Point(0, 24);
     this.scintillaControl1.MarginLeft = 1;
     this.scintillaControl1.MarginRight = 1;
     this.scintillaControl1.ModEventMask = 3959;
     this.scintillaControl1.MouseDownCaptures = true;
     this.scintillaControl1.MouseDwellTime = 10000000;
     this.scintillaControl1.Name = "scintillaControl1";
     this.scintillaControl1.Overtype = false;
     this.scintillaControl1.PrintColourMode = 0;
     this.scintillaControl1.PrintMagnification = 0;
     this.scintillaControl1.PrintWrapMode = 1;
     this.scintillaControl1.ReadOnly = false;
     this.scintillaControl1.ScrollWidth = 2000;
     this.scintillaControl1.SearchFlags = 0;
     this.scintillaControl1.SelectionEnd = 0;
     this.scintillaControl1.SelectionStart = 0;
     this.scintillaControl1.Size = new System.Drawing.Size(368, 309);
     this.scintillaControl1.Status = 0;
     this.scintillaControl1.StyleBits = 5;
     this.scintillaControl1.TabIndents = true;
     this.scintillaControl1.TabIndex = 0;
     this.scintillaControl1.TabWidth = 8;
     this.scintillaControl1.TargetEnd = 0;
     this.scintillaControl1.TargetStart = 0;
     this.scintillaControl1.UsePalette = false;
     this.scintillaControl1.UseTabs = true;
     this.scintillaControl1.VerticalScrollBarVisible = true;
     this.scintillaControl1.WhitespaceVisibleState = 0;
     this.scintillaControl1.WrapMode = 0;
     this.scintillaControl1.XOffset = 0;
     this.scintillaControl1.ZoomLevel = 0;
     //
     // btOpen
     //
     this.btOpen.Location = new System.Drawing.Point(0, 0);
     this.btOpen.Name = "btOpen";
     this.btOpen.Size = new System.Drawing.Size(48, 23);
     this.btOpen.TabIndex = 1;
     this.btOpen.Text = "Open";
     this.btOpen.Click += new System.EventHandler(this.btOpen_Click);
     //
     // btClear
     //
     this.btClear.Location = new System.Drawing.Point(48, 0);
     this.btClear.Name = "btClear";
     this.btClear.Size = new System.Drawing.Size(48, 23);
     this.btClear.TabIndex = 2;
     this.btClear.Text = "Clear";
     this.btClear.Click += new System.EventHandler(this.btClear_Click);
     //
     // mainMenu1
     //
     this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                               this.menuItem1,
                                                                               this.menuItem7,
                                                                               this.menuItem2});
     //
     // menuItem1
     //
     this.menuItem1.Index = 0;
     this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                               this.menuFileOpen,
                                                                               this.menuFileClose,
                                                                               this.menuItem6,
                                                                               this.menuFileExit});
     this.menuItem1.Text = "File";
     //
     // menuFileOpen
     //
     this.menuFileOpen.Index = 0;
     this.menuFileOpen.Text = "Open";
     this.menuFileOpen.Click += new System.EventHandler(this.menuFileOpen_Click);
     //
     // menuFileClose
     //
     this.menuFileClose.Index = 1;
     this.menuFileClose.Text = "Close";
     this.menuFileClose.Click += new System.EventHandler(this.menuFileClose_Click);
     //
     // menuItem6
     //
     this.menuItem6.Index = 2;
     this.menuItem6.Text = "-";
     //
     // menuFileExit
     //
     this.menuFileExit.Index = 3;
     this.menuFileExit.Text = "Exit";
     this.menuFileExit.Click += new System.EventHandler(this.menuFileExit_Click);
     //
     // menuItem7
     //
     this.menuItem7.Index = 1;
     this.menuItem7.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                               this.menuToolsClear,
                                                                               this.menuItem3,
                                                                               this.menuToolsWrap,
                                                                               this.menuToolsFont});
     this.menuItem7.Text = "Tools";
     //
     // menuToolsClear
     //
     this.menuToolsClear.Index = 0;
     this.menuToolsClear.Text = "Clear";
     this.menuToolsClear.Click += new System.EventHandler(this.menuItem2_Click);
     //
     // menuItem3
     //
     this.menuItem3.Index = 1;
     this.menuItem3.Text = "-";
     //
     // menuToolsWrap
     //
     this.menuToolsWrap.Index = 2;
     this.menuToolsWrap.Text = "Wrap";
     this.menuToolsWrap.Click += new System.EventHandler(this.menuToolsWrap_Click);
     //
     // menuToolsFont
     //
     this.menuToolsFont.Index = 3;
     this.menuToolsFont.Text = "Font...";
     this.menuToolsFont.Click += new System.EventHandler(this.menuToolsFont_Click);
     //
     // menuItem2
     //
     this.menuItem2.Index = 2;
     this.menuItem2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                               this.menuHelpAbout,
                                                                               this.menuHelpWebsite});
     this.menuItem2.Text = "Help";
     //
     // menuHelpAbout
     //
     this.menuHelpAbout.Index = 0;
     this.menuHelpAbout.Text = "About";
     this.menuHelpAbout.Click += new System.EventHandler(this.menuHelpAbout_Click);
     //
     // menuHelpWebsite
     //
     this.menuHelpWebsite.Index = 1;
     this.menuHelpWebsite.Text = "Visit website";
     this.menuHelpWebsite.Click += new System.EventHandler(this.menuHelpWebsite_Click);
     //
     // btClose
     //
     this.btClose.Location = new System.Drawing.Point(96, 0);
     this.btClose.Name = "btClose";
     this.btClose.Size = new System.Drawing.Size(48, 23);
     this.btClose.TabIndex = 4;
     this.btClose.Text = "Close";
     this.btClose.Click += new System.EventHandler(this.btClose_Click);
     //
     // wTailForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize = new System.Drawing.Size(368, 333);
     this.Controls.Add(this.btClose);
     this.Controls.Add(this.btClear);
     this.Controls.Add(this.btOpen);
     this.Controls.Add(this.scintillaControl1);
     this.Menu = this.mainMenu1;
     this.Name = "wTailForm";
     this.Text = "wTail";
     this.ResumeLayout(false);
 }
Exemplo n.º 6
0
 /// <summary> 
 /// Required method for Designer support - do not modify 
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.scintillaControl1 = new Scintilla.ScintillaControl();
     this.SuspendLayout();
     // 
     // scintillaControl1
     // 
     this.scintillaControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                 | System.Windows.Forms.AnchorStyles.Left)
                 | System.Windows.Forms.AnchorStyles.Right)));
     this.scintillaControl1.Anchor_ = 0;
     this.scintillaControl1.AutoCMaxHeight = 5;
     this.scintillaControl1.AutoCMaxWidth = 0;
     this.scintillaControl1.AutoCSeparator = 32;
     this.scintillaControl1.AutoCTypeSeparator = 63;
     this.scintillaControl1.CaretFore = 0;
     this.scintillaControl1.CaretLineBack = 65535;
     this.scintillaControl1.CaretLineBackAlpha = 256;
     this.scintillaControl1.CaretPeriod = 500;
     this.scintillaControl1.CaretWidth = 1;
     this.scintillaControl1.CodePage = 0;
     this.scintillaControl1.ControlCharSymbol = 0;
     this.scintillaControl1.CurrentPos = 0;
     this.scintillaControl1.Cursor_ = -1;
     this.scintillaControl1.DocPointer = 257856192;
     this.scintillaControl1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.scintillaControl1.EdgeColumn = 0;
     this.scintillaControl1.EdgeMode = 0;
     this.scintillaControl1.EOLMode = 0;
     this.scintillaControl1.HighlightGuide = 0;
     this.scintillaControl1.Indent = 0;
     this.scintillaControl1.IsAutoCAutoHide = true;
     this.scintillaControl1.IsAutoCCancelAtStart = true;
     this.scintillaControl1.IsAutoCChooseSingle = false;
     this.scintillaControl1.IsAutoCDropRestOfWord = false;
     this.scintillaControl1.IsAutoCIgnoreCase = false;
     this.scintillaControl1.IsBackSpaceUnIndents = false;
     this.scintillaControl1.IsBufferedDraw = true;
     this.scintillaControl1.IsCaretLineVisible = false;
     this.scintillaControl1.IsCaretSticky = false;
     this.scintillaControl1.IsEndAtLastLine = true;
     this.scintillaControl1.IsFocus = false;
     this.scintillaControl1.IsHScrollBar = true;
     this.scintillaControl1.IsIndentationGuides = false;
     this.scintillaControl1.IsMouseDownCaptures = true;
     this.scintillaControl1.IsOvertype = false;
     this.scintillaControl1.IsPasteConvertEndings = true;
     this.scintillaControl1.IsReadOnly = false;
     this.scintillaControl1.IsTabIndents = true;
     this.scintillaControl1.IsTwoPhaseDraw = true;
     this.scintillaControl1.IsUndoCollection = true;
     this.scintillaControl1.IsUsePalette = false;
     this.scintillaControl1.IsUseTabs = true;
     this.scintillaControl1.IsViewEOL = false;
     this.scintillaControl1.IsVScrollBar = true;
     this.scintillaControl1.LayoutCache = 1;
     this.scintillaControl1.Lexer = 0;
     this.scintillaControl1.Location = new System.Drawing.Point(0, 0);
     this.scintillaControl1.MarginLeft = 0;
     this.scintillaControl1.MarginRight = 0;
     this.scintillaControl1.ModEventMask = 8191;
     this.scintillaControl1.MouseDwellTime = 10000000;
     this.scintillaControl1.Name = "scintillaControl1";
     this.scintillaControl1.PrintMagnification = 0;
     this.scintillaControl1.PrintWrapMode = 1;
     this.scintillaControl1.ScrollWidth = 2000;
     this.scintillaControl1.SearchFlags = 0;
     this.scintillaControl1.SelAlpha = 256;
     this.scintillaControl1.SelectionEnd = 0;
     this.scintillaControl1.SelectionMode = 0;
     this.scintillaControl1.SelectionStart = 0;
     this.scintillaControl1.Size = new System.Drawing.Size(733, 694);
     this.scintillaControl1.Status = 0;
     this.scintillaControl1.StyleBits = 5;
     this.scintillaControl1.TabIndex = 0;
     this.scintillaControl1.TabWidth = 8;
     this.scintillaControl1.TargetEnd = 0;
     this.scintillaControl1.TargetStart = 0;
     this.scintillaControl1.Text = "scintillaControl1";
     this.scintillaControl1.ViewWS = 0;
     this.scintillaControl1.WrapMode = 0;
     this.scintillaControl1.WrapStartIndent = 0;
     this.scintillaControl1.WrapVisualFlags = 0;
     this.scintillaControl1.WrapVisualFlagsLocation = 0;
     this.scintillaControl1.XOffset = 0;
     this.scintillaControl1.Zoom = 0;
     this.Controls.Add(this.scintillaControl1);
     // 
     // ScriptEditor
     // 
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.Name = "ScriptEditor";
     this.Size = new System.Drawing.Size(574, 316);
     this.ResumeLayout(false);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.scintillaControl1 = new Scintilla.ScintillaControl();
     this.SuspendLayout();
     //
     // scintillaControl1
     //
     this.scintillaControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                            | System.Windows.Forms.AnchorStyles.Left)
                                                                           | System.Windows.Forms.AnchorStyles.Right)));
     this.scintillaControl1.Anchor_            = 0;
     this.scintillaControl1.AutoCMaxHeight     = 5;
     this.scintillaControl1.AutoCMaxWidth      = 0;
     this.scintillaControl1.AutoCSeparator     = 32;
     this.scintillaControl1.AutoCTypeSeparator = 63;
     this.scintillaControl1.CaretFore          = 0;
     this.scintillaControl1.CaretLineBack      = 65535;
     this.scintillaControl1.CaretLineBackAlpha = 256;
     this.scintillaControl1.CaretPeriod        = 500;
     this.scintillaControl1.CaretWidth         = 1;
     this.scintillaControl1.CodePage           = 0;
     this.scintillaControl1.ControlCharSymbol  = 0;
     this.scintillaControl1.CurrentPos         = 0;
     this.scintillaControl1.Cursor_            = -1;
     this.scintillaControl1.DocPointer         = 257856192;
     this.scintillaControl1.Dock                    = System.Windows.Forms.DockStyle.Fill;
     this.scintillaControl1.EdgeColumn              = 0;
     this.scintillaControl1.EdgeMode                = 0;
     this.scintillaControl1.EOLMode                 = 0;
     this.scintillaControl1.HighlightGuide          = 0;
     this.scintillaControl1.Indent                  = 0;
     this.scintillaControl1.IsAutoCAutoHide         = true;
     this.scintillaControl1.IsAutoCCancelAtStart    = true;
     this.scintillaControl1.IsAutoCChooseSingle     = false;
     this.scintillaControl1.IsAutoCDropRestOfWord   = false;
     this.scintillaControl1.IsAutoCIgnoreCase       = false;
     this.scintillaControl1.IsBackSpaceUnIndents    = false;
     this.scintillaControl1.IsBufferedDraw          = true;
     this.scintillaControl1.IsCaretLineVisible      = false;
     this.scintillaControl1.IsCaretSticky           = false;
     this.scintillaControl1.IsEndAtLastLine         = true;
     this.scintillaControl1.IsFocus                 = false;
     this.scintillaControl1.IsHScrollBar            = true;
     this.scintillaControl1.IsIndentationGuides     = false;
     this.scintillaControl1.IsMouseDownCaptures     = true;
     this.scintillaControl1.IsOvertype              = false;
     this.scintillaControl1.IsPasteConvertEndings   = true;
     this.scintillaControl1.IsReadOnly              = false;
     this.scintillaControl1.IsTabIndents            = true;
     this.scintillaControl1.IsTwoPhaseDraw          = true;
     this.scintillaControl1.IsUndoCollection        = true;
     this.scintillaControl1.IsUsePalette            = false;
     this.scintillaControl1.IsUseTabs               = true;
     this.scintillaControl1.IsViewEOL               = false;
     this.scintillaControl1.IsVScrollBar            = true;
     this.scintillaControl1.LayoutCache             = 1;
     this.scintillaControl1.Lexer                   = 0;
     this.scintillaControl1.Location                = new System.Drawing.Point(0, 0);
     this.scintillaControl1.MarginLeft              = 0;
     this.scintillaControl1.MarginRight             = 0;
     this.scintillaControl1.ModEventMask            = 8191;
     this.scintillaControl1.MouseDwellTime          = 10000000;
     this.scintillaControl1.Name                    = "scintillaControl1";
     this.scintillaControl1.PrintMagnification      = 0;
     this.scintillaControl1.PrintWrapMode           = 1;
     this.scintillaControl1.ScrollWidth             = 2000;
     this.scintillaControl1.SearchFlags             = 0;
     this.scintillaControl1.SelAlpha                = 256;
     this.scintillaControl1.SelectionEnd            = 0;
     this.scintillaControl1.SelectionMode           = 0;
     this.scintillaControl1.SelectionStart          = 0;
     this.scintillaControl1.Size                    = new System.Drawing.Size(733, 694);
     this.scintillaControl1.Status                  = 0;
     this.scintillaControl1.StyleBits               = 5;
     this.scintillaControl1.TabIndex                = 0;
     this.scintillaControl1.TabWidth                = 8;
     this.scintillaControl1.TargetEnd               = 0;
     this.scintillaControl1.TargetStart             = 0;
     this.scintillaControl1.Text                    = "scintillaControl1";
     this.scintillaControl1.ViewWS                  = 0;
     this.scintillaControl1.WrapMode                = 0;
     this.scintillaControl1.WrapStartIndent         = 0;
     this.scintillaControl1.WrapVisualFlags         = 0;
     this.scintillaControl1.WrapVisualFlagsLocation = 0;
     this.scintillaControl1.XOffset                 = 0;
     this.scintillaControl1.Zoom                    = 0;
     this.Controls.Add(this.scintillaControl1);
     //
     // ScriptEditor
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.Name = "ScriptEditor";
     this.Size = new System.Drawing.Size(574, 316);
     this.ResumeLayout(false);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.scintillaControl1 = new Scintilla.ScintillaControl();
     this.btOpen            = new System.Windows.Forms.Button();
     this.btClear           = new System.Windows.Forms.Button();
     this.mainMenu1         = new System.Windows.Forms.MainMenu();
     this.menuItem1         = new System.Windows.Forms.MenuItem();
     this.menuFileOpen      = new System.Windows.Forms.MenuItem();
     this.menuFileClose     = new System.Windows.Forms.MenuItem();
     this.menuItem6         = new System.Windows.Forms.MenuItem();
     this.menuFileExit      = new System.Windows.Forms.MenuItem();
     this.menuItem7         = new System.Windows.Forms.MenuItem();
     this.menuToolsClear    = new System.Windows.Forms.MenuItem();
     this.menuItem3         = new System.Windows.Forms.MenuItem();
     this.menuToolsWrap     = new System.Windows.Forms.MenuItem();
     this.menuToolsFont     = new System.Windows.Forms.MenuItem();
     this.menuItem2         = new System.Windows.Forms.MenuItem();
     this.menuHelpAbout     = new System.Windows.Forms.MenuItem();
     this.menuHelpWebsite   = new System.Windows.Forms.MenuItem();
     this.btClose           = new System.Windows.Forms.Button();
     this.SuspendLayout();
     //
     // scintillaControl1
     //
     this.scintillaControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                            | System.Windows.Forms.AnchorStyles.Left)
                                                                           | System.Windows.Forms.AnchorStyles.Right)));
     this.scintillaControl1.AnchorPosition        = 0;
     this.scintillaControl1.BackSpaceUnIndents    = false;
     this.scintillaControl1.BufferedDraw          = true;
     this.scintillaControl1.CaretForeground       = 0;
     this.scintillaControl1.CaretLineBackground   = 65535;
     this.scintillaControl1.CaretLineVisible      = false;
     this.scintillaControl1.CaretPeriod           = 500;
     this.scintillaControl1.CaretWidth            = 1;
     this.scintillaControl1.CodePage              = 0;
     this.scintillaControl1.Configuration         = null;
     this.scintillaControl1.ConfigurationLanguage = "";
     this.scintillaControl1.ControlCharSymbol     = 0;
     this.scintillaControl1.CurrentPos            = 0;
     this.scintillaControl1.CursorType            = -1;
     this.scintillaControl1.EdgeColour            = 12632256;
     this.scintillaControl1.EdgeColumn            = 0;
     this.scintillaControl1.EdgeMode              = 0;
     this.scintillaControl1.EndAtLastLine         = true;
     this.scintillaControl1.EOLCharactersVisible  = false;
     this.scintillaControl1.EOLMode                    = 0;
     this.scintillaControl1.focus                      = false;
     this.scintillaControl1.HighlightGuide             = 0;
     this.scintillaControl1.HorizontalScrollBarVisible = true;
     this.scintillaControl1.Indent                     = 0;
     this.scintillaControl1.IndentationGuidesVisible   = false;
     this.scintillaControl1.LayoutCache                = 1;
     this.scintillaControl1.Lexer                      = 0;
     this.scintillaControl1.LexerLanguage              = null;
     this.scintillaControl1.Location                   = new System.Drawing.Point(0, 24);
     this.scintillaControl1.MarginLeft                 = 1;
     this.scintillaControl1.MarginRight                = 1;
     this.scintillaControl1.ModEventMask               = 3959;
     this.scintillaControl1.MouseDownCaptures          = true;
     this.scintillaControl1.MouseDwellTime             = 10000000;
     this.scintillaControl1.Name                     = "scintillaControl1";
     this.scintillaControl1.Overtype                 = false;
     this.scintillaControl1.PrintColourMode          = 0;
     this.scintillaControl1.PrintMagnification       = 0;
     this.scintillaControl1.PrintWrapMode            = 1;
     this.scintillaControl1.ReadOnly                 = false;
     this.scintillaControl1.ScrollWidth              = 2000;
     this.scintillaControl1.SearchFlags              = 0;
     this.scintillaControl1.SelectionEnd             = 0;
     this.scintillaControl1.SelectionStart           = 0;
     this.scintillaControl1.Size                     = new System.Drawing.Size(368, 309);
     this.scintillaControl1.Status                   = 0;
     this.scintillaControl1.StyleBits                = 5;
     this.scintillaControl1.TabIndents               = true;
     this.scintillaControl1.TabIndex                 = 0;
     this.scintillaControl1.TabWidth                 = 8;
     this.scintillaControl1.TargetEnd                = 0;
     this.scintillaControl1.TargetStart              = 0;
     this.scintillaControl1.UsePalette               = false;
     this.scintillaControl1.UseTabs                  = true;
     this.scintillaControl1.VerticalScrollBarVisible = true;
     this.scintillaControl1.WhitespaceVisibleState   = 0;
     this.scintillaControl1.WrapMode                 = 0;
     this.scintillaControl1.XOffset                  = 0;
     this.scintillaControl1.ZoomLevel                = 0;
     //
     // btOpen
     //
     this.btOpen.Location = new System.Drawing.Point(0, 0);
     this.btOpen.Name     = "btOpen";
     this.btOpen.Size     = new System.Drawing.Size(48, 23);
     this.btOpen.TabIndex = 1;
     this.btOpen.Text     = "Open";
     this.btOpen.Click   += new System.EventHandler(this.btOpen_Click);
     //
     // btClear
     //
     this.btClear.Location = new System.Drawing.Point(48, 0);
     this.btClear.Name     = "btClear";
     this.btClear.Size     = new System.Drawing.Size(48, 23);
     this.btClear.TabIndex = 2;
     this.btClear.Text     = "Clear";
     this.btClear.Click   += new System.EventHandler(this.btClear_Click);
     //
     // mainMenu1
     //
     this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuItem1,
         this.menuItem7,
         this.menuItem2
     });
     //
     // menuItem1
     //
     this.menuItem1.Index = 0;
     this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuFileOpen,
         this.menuFileClose,
         this.menuItem6,
         this.menuFileExit
     });
     this.menuItem1.Text = "File";
     //
     // menuFileOpen
     //
     this.menuFileOpen.Index  = 0;
     this.menuFileOpen.Text   = "Open";
     this.menuFileOpen.Click += new System.EventHandler(this.menuFileOpen_Click);
     //
     // menuFileClose
     //
     this.menuFileClose.Index  = 1;
     this.menuFileClose.Text   = "Close";
     this.menuFileClose.Click += new System.EventHandler(this.menuFileClose_Click);
     //
     // menuItem6
     //
     this.menuItem6.Index = 2;
     this.menuItem6.Text  = "-";
     //
     // menuFileExit
     //
     this.menuFileExit.Index  = 3;
     this.menuFileExit.Text   = "Exit";
     this.menuFileExit.Click += new System.EventHandler(this.menuFileExit_Click);
     //
     // menuItem7
     //
     this.menuItem7.Index = 1;
     this.menuItem7.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuToolsClear,
         this.menuItem3,
         this.menuToolsWrap,
         this.menuToolsFont
     });
     this.menuItem7.Text = "Tools";
     //
     // menuToolsClear
     //
     this.menuToolsClear.Index  = 0;
     this.menuToolsClear.Text   = "Clear";
     this.menuToolsClear.Click += new System.EventHandler(this.menuItem2_Click);
     //
     // menuItem3
     //
     this.menuItem3.Index = 1;
     this.menuItem3.Text  = "-";
     //
     // menuToolsWrap
     //
     this.menuToolsWrap.Index  = 2;
     this.menuToolsWrap.Text   = "Wrap";
     this.menuToolsWrap.Click += new System.EventHandler(this.menuToolsWrap_Click);
     //
     // menuToolsFont
     //
     this.menuToolsFont.Index  = 3;
     this.menuToolsFont.Text   = "Font...";
     this.menuToolsFont.Click += new System.EventHandler(this.menuToolsFont_Click);
     //
     // menuItem2
     //
     this.menuItem2.Index = 2;
     this.menuItem2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuHelpAbout,
         this.menuHelpWebsite
     });
     this.menuItem2.Text = "Help";
     //
     // menuHelpAbout
     //
     this.menuHelpAbout.Index  = 0;
     this.menuHelpAbout.Text   = "About";
     this.menuHelpAbout.Click += new System.EventHandler(this.menuHelpAbout_Click);
     //
     // menuHelpWebsite
     //
     this.menuHelpWebsite.Index  = 1;
     this.menuHelpWebsite.Text   = "Visit website";
     this.menuHelpWebsite.Click += new System.EventHandler(this.menuHelpWebsite_Click);
     //
     // btClose
     //
     this.btClose.Location = new System.Drawing.Point(96, 0);
     this.btClose.Name     = "btClose";
     this.btClose.Size     = new System.Drawing.Size(48, 23);
     this.btClose.TabIndex = 4;
     this.btClose.Text     = "Close";
     this.btClose.Click   += new System.EventHandler(this.btClose_Click);
     //
     // wTailForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(368, 333);
     this.Controls.Add(this.btClose);
     this.Controls.Add(this.btClear);
     this.Controls.Add(this.btOpen);
     this.Controls.Add(this.scintillaControl1);
     this.Menu = this.mainMenu1;
     this.Name = "wTailForm";
     this.Text = "wTail";
     this.ResumeLayout(false);
 }
Exemplo n.º 9
0
        public Tab(XabslDocument doc, Control parent, string xabslStyleFile)
        {
            this.doc = doc;
              this.view = new Scintilla.ScintillaControl();
              this._parent = parent;

              backOptions = new List<string>();
              forwardOptions = new List<string>();

              wasSaved = true;

              try
              {
            Scintilla.Configuration.ConfigurationUtility cu = new Scintilla.Configuration.ConfigurationUtility(GetType().Module.Assembly);
            Scintilla.Configuration.Scintilla conf = (Scintilla.Configuration.Scintilla)cu.LoadConfiguration(
              xabslStyleFile);

            view.Configuration = conf;
            view.ConfigurationLanguage = "xabsl";

            // show line-numbers
            view.SetMarginWidthN(0, 30);
            // no codefolding yet
            view.SetMarginWidthN(1, 0);
            // tabs with spaces and width of 2
            view.TabWidth = 2;
            view.IsUseTabs = false;
            // indent
            view.Indent = 2;
            view.IsIndentationGuides = true;

            // don't use these keys
            view.AddIgnoredKey(Shortcut.CtrlO);
            view.AddIgnoredKey(Shortcut.CtrlS);
            view.AddIgnoredKey(Shortcut.F5);
            view.AddIgnoredKey(Keys.Space, Keys.Control);
            view.AddIgnoredKey(Shortcut.CtrlZ);
            view.AddIgnoredKey(Shortcut.CtrlY);
            view.AddIgnoredKey(Shortcut.CtrlB);
            view.AddIgnoredKey(Shortcut.CtrlF);
            view.AddIgnoredKey(Shortcut.CtrlShiftF);
            view.AddIgnoredKey(Shortcut.CtrlN);
            view.AddIgnoredKey(Shortcut.CtrlI);
            view.AddIgnoredKey(Shortcut.CtrlT);
            view.AddIgnoredKey(Shortcut.CtrlW);
            view.AddIgnoredKey(Shortcut.Ctrl7);
            view.AddIgnoredKey(Shortcut.Ctrl8);

            view.AddIgnoredKey(Shortcut.F6);
            view.AddIgnoredKey(Shortcut.F7);
            view.AddIgnoredKey(Shortcut.F8);
            view.AddIgnoredKey(Shortcut.F9);

            // autocompletion
            view.AutoCSeparator = (int)'\n';
            view.IsAutoCGetAutoHide = false;
            view.IsAutoCGetIgnoreCase = true;

            // line wrap
            view.WrapMode = (int)Scintilla.Enums.Wrap.word;
            view.WrapVisualFlags = (int)Scintilla.Enums.WrapVisualFlag.end;
              }
              catch (Exception e)
              {
            ExceptionDialog.ShowError(e);
              }

              _parent.Controls.Clear();
              _parent.Controls.Add(view);
              view.Dock = DockStyle.Fill;
        }