aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2000-09-14 01:47:27 +0000
committernyamatongwe <unknown>2000-09-14 01:47:27 +0000
commit56c34a6827f49acf2cd4f0e402dbfc844ae0ec88 (patch)
tree03242e479ad163ecd63f081fdec41bdd2e2ce4ba
parentfd632fe35aebc4a854457babe9123315bef7bad3 (diff)
downloadscintilla-mirror-56c34a6827f49acf2cd4f0e402dbfc844ae0ec88.tar.gz
Markus added some more print modes.
-rw-r--r--include/Scintilla.h2
-rw-r--r--include/Scintilla.iface4
-rw-r--r--src/Editor.cxx11
3 files changed, 15 insertions, 2 deletions
diff --git a/include/Scintilla.h b/include/Scintilla.h
index 07fa3d925..bc334ea09 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -215,6 +215,8 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara
#define SC_PRINT_NORMAL 0
#define SC_PRINT_INVERTLIGHT 1
#define SC_PRINT_BLACKONWHITE 2
+#define SC_PRINT_COLOURONWHITE 3
+#define SC_PRINT_COLOURONWHITEDEFAULTBG 4
#define SCI_SETPRINTCOLOURMODE 2148
#define SCI_GETPRINTCOLOURMODE 2149
#define SCFIND_DOWN 1
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index c5518c4c5..6b511ee1c 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -550,6 +550,10 @@ val SC_PRINT_NORMAL=0
val SC_PRINT_INVERTLIGHT=1
# PrintColourMode - force black text on white background for printing.
val SC_PRINT_BLACKONWHITE=2
+# PrintColourMode - text stays coloured, but all background is forced to be white for printing.
+val SC_PRINT_COLOURONWHITE=3
+# PrintColourMode - only the default-background is forced to be white for printing.
+val SC_PRINT_COLOURONWHITEDEFAULTBG=4
# Modify colours when printing for clearer printed text.
set void SetPrintColourMode=2148(int mode,)
diff --git a/src/Editor.cxx b/src/Editor.cxx
index c33c69fd0..4c3f46739 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1349,8 +1349,8 @@ long Editor::FormatRange(bool draw, RangeToFormat *pfr) {
// Don't show the selection when printing
vsPrint.selbackset = false;
vsPrint.selforeset = false;
- // White background for the line numbers
- vsPrint.styles[STYLE_LINENUMBER].back.desired = Colour(0xff, 0xff, 0xff);
+
+ // Set colours for printing according to users settings
for (int sty = 0;sty <= STYLE_MAX;sty++) {
if (printColourMode == SC_PRINT_INVERTLIGHT) {
vsPrint.styles[sty].fore.desired = InvertedLight(vsPrint.styles[sty].fore.desired);
@@ -1358,8 +1358,15 @@ long Editor::FormatRange(bool draw, RangeToFormat *pfr) {
} else if (printColourMode == SC_PRINT_BLACKONWHITE) {
vsPrint.styles[sty].fore.desired = Colour(0, 0, 0);
vsPrint.styles[sty].back.desired = Colour(0xff, 0xff, 0xff);
+ } else if (printColourMode == SC_PRINT_COLOURONWHITE) {
+ vsPrint.styles[sty].back.desired = Colour(0xff, 0xff, 0xff);
+ } else if (printColourMode == SC_PRINT_COLOURONWHITEDEFAULTBG) {
+ if (sty <= STYLE_DEFAULT) {
+ vsPrint.styles[sty].back.desired = Colour(0xff, 0xff, 0xff);
+ }
}
}
+ // White background for the line numbers
vsPrint.styles[STYLE_LINENUMBER].back.desired = Colour(0xff, 0xff, 0xff);
vsPrint.Refresh(*surfaceMeasure);