Discussions related to Visual Prolog
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

Delayed appearance of styles in a Scilex control

Unread post by Ferenc Nagy »

Hi,
I am still struggling with Scilex controls.
The message window has been opened and the styles were defined in the showListener of the message window. The message window was displayed before writing the time stamp.
The color scheme changed but not immediately.
See:
http://kepfeltoltes.hu/141205/delayed_a ... es.hu_.png
Here you can see that the change from Visual Prolog syntax coloring switched to my style definitions later than I defined the styles.
Who can help me or redirect to a Scilex forum?
TIA, Regards,
Frank Nagy
User avatar
Thomas Linder Puls
VIP Member
Posts: 1194
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

sciLexer is the Scintilla editor with lexers for various programming languages (e.g. Visual Prolog), see http://www.scintilla.org/.

There are two incompatible ways to style text in the scintilla editor:
  • using a lexer for implicit/automatic styling
  • using explict styling
Styling of programming languages (e.g. Visual Prolog) is performed implicit using a lexer. When a lexer is activated it is automatically invoked on the text in the editor, and re-invoked when the text changes.

So if a lexer is active it will override any explicit styling.

It seems that this is what happens for you.

So the question is why do you have a lexer active?

The Visual Prolog lexer (and it does in deed look like that is the one you have active) is either activated by lexerDefault_visualProlog or by calling lexerDefault_extension with one of the Visual Prolog extensions (defined in fileExtension_visualProlog).
Regards Thomas Linder Puls
PDC
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

Unread post by Ferenc Nagy »

Thomas,
Thank you for you advices.
As soon as I have omitted

Code: Select all

used_lexer:lexerDefault_visualProlog(),
from the creation of my lexer window then the problem has disappeared.
Now the main message windows and the later defined report window are colored same way as I wanted.
(If I tried with e.g.

Code: Select all

lexerDefault_cpp
then the difference did not disappear, only the numbers, strings and other syntax elements looked differently.)
TIA, Regards,
Frank Nagy
Post Reply