Author Topic: Is it possible to change the color or size of the block cursor?  (Read 6193 times)

alex

  • Community Member
  • Posts: 64
  • Hero Points: 6
Is it possible to change the color or size of the block cursor?
« on: September 18, 2006, 06:35:47 pm »
I'd like to make the block cursor a color other than black, and I'd like it to be a little bit taller.  Are either of these things possible?  I see that when I change focus away from SlickEdit, the block cursor is a bit taller than when I have SlickEdit focused.  I'm running 11.0.1 at the moment, if that matters.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2426
  • Hero Points: 136
Re: Is it possible to change the color or size of the block cursor?
« Reply #1 on: September 18, 2006, 06:51:33 pm »
You can change the color of the cursor when the editor does not have focus by changing the "Cursor" item in the Color Setting Dialog (Tools>Options>Color).

Dan

hs2

  • Senior Community Member
  • Posts: 2743
  • Hero Points: 288
Re: Is it possible to change the color or size of the block cursor?
« Reply #2 on: September 18, 2006, 06:55:22 pm »
Cursor shape of each cursor mode can be adjusted using
e.g.
Code: [Select]
   _cursor_shape('824 1000 100 1000 500 1000 100 600');
in a macro.

Cursor color can be set in 'Tools->Options->Color'.
(Seems that the cursor color setting there is the one when editor windw lost the focus ???)

HS2

alex

  • Community Member
  • Posts: 64
  • Hero Points: 6
Re: Is it possible to change the color or size of the block cursor?
« Reply #3 on: September 18, 2006, 08:34:01 pm »
I think I understand a reason why one might design it so that the cursor changes color only when the editor isn't in focus, but I still would like to change it when it is in focus too.

hs2, thanks for the cursor_shape function.  I guess I should have checked in the help file before asking about it--turns out it's the first result, but I have to admit that I thought it was going to require changing some innards.  Color me impressed.

hs2

  • Senior Community Member
  • Posts: 2743
  • Hero Points: 288
Re: Is it possible to change the color or size of the block cursor?
« Reply #4 on: September 18, 2006, 08:50:50 pm »
I don't get the point of setting the cursor color only for non-focused state.
Maybe the focused cursor color is somehow derived (inverted/calculated) from a another item, but which ...
Luckily it's color is quite ok for me ;)
On the other hand it would be nice if there will be also a setting for it.
@Slickteam: Any chance ?

HS2

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5094
  • Hero Points: 421
Re: Is it possible to change the color or size of the block cursor?
« Reply #5 on: September 19, 2006, 02:45:21 pm »
Just thought I would give some implementation details.  When an editor window has focus, SlickEdit uses an XOR for displaying the cursor.  This is the standard Windows way to draw a cursor.  SlickEdit also uses this scheme for Unix.  The colors generated by an XOR are almost always very visible  (Invert/XOR of grey is a problem).  I am not aware of any other Unix application that does this.  Other Unix application allow you to set the color of the cursor.  For example, QT controls will just overwrite a cursor in some color and then invalidate the area which was modified.  Given the number of colors that need to be predefined for color coding and embedded color coding, using XOR seem like the better choice.  Of course, we could add option #10 billion and one for setting the cursor color :-)

When a Window does not have focus, SlickEdit uses the "Cursor" color (bad name, better would be "Inactive Cursor") to change the background of the character where the cursor position is.  This feature is primarily to assist programmer's who use the command line a lot.  This is very useful since many commands operate on the cursor location.

You can use the "cursor_shape" command from the SlickEdit command line to change size of the focus cursor.  See on-line help for this command for more information (docs could use some examples).

hs2

  • Senior Community Member
  • Posts: 2743
  • Hero Points: 288
Re: Is it possible to change the color or size of the block cursor?
« Reply #6 on: September 19, 2006, 02:59:04 pm »
Thanks a lot Clark for the explanation.
This made things quite clear now and I always feel better when I get 'the idea behind' things ;)
To be honest the active cursor color was and is ok for me.
But I adjusted the inactive cursor to deep red exactly for the reason you mentioned !

HS2

PS: No option #10 billion please - no, PLEASE ;)