aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2000-07-05 04:49:03 +0000
committernyamatongwe <devnull@localhost>2000-07-05 04:49:03 +0000
commit63654a7adf0e2960f63d2e20ccf3900d274fa410 (patch)
treedbaabe79f4af1f9fef1b514ed64466165560a098
parentdb04c9f43e663e771b0eeeca0cae3b8924afb35e (diff)
downloadscintilla-mirror-63654a7adf0e2960f63d2e20ccf3900d274fa410.tar.gz
Changed print colour mode to have black on white as well as invert light
states.
-rw-r--r--doc/ScintillaDoc.html10
-rw-r--r--include/Scintilla.h9
-rw-r--r--include/Scintilla.iface18
-rw-r--r--src/Editor.cxx18
-rw-r--r--src/Editor.h2
5 files changed, 37 insertions, 20 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 6c652e614..456875111 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -750,8 +750,8 @@ SCI_STOPRECORD
EM_FORMATRANGE
SCI_SETPRINTMAGNIFICATION(int magnification)
SCI_GETPRINTMAGNIFICATION
-SCI_SETPRINTINVERTLIGHT(bool invert)
-SCI_GETPRINTINVERTLIGHT
+SCI_SETPRINTCOLOURMODE(int mode)
+SCI_GETPRINTCOLOURMODE
</pre>
<p>
On Windows EM_FORMATRANGE can be used to draw the text onto a display context which can
@@ -760,8 +760,12 @@ SCI_GETPRINTINVERTLIGHT
<p>
To print at a different size than drawing on screen use SCI_SETPRINTMAGNIFICATION with
a value which is the number of points to add to each style. -3 or -4 gives reasonable small print.
+ </p>
+ <p>
If a black background is used on the screen then it is best to invert the light value of all colours
- with SCI_SETPRINTINVERTLIGHT when printing to give a white bavkground.
+ with SCI_SETPRINTCOLOURMODE(SC_PRINT_INVERTLIGHT) when printing to give a
+ white background. If intermediate tones are used on screen then black on white print can be
+ chosen with SCI_SETPRINTCOLOURMODE(SC_PRINT_BLACKONWHITE).
</p>
<h3>
Multiple Views
diff --git a/include/Scintilla.h b/include/Scintilla.h
index be1230821..e53931e0f 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -238,8 +238,13 @@ void Scintilla_RegisterClasses(HINSTANCE hInstance);
#define SCI_GETSELECTIONEND SCI_START + 145
#define SCI_SETPRINTMAGNIFICATION SCI_START + 146
#define SCI_GETPRINTMAGNIFICATION SCI_START + 147
-#define SCI_SETPRINTINVERTLIGHT SCI_START + 148
-#define SCI_GETPRINTINVERTLIGHT SCI_START + 149
+
+#define SC_PRINT_NORMAL 0
+#define SC_PRINT_INVERTLIGHT 1
+#define SC_PRINT_BLACKONWHITE 2
+
+#define SCI_SETPRINTCOLOURMODE SCI_START + 148
+#define SCI_GETPRINTCOLOURMODE SCI_START + 149
#define SCI_CALLTIPSHOW SCI_START + 200
#define SCI_CALLTIPCANCEL SCI_START + 201
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 28c60f13d..ce52f1c70 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -502,12 +502,18 @@ set void SetPrintMagnification=2146(int magnification,)
# Returns the print magnification.
get int GetPrintMagnification=2147(,)
-# Set to invert the light value of each style for printing.
-# Used to produce reasonable print output when black background used.
-set void SetPrintInvertLight=2148(bool invert,)
-
-# Returns the invert light value property.
-get bool GetPrintInvertLight=2149(,)
+# PrintColourMode - use same colours as screen.
+val SC_PRINT_NORMAL=0
+# PrintColourMode - invert the light value of each style for printing.
+val SC_PRINT_INVERTLIGHT=1
+# PrintColourMode - force black text on white background for printing.
+val SC_PRINT_BLACKONWHITE=2
+
+# Modify colours when printing for clearer printed text.
+set void SetPrintColourMode=2148(int mode,)
+
+# Returns the print colour mode.
+get int GetPrintColourMode=2149(,)
# Show a call tip containing a definition near position pos.
fun void CallTipShow=2200(position pos, string definition)
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 4ac0b0d89..f1c497db2 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -34,7 +34,7 @@ Editor::Editor() {
stylesValid = false;
printMagnification = 0;
- printInvertLight = false;
+ printColourMode = SC_PRINT_NORMAL;
hideSelection = false;
inOverstrike = false;
@@ -1295,12 +1295,14 @@ long Editor::FormatRange(bool draw, FORMATRANGE *pfr) {
vsPrint.selforeset = false;
// White background for the line numbers
vsPrint.styles[STYLE_LINENUMBER].back.desired = Colour(0xff,0xff,0xff);
- if (printInvertLight) {
- for (int sty=0;sty<=STYLE_MAX;sty++) {
+ for (int sty=0;sty<=STYLE_MAX;sty++) {
+ if (printColourMode == SC_PRINT_INVERTLIGHT) {
vsPrint.styles[sty].fore.desired = InvertedLight(vsPrint.styles[sty].fore.desired);
vsPrint.styles[sty].back.desired = InvertedLight(vsPrint.styles[sty].back.desired);
+ } else if (printColourMode == SC_PRINT_BLACKONWHITE) {
+ vsPrint.styles[sty].fore.desired = Colour(0,0,0);
+ vsPrint.styles[sty].back.desired = Colour(0xff,0xff,0xff);
}
- //vsPrint.styles[sty].size = vsPrint.styles[sty].size * printMagnification / 100;
}
vsPrint.styles[STYLE_LINENUMBER].back.desired = Colour(0xff,0xff,0xff);
@@ -3390,12 +3392,12 @@ LRESULT Editor::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam) {
case SCI_GETPRINTMAGNIFICATION:
return printMagnification;
- case SCI_SETPRINTINVERTLIGHT:
- printInvertLight = wParam;
+ case SCI_SETPRINTCOLOURMODE:
+ printColourMode = wParam;
break;
- case SCI_GETPRINTINVERTLIGHT:
- return printInvertLight;
+ case SCI_GETPRINTCOLOURMODE:
+ return printColourMode;
case SCI_GETSTYLEAT:
if (static_cast<short>(wParam) >= pdoc->Length())
diff --git a/src/Editor.h b/src/Editor.h
index 456fdd1ea..c39157747 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -60,7 +60,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
ViewStyle vs;
Palette palette;
int printMagnification;
- bool printInvertLight;
+ int printColourMode;
bool hideSelection;
bool inOverstrike;