Re: Make current line number stand out?

Andrew Truckle <[email protected]>
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
On Sunday 26 May 2024 at 09:35:03 UTC+1 Andrew Truckle wrote:

 OK. I did ask OpenAI and it suggests doing this instead:

// Set the caret line background color (RGB format)
COLORREF caretLineColor = RGB(240, 240, 240); // Light gray color
SendMessage(hScintilla, SCI_SETCARETLINEBACK, caretLineColor, 0);

// Optionally, set the caret line background transparency (0 to 255)
int alpha = 100; // Transparency level (0 = fully transparent, 255 = fully 
opaque)
SendMessage(hScintilla, SCI_SETCARETLINEBACKALPHA, alpha, 0);

So I think I'll give it a go. Although I am concerned about possibly 
clashing with syntax text colours. We'll see.


I tried:

// Set the caret line background color (RGB format)
COLORREF caretLineColor = RGB(240, 240, 240); // Light gray color
m_edit.SetElementColour(Scintilla::Element::CaretLineBack, caretLineColor);

And that seems to be sufficient:

[image: LineNumbers3.png]

There appears to be no clashes with syntax colours (at this stage). I was 
unable to try the SCI_SETCARETLINEBACKALPHA suggestion as I could not work 
out how to port it to my MFC wrapper. But I don't think I need to anyway. 😊

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/scintilla-interest/17252508-84fe-413a-be5f-0da59f3c62efn%40googlegroups.com.
LineNumbers3.png (image/png, 12.4 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.