'How to set margin masks in Scintilla?

I have a problem understanding how Scintilla markers are bound to a margin. Lets say I want 3 margins. 1st for linenumbers (no problem here), 2nd for arrow markers only and 3rd for circle makers only. I know from the documentation that I have to specify marginmasks to bind a marker to a margin, but I don't get how to specify the mask. I tried around a little but never got the wanted result. (Either arrows were displayed on both margings (2nd and 3rd) or no symbol was highlighted and instead the line was highlighed). Hope someone can enlighten me how to set the marginmasks.

/* 2nd marker margin -> only arrows */
Call(SCI_SETMARGINTYPEN, 1, SC_MARGIN_SYMBOL);
Call(SCI_SETMARGINWIDTHN, 1, 20);
Call(SCI_SETMARGINSENSITIVEN, 1, 1);
Call(SCI_SETMARGINMASKN, 1, SC_MARK_ARROW);    // <=== ???
 DefineMarker(1, SC_MARK_ARROW, 0xffffff, 0x0000ff);

/* 3rd marker margin -> only circles */
Call(SCI_SETMARGINTYPEN, 2, SC_MARGIN_SYMBOL);
Call(SCI_SETMARGINWIDTHN, 2, 50);
Call(SCI_SETMARGINSENSITIVEN, 2, 1);

DefineMarker(2, SC_MARK_CIRCLE, 0xffffff, 0x00ff00);
Call(SCI_SETMARGINMASKN, 2, SC_MARK_CIRCLE);    // <=== ???

Call(SCI_MARKERADD, 1, 1);
Call(SCI_MARKERADD, 1, 2);

That way I get an arrow marker on margin 1 but only a highlighted line and no circle marker for margin 2. I would be glad if someone can explain how the masks have to be set.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source