Re: Line Numbers on Print
Andrew Truckle <[email protected]>
| Newsgroups | gmane.comp.lib.scintilla.devel |
|---|---|
| Message-ID | <[email protected]> |
@marc
Do you also set these colours?
SC_ELEMENT_SELECTION_SECONDARY_TEXT : colouralpha
SC_ELEMENT_SELECTION_INACTIVE_TEXT : colouralpha
*?*
On Thursday 23 May 2024 at 17:51:46 UTC+1 Andrew Truckle wrote:
> @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/a96c6663-86a2-4da7-8807-b9dc175bffccn%40googlegroups.com.