• R/O
  • SSH
  • HTTPS

tortoisesvn:


File Info

Rev. 12676
Größe 2,571 Bytes
Zeit 2008-04-17 01:31:51
Autor stefankueng
Log Message

Apply our patch to Scintilla for the background colors.

Content

Index: include/Scintilla.h
===================================================================
--- include/Scintilla.h	(revision 12675)
+++ include/Scintilla.h	(working copy)
@@ -750,6 +750,7 @@
 #define SCN_AUTOCSELECTION 2022
 #define SCN_INDICATORCLICK 2023
 #define SCN_INDICATORRELEASE 2024
+#define SCN_GETBKCOLOR 2025
 //--Autogenerated -- end of section automatically generated from Scintilla.iface
 
 // These structures are defined to be exactly the same shape as the Win32
Index: src/Editor.cxx
===================================================================
--- src/Editor.cxx	(revision 12675)
+++ src/Editor.cxx	(working copy)
@@ -2277,6 +2277,17 @@
 		}
 	}
 
+	SCNotification scn = {0};
+	scn.nmhdr.code = SCN_GETBKCOLOR;
+	scn.line = line;
+	scn.lParam = -1;
+	NotifyParent(&scn);
+	if (scn.lParam != -1)
+	{
+		background = scn.lParam;
+		overrideBackground = true;
+	}
+
 	bool drawWhitespaceBackground = (vsDraw.viewWhitespace != wsInvisible) &&
 	        (!overrideBackground) && (vsDraw.whitespaceBackgroundSet);
 
Index: src/Editor.h
===================================================================
--- src/Editor.h	(revision 12675)
+++ src/Editor.h	(working copy)
@@ -360,6 +360,7 @@
 	virtual void NotifyFocus(bool focus);
 	virtual int GetCtrlID() { return ctrlID; }
 	virtual void NotifyParent(SCNotification scn) = 0;
+	virtual void NotifyParent(SCNotification * scn) = 0;
 	virtual void NotifyStyleToNeeded(int endStyleNeeded);
 	void NotifyChar(int ch);
 	void NotifyMove(int position);
Index: win32/ScintillaWin.cxx
===================================================================
--- win32/ScintillaWin.cxx	(revision 12675)
+++ win32/ScintillaWin.cxx	(working copy)
@@ -204,6 +204,7 @@
 	virtual void NotifyFocus(bool focus);
 	virtual int GetCtrlID();
 	virtual void NotifyParent(SCNotification scn);
+	virtual void NotifyParent(SCNotification * scn);
 	virtual void NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt);
 	virtual void Copy();
 	virtual void CopyAllowLine();
@@ -1221,6 +1222,13 @@
 	              GetCtrlID(), reinterpret_cast<LPARAM>(&scn));
 }
 
+void ScintillaWin::NotifyParent(SCNotification * scn) {
+	scn->nmhdr.hwndFrom = MainHWND();
+	scn->nmhdr.idFrom = GetCtrlID();
+	::SendMessage(::GetParent(MainHWND()), WM_NOTIFY,
+		GetCtrlID(), reinterpret_cast<LPARAM>(scn));
+}
+
 void ScintillaWin::NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt) {
 	//Platform::DebugPrintf("ScintillaWin Double click 0\n");
 	ScintillaBase::NotifyDoubleClick(pt, shift, ctrl, alt);
Show on old repository browser