* Warning * The format is completely revamped

Now it is just Include xControl.ew

 

This will allow me to add new controls without each one requiring an include statement in the main file.

 

 

Function: SYN = xControl( Syntax, “”, Parent, x, y, cx, cy, style, exStyle )

 

Creates a new syntax highlighter and returns it's ID. The extra fields colored in red are not used in this control but needed for uniformity.

 

Note: This is a subclassed RichEdit control so if you need hook into some of its events, please be careful with the callbacks. Also this control is pre-setup with little to no artificial limit on file size and also unlimited undo/redo capabilities

 

Function: ListID = synAddWords( SYN, sequence WordList, atom Color )

 

Adds WordList to the syntax highlighter.  When the words are encountered, it will highlight them in the appropriate color. The ID of the WordList is returned to be used with other functions / Procedures.

 

Note:  Three wordlists are automatically added when the control is created.  First is Syn_Comment which defaults to Euphoria standard “--“, second is Syn_Quotes (either ‘ or “), and third is SynDefText (No text).  If you are using this to create a Euphoria highlighter no need to worry about these two.  Just add word lists.

 

Procedure: synModifyWords( SYN, integer ListID, object WordList )

 

Replaces older wordlist ListID with new WordList.  Especially useful to change the default Syn_Comment.  So changing Syn_Comment to a Perl syntax would look like:

 

synModifyWords( SYN, ListID, “#” )

 

Note: Block comments are not currently supported and only the first word in Syn_Comment is currently used.  Which should be ok as I cannot think of any language which uses two different symbols for single line comments.

 

Note: Changing Syn_Quotes and Syn_DefText while technically possible (and will not generate an error) is fruitless.  The quotes are hard coded into the control so resetting this will not change anything.  Mainly the only use for Syn_Quotes and Syn_DefText is for changing the colors.

 

Procedure: synSetColor( SYN, integer ListID, atom Color )

 

Allows for color changes to an existing wordlist or the defaults (Syn_Comment, Syn_Quotes, and Syn_DefText).

 

Procedure: synSetBckColor( SYN, atom Color )

 

Routine to change the Highlighters background color.

 

Procedure: synReset( SYN )

 

Removes all existing wordlists and reinstates the defaults (Syn_Comment and Syn_Quotes) and resets these to their original default colors as well.

 

Procedure: synSetFont( SYN, sequence FaceName, integer Point )

 

Do not use Win32Libs default routine to set the font.  Use this one instead.  Needed because of the way I had to code the control.  Sets the control to FaceName with the size of Point.

 

Version 1.0

 

Initial release

------

 

Enjoy!

Any questions, comments, suggestions, (ack bugs!) are welcome:

< eunexus@yahoo.com >