Discussions related to Visual Prolog
User avatar
drspro2
VIP Member
Posts: 115
Joined: 28 Apr 2006 12:03

dark mode sciLexer

Post by drspro2 »

i managed to get it working with the new colors! works great ( and looks great ) , i could also add the line numbers in the left margin. I use the VIP -PIE example here. I am searching now how to get a left margin in the sci editor, and i am searching now how to change the color of the text in the message-form. The messageForm ( console ) is also assigned the Sci-lexer, thought i cant find yet how to change the color of that text because with the new dark background the grey text is almost invisible
pie_example2.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1483
Joined: 28 Feb 2000 0:01

Re: dark mode sciLexer

Post by Thomas Linder Puls »

styleSetFore can be used to change the text color in a message window:

Code: Select all

predicates     onShow : window::showListener. clauses     onShow(_, _CreationData) :-         MessageForm = messageForm::display(This),         MessageForm:sciLexer:styleSetFore(0, color_red),         stdio::write("This text is in red").
The text in the message window is in style 0.
Regards Thomas Linder Puls
PDC
User avatar
drspro2
VIP Member
Posts: 115
Joined: 28 Apr 2006 12:03

Re: dark mode sciLexer

Post by drspro2 »

i managed to change the font color in the message window, i am now searching if i can also determine the sci-lexer behavior for whether it sees certain tokens as variabels, the same as it does with prolog code when the token begins with an uppercase, for this metta language ( lisp alike ) it should treat tokens that begin with dollar-sign: $ as variabels ( with different color ). actually this image is a bad example because i already changed the variabels with uppercase to make use of the prolog variabel coloring
You do not have the required permissions to view the files attached to this post.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1483
Joined: 28 Feb 2000 0:01

Re: dark mode sciLexer

Post by Thomas Linder Puls »

The lexilla dll contains lexers for a large number of languages. All those lexers including the one for Visual Prolog is written in C++.

You could be lucky that there is already some language that does what you need. Notepad++ has support for many of the available languages. So you may be able to find a suitable language using that editor.

If you find one I can explain how you can utilize it in Visual Prolog code.
Regards Thomas Linder Puls
PDC