Re: Line Numbers on Print
Andrew Truckle <[email protected]>
| Newsgroups | gmane.comp.lib.scintilla.devel |
|---|---|
| Message-ID | <[email protected]> |
@marc
I have now added the following code (using your linked repository as a
guide):
auto ConvertColorRefToColorAlpha = [](COLORREF color, uint8_t alpha = 255)
-> uint32_t {
// Extract RGB components from the COLORREF value
const uint8_t red = GetRValue(color);
const uint8_t green = GetGValue(color);
const uint8_t blue = GetBValue(color);
// Combine into ARGB format
const uint32_t coloralpha = (alpha << 24) | (blue << 16) | (green << 8) |
red;
return coloralpha;
};
// Retrieve the system highlight color
const auto highlightColor =
ConvertColorRefToColorAlpha(::GetSysColor(COLOR_HIGHLIGHT));
// Retrieve the system highlight text color
const auto highlightTextColor =
ConvertColorRefToColorAlpha(::GetSysColor(COLOR_HIGHLIGHTTEXT));
m_edit.SetSelectionLayer(Scintilla::Layer::UnderText);
m_edit.SetElementColour(Scintilla::Element::SelectionText,
highlightTextColor);
m_edit.SetElementColour(Scintilla::Element::SelectionBack, highlightColor);
m_edit.SetElementColour(Scintilla::Element::SelectionAdditionalBack,
highlightColor);
m_edit.SetElementColour(Scintilla::Element::SelectionSecondaryBack,
highlightColor);
m_edit.SetElementColour(Scintilla::Element::SelectionInactiveBack,
highlightColor);
This does appear better:
[image: editor.png]
But, I am still not sure about the way I have used highlightTextColor.
On Thursday 23 May 2024 at 16:49:50 UTC+1 [email protected] wrote:
> According to the docs:
>
> SCI_FORMATRANGE can be used to draw the text onto a display surface which
> can include a printer display surface. Printed output shows text styling as
> on the screen, but it hides all margins except a line number margin.
> Markers do not appear in a margin but will change line background colour.
> The selection and caret are hidden.
>
>
> Is there a reason that you can't (optionally) hide the line numbers? I
> couldn't see any setting that would suppress those.
>
> Tom Doan
> ---
> Estima
> 2717 Harrison St
> Evanston, IL 60201
> USA
>
>
--
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/04aabc41-35a1-46b0-84d2-d6b741756076n%40googlegroups.com.
editor.png
(image/png, 60.4 KB) - not displayed