Author Topic: Colored text on Build and Output Windows  (Read 14767 times)

heedless

  • Community Member
  • Posts: 24
  • Hero Points: 1
Colored text on Build and Output Windows
« on: September 10, 2006, 03:07:21 PM »
Hi.

Is it possible to get colored text in Build/Output Windows?

Our compile script colorizes text according to the type of error/warning we get.
It uses standard unix console control codes (ESC [ , etc).
Is it possible to have the color codes parsed and displayed correctly in Slickedit?

Thanks.

Ding Zhaojie

  • Senior Community Member
  • Posts: 194
  • Hero Points: 37
Re: Colored text on Build and Output Windows
« Reply #1 on: September 11, 2006, 03:37:40 AM »
Seems the build window in Slickedit is not a standard terminal :(. But you can write a terminal parser with slick-c to process the outputs in buffer.

heedless

  • Community Member
  • Posts: 24
  • Hero Points: 1
Re: Colored text on Build and Output Windows
« Reply #2 on: September 13, 2006, 10:31:29 AM »
Do you know what functions I should use to colorize text in slickedit's Output Window?

Is this even possible?
(i.e. does the output window support a "Rich Format"?)

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6862
  • Hero Points: 528
Re: Colored text on Build and Output Windows
« Reply #3 on: September 13, 2006, 05:47:42 PM »
I think this could be written as a macro as long as the escape sequences did not contain the following binary bytes: 1 (internal use), 10, 13, and 7 (beep).  You can mark up the text with _StreamMarkerAdd().  Use search() to search for the escape sequences.  The slighly tricky part is that you'll need to keep a bookmark (markid=_alloc_selection('B');_select_char(markid);) for where to start searching from next time. The 'b' option doesn't seem to be documented.  A bookmark only has a start where a normal selection has a start and an end.  In addition, you need a timer which uses p_LastModified to determine if the file change since the last time.  See, I told you this one is a bit of work.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Colored text on Build and Output Windows
« Reply #4 on: September 14, 2006, 03:27:15 PM »
Or another possibilty: define a lexer for extension 'process'. (Tools->Options/File Ext. Setup -> New)
I'm using that to visualize all the 'Error' / 'Warning' / 'Compiling' / etc. stuff

HS2

sdayts

  • Community Member
  • Posts: 42
  • Hero Points: 5
Re: Colored text on Build and Output Windows
« Reply #5 on: September 22, 2006, 04:20:39 PM »
HS2,

This is a very useful trick!

Thank you.
Sergey

Ding Zhaojie

  • Senior Community Member
  • Posts: 194
  • Hero Points: 37
Re: Colored text on Build and Output Windows
« Reply #6 on: September 24, 2006, 07:53:24 AM »
Or another possibilty: define a lexer for extension 'process'. (Tools->Options/File Ext. Setup -> New)
I'm using that to visualize all the 'Error' / 'Warning' / 'Compiling' / etc. stuff

HS2
Cool! Thanks, now my build window is colorful. :D

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Colored text on Build and Output Windows
« Reply #7 on: September 24, 2006, 01:25:33 PM »
Hello Ding,

seems that you are using Windows (-> 'cygdrive'), right ?
If so, which font do you use ?
Looks great ! Is it an converted one from Linux ?
Did that once for (Misc-fixed)6x13,7x13,8x13 but unfortunately the 'special chars' are not correct and I only could create (obvioulsy incomplete) *.fon files.

HS2

PS: It's funny - a short time ago I was busy w/ similar Linux-I2C stuff too :) Good luck !

Ding Zhaojie

  • Senior Community Member
  • Posts: 194
  • Hero Points: 37
Re: Colored text on Build and Output Windows
« Reply #8 on: September 24, 2006, 04:02:08 PM »
Hello Ding,

seems that you are using Windows (-> 'cygdrive'), right ?
If so, which font do you use ?
Looks great ! Is it an converted one from Linux ?
Did that once for (Misc-fixed)6x13,7x13,8x13 but unfortunately the 'special chars' are not correct and I only could create (obvioulsy incomplete) *.fon files.

HS2

PS: It's funny - a short time ago I was busy w/ similar Linux-I2C stuff too :) Good luck !

Hi, yes I'm using Windows. Mostly because the Slickedit for Linux can not input Chinese (I tried the v10 before, seems it captured all key events so the IME failed to get the keys).

The font name is "Raize". A clean raster font for Windows. I found it here: http://www.raize.com/DevTools/Tools/RzFont.asp

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Colored text on Build and Output Windows
« Reply #9 on: September 24, 2006, 04:52:04 PM »
Thanks a lot !

@see http://community.slickedit.com/index.php?topic=324.msg1261#msg1261
for some more links to Windows-Fixed fonts.

HS2

davidlee62

  • Community Member
  • Posts: 35
  • Hero Points: 1
Re: Colored text on Build and Output Windows
« Reply #10 on: January 06, 2007, 06:55:46 AM »
Or another possibilty: define a lexer for extension 'process'. (Tools->Options/File Ext. Setup -> New)
I'm using that to visualize all the 'Error' / 'Warning' / 'Compiling' / etc. stuff

HS2

Hi HS2,

Could you please advise the detail of setting the build output message color? I am not understand the process. Thanks.

David

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Colored text on Build and Output Windows
« Reply #11 on: January 07, 2007, 06:42:56 PM »
Hi David,

I hope this helps a bit...

background:
Slick displays an internal buffer '.process' in the 'Build' window used to capture the output of the shell / tools running there.
We only have to setup a file extension 'process', a lexer for the contents there and assign it to the 'process' file extension.
Slick uses that setup even though '.process' is not a real file.

1.) start from scratch:
  • 'Tools->Options->File Extension Setup -> Advanced Tab
  • 'Click 'New' (bottom of the dialog)
  • enter <process> referring to '(none)'
  • click on 'Color Coding' (lexer field is empty)
  • Slick tells you that there is no lexer defined for 'process' and asks you to define one.
  • start defining your lexer ...

2.) start w/ defining a lexer and assign it later on when you defined the new 'process' file extension:
  • 'Tools->Options->Color Coding
  • 'Click 'New'
  • define your process buffer lexer
  • 'Tools->Options->File Extension Setup -> Advanced Tab
  • 'Click 'New' (bottom of the dialog)
  • enter <process> referring to '(none)'
  • choose your prev. defined lexer

Good luck,

HS2
« Last Edit: January 07, 2007, 06:55:25 PM by hs2 »