AtSynEdit - Set Text Selection BgColor, FgColor, FocusRect

Post Reply
TomC
Posts: 13
Joined: 29.05.2022 05:11

AtSynEdit - Set Text Selection BgColor, FgColor, FocusRect

Post by TomC »

Hi,

With "SynEdit" I was able to Set the Text Selection Appearance, to something really "cool" looking:

Code: Select all

	with SynEdit.SelectedColor do
		begin
		Background:=clMyPastelColor;
		Foreground:=clBlack;
		FrameColor:=clNavy;       {Nice}
		FrameStyle:=slsDotted;    {Even Nicer}
		end;
This would give the selected text background a soft pastel color, with a nice dotted focus rectangle around the text.

This above "FrameStyle" (in SynEditTypes.pas) is:

Code: Select all

  TSynLineStyle = (
    slsSolid,	 // PS_SOLID pen
    slsDashed,	// PS_DASH pen
    slsDotted,	// PS_DOT
    slsWaved	  // solid wave
  );
Ok, so with "AtSynEdit" (my now preferred choice), I have:

Code: Select all

	with AtSynEdit.Colors do
		begin
		TextSelBg:=clMyPastelColor;
		TextSelFont:=clBlack;
		//FrameColor:=clNavy;        {Cant find anything to do this}
		//FrameStyle:=slsDotted;     {Cant find anything to do this}
		end;
Any Ideas would be much appreciated
Thank You Sincerely..
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

ATSynedit don't support FrameColor/FrameStyle for selection.
Related function: it supports Attribs object which contains list of custom color fragments in text. They can have borders.
Post Reply