예제 #1
0
        private void SetScintillaToCurrentOptions(DocumentForm doc)
        {
            // Turn on line numbers?
            if (lineNumbersToolStripMenuItem.Checked)
                doc.Scintilla.Margins.Margin0.Width = LINE_NUMBERS_MARGIN_WIDTH;
            else
                doc.Scintilla.Margins.Margin0.Width = 0;

            // Turn on white space?
            if (whitespaceSymbolsToolStripMenuItem.Checked)
                doc.Scintilla.Whitespace.Mode = WhitespaceMode.VisibleAlways;
            else
                doc.Scintilla.Whitespace.Mode = WhitespaceMode.Invisible;

            // Turn on word wrap?
            if (wordWrapToolStripMenuItem.Checked)
                doc.Scintilla.LineWrapping.Mode = LineWrappingMode.Word;
            else
                doc.Scintilla.LineWrapping.Mode = LineWrappingMode.None;

            // Show EOL?
            //doc.Scintilla.EndOfLine.IsVisible = endOfLineToolStripMenuItem.Checked;

            // Set the zoom
            doc.Scintilla.Zoom = _zoomLevel;
        }
예제 #2
0
        private DocumentForm NewDocument(string ext)
        {
            DocumentForm doc = new DocumentForm();
            //SetScintillaToCurrentOptions(doc);
            doc.Text = String.Format(CultureInfo.CurrentCulture, "{0}{1}." + ext, NEW_DOCUMENT_TEXT, ++_newDocumentCount);

            setStatusMessages(doc.Text);

            doc.Show(dockPanel);

            return doc;
        }
예제 #3
0
        private DocumentForm OpenFile(string filePath)
        {
            DocumentForm doc = new DocumentForm();

            SetScintillaToCurrentOptions(doc);

            doc.Scintilla.Text = File.ReadAllText(filePath);
            doc.Scintilla.UndoRedo.EmptyUndoBuffer();
            doc.Scintilla.Modified = false;
            doc.Text = Path.GetFileName(filePath);
            doc.FilePath = filePath;

            setStatusMessages(doc.Text);

            doc.Show(dockPanel);

            return doc;
        }
예제 #4
0
        private DocumentForm NewDocument()
        {
            DocumentForm doc = new DocumentForm();
            SetScintillaToCurrentOptions(doc);
            doc.Text = String.Format(CultureInfo.CurrentCulture, "{0}{1}", NEW_DOCUMENT_TEXT, ++_newDocumentCount);

            setStatusMessages(doc.Text);

            doc.Show(dockPanel);
            // TODO Implement
            //toolIncremental.Searcher.Scintilla = doc.Scintilla;
            return doc;
        }