diff options
author | Neil <nyamatongwe@gmail.com> | 2016-09-29 13:33:35 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2016-09-29 13:33:35 +1000 |
commit | cfe3c049555422cbc7dcf3fd2fadad2f08487dd7 (patch) | |
tree | f7065c237f0352276b3345c111542af3b267ed26 /src | |
parent | 1648497785a6344df6c313697925c009c8d1acad (diff) | |
download | scintilla-mirror-cfe3c049555422cbc7dcf3fd2fadad2f08487dd7.tar.gz |
Margin type SC_MARGIN_COLOUR and API SCI_SETMARGINBACKN added.
Allows choosing any colour for a margin.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 13 | ||||
-rw-r--r-- | src/MarginView.cxx | 3 | ||||
-rw-r--r-- | src/ViewStyle.h | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index ee4d3947f..0e686e101 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -6884,6 +6884,19 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { else return 0; + case SCI_SETMARGINBACKN: + if (ValidMargin(wParam)) { + vs.ms[wParam].back = ColourDesired(static_cast<long>(lParam)); + InvalidateStyleRedraw(); + } + break; + + case SCI_GETMARGINBACKN: + if (ValidMargin(wParam)) + return vs.ms[wParam].back.AsLong(); + else + return 0; + case SCI_STYLECLEARALL: vs.ClearStyles(); InvalidateStyleRedraw(); diff --git a/src/MarginView.cxx b/src/MarginView.cxx index 52a2cb2dd..ab8cbf4f8 100644 --- a/src/MarginView.cxx +++ b/src/MarginView.cxx @@ -216,6 +216,9 @@ void MarginView::PaintMargin(Surface *surface, int topLine, PRectangle rc, PRect case SC_MARGIN_FORE: colour = vs.styles[STYLE_DEFAULT].fore; break; + case SC_MARGIN_COLOUR: + colour = vs.ms[margin].back; + break; default: colour = vs.styles[STYLE_LINENUMBER].back; break; diff --git a/src/ViewStyle.h b/src/ViewStyle.h index be84598f1..7a2c26f63 100644 --- a/src/ViewStyle.h +++ b/src/ViewStyle.h @@ -17,6 +17,7 @@ namespace Scintilla { class MarginStyle { public: int style; + ColourDesired back; int width; int mask; bool sensitive; |