Example #1
0
    def DefineMarkers(self):
        """Defines the folder and bookmark icons for this control
        @postcondition: all margin markers are defined

        """
        # Get the colours for the various markers
        style = self.GetItemByName('foldmargin_style')
        back = style.GetFore()
        rgb = eclib.HexToRGB(back[1:])
        back = wx.Colour(red=rgb[0], green=rgb[1], blue=rgb[2])

        fore = style.GetBack()
        rgb = eclib.HexToRGB(fore[1:])
        fore = wx.Colour(red=rgb[0], green=rgb[1], blue=rgb[2])

        # Buffer background highlight
        caret_line = self.GetItemByName('caret_line').GetBack()
        rgb = eclib.HexToRGB(caret_line[1:])
        clback = wx.Colour(*rgb)

        # Code Folding markers
        folder = ed_marker.FoldMarker()
        folder.Foreground = fore
        folder.Background = back
        folder.RegisterWithStc(self)

        # Bookmarks
        ed_marker.Bookmark().RegisterWithStc(self)

        # Breakpoints
        ed_marker.Breakpoint().RegisterWithStc(self)
        ed_marker.BreakpointDisabled().RegisterWithStc(self)
        step = ed_marker.BreakpointStep()
        step.Background = clback
        step.RegisterWithStc(self)
Example #2
0
    def AddBookmark(self, line=-1):
        """Add a bookmark and return its handle
        @keyword line: if < 0 bookmark will be added to current line

        """
        if line < 0:
            line = self.GetCurrentLine()
        bmark = ed_marker.Bookmark()
        bmark.Set(self, line)
        return bmark.Handle
Example #3
0
 def RemoveAllBookmarks(self):
     """Remove all the bookmarks in the buffer"""
     ed_marker.Bookmark().DeleteAll(self)
Example #4
0
    def RemoveBookmark(self, line):
        """Remove the book mark from the given line
        @param line: int

        """
        ed_marker.Bookmark().Set(self, line, delete=True)