Results 1 to 8 of 8

Thread: How to do syntax highlighting?.

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2009
    Posts
    36

    How to do syntax highlighting?.

    Ok, So i am building a code editor for a new Multi-Player modification thats being coded (IV-MP), And i was looking into making the syntax of the code highlight, Like it dose on this picture:




    The code is 'Squirrel', But i totally have no clue on how to make it highlight like in those pictures, And all the code would be in a large Rich textbox.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: How to do syntax highlighting?.

    There's a submission in the VB.NET CodeBank forum dedicated to syntax highlighting.

    Alternatively, you might like to check out SharpDevelop, which is an open-source .NET IDE. You can make use of the code editor from that if you want and integrate it into your own app.

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2009
    Posts
    36

    Re: How to do syntax highlighting?.

    Ok so i have found this: http://pietschsoft.com/post/2005/05/...x-control.aspx

    But how would i use it?

  4. #4

    Thread Starter
    Member
    Join Date
    Nov 2009
    Posts
    36

    Re: How to do syntax highlighting?.

    /bump

  5. #5
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: How to do syntax highlighting?.

    In my experience, all RichTextBox syntax highlighting I've ever found was flawed in one way or another (often in every way). It is usually much too slow.

    There are very good third party code editors available, but they are all expensive. I have yet to find a good free alternative. If money is no objection then you may want to take a look at any of the ones I tried in the past; I think the companies that sold them were called QuantumWhale and ActiPro. I tried the trial version of both and they worked fine, basically exactly the same as the Visual Studio editor, but were too expensive for me.

    I see jmcilhinney mentioned SharpDevelop. I've heard about the open source IDE but didn't know you could use the editor from it too. Is it easily customizable, can you tell it which keywords and constructs to look for and what color to give them?

  6. #6
    Hyperactive Member BadgerBadger's Avatar
    Join Date
    Aug 2009
    Location
    Wales
    Posts
    382

    Re: How to do syntax highlighting?.

    Sorry I can't be much help here, but I'm just curious:
    Isn't there an official code editor already available for it?

    Judging from personal experience, I would suspect there is an official IDE for IV-MP, just as there is for SA-MP.
    I would recommend using an official editor for the job since they will include syntax highlighting for all the functions of the game and perhaps a list of them directly available in the IDE (as did Pawno, the official IDE for SA-MP), but hey, I admire your goal.

    Best of luck!
    "The only thing that interferes with my learning is my education."

  7. #7

    Thread Starter
    Member
    Join Date
    Nov 2009
    Posts
    36

    Re: How to do syntax highlighting?.

    Hey, It's just there isn't one out, Since there is just a plugin for VS2008 i wanted to make a custom just for IV:MP :/

  8. #8
    Fanatic Member
    Join Date
    Mar 2009
    Posts
    739

    Re: How to do syntax highlighting?.

    Take a look at something called "Editawy" (just google for that word)

    That's a free editor with source code that you're allowed to use any way you want. It already has many programming languages built in and you can add more or change the existing ones to match your requirements.

    In my case I took it apart and just used the dll on which it's based. That dll is a text box a bit like the RT box except you declare it in code instead of dragging it on to your form.

    I tried doing my project with the RT box first but as the document gets bigger it gets slower. So I tried just highlighting the visible text and redoing that as the display changed and that worked quite well but was still a bit lumpy. That's when I found the editawy stuff and realized I'd wasted a week struggling with the RT box.

    Using the editawy textbox dll makes highlighting instant. Really good bit of kit to have in your toolbox.

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