Results 1 to 4 of 4

Thread: I need help with scintilla!!

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2020
    Posts
    63

    Question I need help with scintilla!!

    Hello. Could someone help me to integrate highlights in the editor? With personalized words and different colors.

    I have tried to look at the documentation and I have found that they do it through *.hilighter files, I have found some of these files but as .bin in a repository "https://github.com/Planet-Source-Code/stewart-ceditxp -version-4-9-9__1-66207/tree/master/cx/highlighters" but they don't work for me. Any help is greatly appreciated.

    also if there is any more complete tutorial, I'm interested. thanks!

  2. #2

  3. #3
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,294

    Re: I need help with scintilla!!

    You don’t necessarily need to use the highlighter files, you can code the settings directly in from vb which makes it easier to experiment with.

    Whatever your highlighting though you need to set the proper lexer which is written in c++ and compiled into scintinilla. These can be optionally compiled in so not every dll will have all of them. The lexer is what understands the rules of the programming language like what is a comment etc.

    Here is an example of manually applying the settings:
    https://github.com/dzzie/YaraWorkBen...neral.bas#L354

    Some typical lexers are
    Code:
    Enum sci_lexers
        SCLEX_NONE = 0
        SCLEX_CPP = 3
        SCLEX_HTML = 4
        SCLEX_XML = 5
        SCLEX_SQL = 7
        SCLEX_VB = 8
        SCLEX_Asasm = 9
        SCLEX_ASM = 34
        SCLEX_CPPNOCASE = 35
        SCLEX_PHPSCRIPT = 69
    End Enum
    Last edited by dz32; Jul 10th, 2022 at 08:10 AM.

  4. #4
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: I need help with scintilla!!

    Quote Originally Posted by dz32 View Post
    The lexer is what understands the rules of the programming language like what is a comment etc.
    Just want to point something out that may not be specific to scintilla as I know nothing about it, but as something to know in general.

    A lexer's responsibility is typically to break up a body of text into tokens. You can do some language specific processing here but it's usually very minimal. The grammar of a programming language is actually the responsibility of the parser processing the tokens produced by the lexer. Left to right recursive descent parsers are the most popular types of parsers and the language rules are typically recognized by these algorithms. Now I don't know anything about scintilla as I've said so maybe they do a lot of language processing in the lexxing stage I don't know. But in general, a lexer should not be described as the part that recognizes the rules of a programming language. Just wanted to point that out.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width