Diffrent colors for StyledTextCtrl margin?

Hello All,

I'm writing a debugger, where a StyledTextCtrl is used to display sources.
I'd like to color the line number margin in a different color from the
margin I place breakpoint markers.

Any idea how to do that?

Currently the code is:

class SrcPanel(StyledTextCtrl):
    '''Assembler view control'''
    def __init__(self, parent, filename):
        StyledTextCtrl.__init__(self, parent, -1, size=(250,250),
                style=wx.BORDER_NONE)

        # Line numbers margin
        self.SetMarginType(0, STC_MARGIN_NUMBER)
        self.SetMarginWidth(0, 40)

        # Breakpoints margin
        # FIXME: Do we want different marker for HW/SW breakpoints?
        self.bp_mark = 1 # Breakpoint indicator
        self.src_mark = 2 # Source indicator
        self.pc_mark = 3 # PC indicator

        # Make line and symbol margins sensitive to clicks
        self.SetMarginSensitive(0, 1)
        self.SetMarginSensitive(1, 1)

        # Symbols for breakpoint, pc and source indicator
        # FIXME: Find better markers
        self.SetMarginType(1, STC_MARGIN_SYMBOL)
        self.MarkerDefine(self.bp_mark, STC_MARK_ROUNDRECT, "RED", "RED")
        self.MarkerDefine(self.src_mark, STC_MARK_ARROWS, "BLACK", "BLACK")
        self.MarkerDefine(self.pc_mark, STC_MARK_SHORTARROW, "BLUE",
            "BLUE")

        # Font selection
        # FIXME: Configurable
        self.StyleSetSpec(STC_STYLE_DEFAULT, "size:10,face:Courier New")
        self.StyleClearAll()
        self.StyleSetSpec(STC_STYLE_DEFAULT, "size:10,face:Courier New")
        self.StyleSetSpec(STC_STYLE_LINENUMBER,
                "back:#8080FF,size:8,face:Courier New")
        # Tab size
        # FIXME: Make configurable
        self.SetTabWidth(4)
        # Much more code snipped ...

but this colors all the margin in the same color.

Bye.

···

--
------------------------------------------------------------------------
Miki Tebeka <miki.tebeka@zoran.com>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys

Hello Miki,

this interests me also,
so I looked in the scintilla mailing list,
and found a message:

"""
is there a way to set the different color for the
Line Number Margin background color and Bookmark Margin background color?
"""

Neil Hodgson:
No

···

On Wed, 31 Aug 2005 12:32:31 +0300, Miki Tebeka <miki.tebeka@zoran.com> wrote:

Hello All,

I'm writing a debugger, where a StyledTextCtrl is used to display sources.
I'd like to color the line number margin in a different color from the
margin I place breakpoint markers.
[...]

--
Franz Steinhaeusler

Hello Franz,

[Miki]

>I'm writing a debugger, where a StyledTextCtrl is used to display sources.
>I'd like to color the line number margin in a different color from the
>margin I place breakpoint markers.
>[...]

[Franz]

this interests me also,
so I looked in the scintilla mailing list,
and found a message:

"""
is there a way to set the different color for the
Line Number Margin background color and Bookmark Margin background color?
"""

Neil Hodgson:
No

Thanks :frowning:

Bye.

···

--
------------------------------------------------------------------------
Miki Tebeka <miki.tebeka@zoran.com>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys