Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1461

Scintilla Source Code editor OCX for VB

$
0
0
I noticed the board didn't have much on the Scintilla source code editor so wanted to make sure a copy of this got saved.

Scintilla is a source code editor component that includes source code highlighting, code folding, line numbering, bookmarks, built in intellisense etc. It is a great control if you want to create a source code editor or debugger UI.

Name:  screenshot.jpg
Views: 119
Size:  14.5 KB

Its a free component written in C and builds as SciLexer.dll. You can download the source files here:

https://www.scintilla.org/

The source attached here, scivb2.ocx, is a vb6 control that makes using it quite easy. This is an update to Stewarts great scivb.ocx control that is part of his cEditXP souce code editor.

http://www.planet-source-code.com/vb...66207&lngWId=1

I spent some time inside of it and adapted it for what I needed so I could use it as a debugger UI You can see an example of it in action here:

https://www.youtube.com/watch?v=nSr1-OugQ1M

I have attached a copy of the ocx source. I have been using this for several years now and has proven stable. Any updates will be in the git repo below.

https://github.com/dzzie/scivb2

public methods:
Code:


Public Property FoldComment() As Boolean
Public Property FoldAtElse() As Boolean
Public Property FoldMarker() As FoldingStyle
Public Property Folding() As Boolean    'If true folding will be automatically handled.
Public Property DisplayCallTips() As Boolean  'If this is set to true then calltips will be displayed.  To use this you must also use <B>LoadAPIFile</b> to load an external API file which contains simple instructions to the editor on what calltips to display.
Public Property SelFore() As OLE_COLOR  'The allows you to control the fore color of the selected color.
Public Property SelBack() As OLE_COLOR  'This allow's you to set the backcolor for selected text.
Public Property WordWrap() As Boolean 'If set to true the document will wrap lines which are longer than itself.  If false then it will dsiplay normally.
Public Property ShowFlags() As Boolean  'If this is true the second gutter will be displayed and Flags/Bookmarks will be displayed.
Public Property isDirty() As Boolean  'This is a read only property.  It allows you to get the modified status of the Scintilla window.
Public Property ReadOnly() As Boolean  'This property allows you to set the readonly status of Scintilla.  When in readonly you can scroll the document, but no editing can be done.
Public Property LineNumbers() As Boolean    'If this is set to true then the first gutter will be visible and display line numbers.  If this is false then the first gutter will remain hidden.
Public Property ContextMenu() As Boolean    'If set to true then the default Scintilla context menu will be displayed when a user right clicks on the window.  If this is set to false then no context menu will be displayed.  If you are utilizing a customer context menu then this should be set to false.
Public Property AutoCompleteString() As String  'This store's the list which autocomplete will use.  Each word needs to be seperated by a space.
Public Property IndentWidth() As Long  'This controls the number of spaces Tab will indent.  IndentWidth only applies if <B>TabIndents</b> is set to false.
Public Property BackSpaceUnIndents() As Boolean 'If tabindents is set to false, and BackSpaceUnIndents is set to true then the backspaceunindents will remove the same number of spaces as tab inserts.  If it's set to false then it will work normally.
Public Property UseTabIndents() As Boolean 'If this is true tab inserts indent characters.  If it is set to false tab will insert spaces.
Public Property useTabs() As Boolean
Public Property ShowIndentationGuide() As Boolean  'If true indention guide's will be displayed.
Public Property MaintainIndentation() As Boolean 'If this is set to true the editor will automatically keep the previous line's indentation.
Public Property HighLightActiveLine() As Boolean    'When set to true the active line will be highlighted using the color selected from LineBackColor.
Public Property ActiveLineBackColor() As OLE_COLOR    'Allows you to control the backcolor of the active line.
Public Property SelText() As String 'Allows you to get and set the seltext of the scintilla window.
Public Property Text() As String    'Allows you to get and set the text of the scintilla window.
Public Property SelLength() As Long
Public Property SelEnd() As Long
Public Property SelStart() As Long
Public Property codePage() As SC_CODETYPE
Property TotalLines() As Long
Property VisibleLines() As Long
Property FirstVisibleLine() As Long
Public Property AutoCloseQuotes() As Boolean    'When set to true quotes will automatically be closed.
Public Property AutoCloseBraces() As Boolean    'When this is set to true braces <B>{, [, (</b> will be closed automatically.
Property Version() As String
Public Property currentHighlighter() As String
Property sciHWND() As Long
Friend Property Let ReplaceFormActive(x As Boolean)
Function isMouseOverCallTip() As Boolean
Sub LockEditor(Optional locked As Boolean = True)
Public Function WordUnderMouse(pos As Long, Optional ignoreWhiteSpace As Boolean = False) As String
Public Sub ShowGoto()
Public Sub ShowAbout()
Public Function ShowFindReplace() As Object
Public Function FindNext(Optional wrap As Boolean = False) As Long
Public Function Find(sSearch As String, _
Public Function FindAll(sSearch As String, _
Public Function ReplaceAll(strSearchFor As String, _
Public Function ReplaceText(strSearchFor As String, _
Public Sub MarkAll(strFind As String)
Public Sub SetMarker(iLine As Long, Optional iMarkerNum As Long = 2)
Public Sub DeleteAllMarkers(Optional marknum As Long = 2)
Public Sub PrevMarker(lline As Long, Optional marknum As Long = 2)
Public Sub NextMarker(lline As Long, Optional marknum As Long = 2)
Public Sub DeleteMarker(iLine As Long, Optional marknum As Long = 2)
Public Sub ToggleMarker(Optional line As Long = -1)
Public Sub FoldAll()
Public Sub ShowCallTip(strVal As String)
Public Sub StopCallTip()
Public Function AddCallTip(functionPrototype As String)
Public Function LoadCallTips(strFile As String) As Long
Public Function LoadFile(strFile As String) As Boolean
Public Function SaveFile(strFile As String) As Boolean
Public Function PreviousWord() As String
Public Function CurrentWord() As String
Public Sub ShowAutoComplete(strVal As String)
Public Function GetCaretInLine() As Long
Public Function CurrentLine() As Long
Public Sub SetCurrentPosition(lval As Long)
Public Function PositionFromLine(lline As Long) As Long
Public Sub ClearUndoBuffer()
Public Function SelectLine() As Long
Public Function SelectAll() As Long
Public Function Paste() As Long
Public Function Copy() As Long
Public Function Cut() As Long
Public Function Undo() As Long
Public Function Redo() As Long
Public Function SetFocus() As Long
Public Function GotoCol(Column As Long) As Long
Public Sub GotoLineColumn(iLine As Long, iCol As Long)
Public Function GotoLine(line As Long) As Long
Public Function GetLineText(ByVal lline As Long) As String
Public Function FileExists(strFile As String) As Boolean
Public Function FolderExists(path) As Boolean
Sub GotoLineCentered(ByVal line As Long, Optional selected As Boolean = True)
Function hilightWord(sSearch As String, Optional color As Long = 0, Optional compare As VbCompareMethod = vbTextCompare) As Long
Sub hilightClear()
Public Sub UncommentBlock()
Public Sub CommentBlock()
Public Function ExportToHTML(filePath As String) As Boolean
Public Function LoadHighlightersDir(dirPath As String) As Long
Public Function HighlighterForExtension(fPath As String) As String
Public Function LoadHighlighter(filePath As String, Optional andSetActive As Boolean = True) As Boolean
Public Function SetHighlighter(langName As String) As Boolean

Attached Images
 
Attached Files

Viewing all articles
Browse latest Browse all 1461

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>