aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicholai Benalal <unknown>2018-04-19 07:31:34 +1000
committerNicholai Benalal <unknown>2018-04-19 07:31:34 +1000
commit8c66be442aaff47a978d699343a0082686530b83 (patch)
tree7b3c1dd64bd233d2b6778a81f5ba8f6e05288cc4
parent33614c254f56586b2e618213ddf879f865f127a6 (diff)
downloadscintilla-mirror-8c66be442aaff47a978d699343a0082686530b83.tar.gz
SC_PRINT_SCREENCOLOURS doesn't force the background colour of line numbers white.
-rw-r--r--doc/ScintillaDoc.html17
-rw-r--r--doc/ScintillaHistory.html5
-rw-r--r--include/Scintilla.h1
-rw-r--r--include/Scintilla.iface3
-rw-r--r--src/EditView.cxx5
5 files changed, 26 insertions, 5 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index d9f658814..98c8df2a1 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -5557,7 +5557,8 @@ struct Sci_RangeToFormat {
<td align="center">0</td>
- <td>Print using the current screen colours. This is the default.</td>
+ <td>Print using the current screen colours with the exception of line number margins which print on a white background.
+ This is the default.</td>
</tr>
<tr>
@@ -5590,9 +5591,19 @@ struct Sci_RangeToFormat {
<td align="center">4</td>
- <td>Everything prints in its own colour on a white background except that line numbers
- use their own background colour.</td>
+ <td>Everything prints in its own foreground colour but all styles up to and including STYLE_LINENUMBER will print
+ on a white background.</td>
</tr>
+
+ <tr>
+ <td align="left"><code>SC_PRINT_SCREENCOLOURS</code></td>
+
+ <td align="center">5</td>
+
+ <td>Print using the current screen colours for both foreground and background.
+ This is the only mode that does not set the background colour of the line number margin to white.</td>
+ </tr>
+
</tbody>
</table>
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 00fe782fe..f8593fbee 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -523,6 +523,7 @@
<td>Liang Bai</td>
</tr><tr>
<td>Gunter Königsmann</td>
+ <td>Nicholai Benalal</td>
</tr>
</table>
<p>
@@ -546,6 +547,10 @@
2 GigaBytes.
</li>
<li>
+ Additional print option SC_PRINT_SCREENCOLOURS prints with the same colours used on screen
+ including line numbers.
+ </li>
+ <li>
Set the last X chosen when SCI_REPLACESEL called to ensure macros work
when text insertion followed by caret up or down.
</li>
diff --git a/include/Scintilla.h b/include/Scintilla.h
index 3ec70a380..df059e68d 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -390,6 +390,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_PRINT_BLACKONWHITE 2
#define SC_PRINT_COLOURONWHITE 3
#define SC_PRINT_COLOURONWHITEDEFAULTBG 4
+#define SC_PRINT_SCREENCOLOURS 5
#define SCI_SETPRINTCOLOURMODE 2148
#define SCI_GETPRINTCOLOURMODE 2149
#define SCFIND_WHOLEWORD 0x2
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 2c361b5f0..33f16e7bd 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -922,6 +922,7 @@ get int GetPrintMagnification=2147(,)
enu PrintOption=SC_PRINT_
# PrintColourMode - use same colours as screen.
+# with the exception of line number margins, which use a white background
val SC_PRINT_NORMAL=0
# PrintColourMode - invert the light value of each style for printing.
val SC_PRINT_INVERTLIGHT=1
@@ -931,6 +932,8 @@ val SC_PRINT_BLACKONWHITE=2
val SC_PRINT_COLOURONWHITE=3
# PrintColourMode - only the default-background is forced to be white for printing.
val SC_PRINT_COLOURONWHITEDEFAULTBG=4
+# PrintColourMode - use same colours as screen, including line number margins.
+val SC_PRINT_SCREENCOLOURS=5
# Modify colours when printing for clearer printed text.
set void SetPrintColourMode=2148(int mode,)
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 3f490af5e..acf7b3b84 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -2242,8 +2242,9 @@ Sci::Position EditView::FormatRange(bool draw, Sci_RangeToFormat *pfr, Surface *
}
}
}
- // White background for the line numbers
- vsPrint.styles[STYLE_LINENUMBER].back = ColourDesired(0xff, 0xff, 0xff);
+ // White background for the line numbers if SC_PRINT_SCREENCOLOURS isn't used
+ if (printParameters.colourMode != SC_PRINT_SCREENCOLOURS)
+ vsPrint.styles[STYLE_LINENUMBER].back = ColourDesired(0xff, 0xff, 0xff);
// Printing uses different margins, so reset screen margins
vsPrint.leftMarginWidth = 0;