def init_scintilla(self):
            ''' Initialize configured styles '''
            editor.setMarginWidthN(0,38)
            editor.setMarginWidthN(1,14)
            editor.setMarginWidthN(2,0)

            if editor.getLexer() != LEXER.CONTAINER:
                editor.setLexer(LEXER.CONTAINER)

            editor.styleSetFore(self.ERROR_STYLE, self.ERROR_STYLE_FOREGROUND)
            editor.styleSetFore(self.WARNING_STYLE, self.WARNING_STYLE_FOREGROUND)
        def init_scintilla(self):
            ''' Initialize configured styles '''
            editor.setMarginWidthN(0, 38)
            editor.setMarginWidthN(1, 14)
            editor.setMarginWidthN(2, 0)

            if editor.getLexer() != LEXER.CONTAINER:
                editor.setLexer(LEXER.CONTAINER)

            editor.styleSetFore(self.ERROR_STYLE, self.ERROR_STYLE_FOREGROUND)
            editor.styleSetFore(self.WARNING_STYLE,
                                self.WARNING_STYLE_FOREGROUND)
        def init_scintilla(self):
            ''' Initialize configured styles '''
            editor.setMarginWidthN(0,38)
            editor.setMarginWidthN(1,14)
            editor.setMarginWidthN(2,0)

            if editor.getLexer() != LEXER.CONTAINER:
                editor.setLexer(LEXER.CONTAINER)

            editor.styleSetFore(self.ODD_COLUMN_STYLE,  (54,125,198))
            editor.styleSetFore(self.EVEN_COLUMN_STYLE, (87,166,74))
            editor.styleSetBack(self.EVEN_COLUMN_STYLE, (0,50,20))
Beispiel #4
0
        def init_scintilla(self):
            ''' Initialize configured styles '''
            editor.setMarginWidthN(0,38)
            editor.setMarginWidthN(1,14)
            editor.setMarginWidthN(2,0)

            if editor.getLexer() != LEXER.CONTAINER:
                editor.setLexer(LEXER.CONTAINER)

            editor.styleSetFore(self.ODD_COLUMN_STYLE,  (54,125,198))
            editor.styleSetFore(self.EVEN_COLUMN_STYLE, (87,166,74))
            editor.styleSetBack(self.EVEN_COLUMN_STYLE, (0,50,20))
Beispiel #5
0
    def __init__(self,
                 externalPython=None,
                 matplotlib_eventHandler=True,
                 cellHighlight=True,
                 popupForUnselectedVariable=True,
                 popupForSelectedExpression=False,
                 mouseDwellTime=200):
        '''Initializes PyPadPlusPlus to prepare Notepad++
        for interactive Python development'''
        console.show()
        editor.grabFocus()
        self.windowHandle = windll.user32.GetForegroundWindow()

        sys.stdout = PseudoFileOut(Npp.console.write)
        sys.stderr = PseudoFileOut(Npp.console.writeError)
        sys.stdout.outp = PseudoFileOut(Npp.console.write)

        self.matplotlib_eventHandler = matplotlib_eventHandler
        self.matplotlib_enabled = False
        self.popupForUnselectedVariable = popupForUnselectedVariable
        self.popupForSelectedExpression = popupForSelectedExpression
        self.mouseDwellTime = mouseDwellTime

        self.externalPython = bool(externalPython)
        if self.externalPython:
            from . import pyPadHost
            self.interp = pyPadHost.interpreter(externalPython,
                                                outBuffer=self.outBuffer)
        else:
            from . import pyPadClient
            self.interp = pyPadClient.interpreter()

        if cellHighlight:
            self.lexer = EnhancedPythonLexer()
            self.lexer.main()
        else:
            self.lexer = None

        self.thread = None
        self.threadMarker = None
        self.bufferActive = 1
        self.delayedMarker = False
        self.activeCalltip = None
        editor.setTargetStart(0)
        self.specialMarkers = None
        self.bufferMarkerAction = {}
        self.lastActiveBufferID = -1

        # Marker
        self.markerWidth = 3
        editor.setMarginWidthN(3, self.markerWidth)
        editor.setMarginMaskN(3, (256 + 128 + 64) * (1 + 2**3 + 2**6))
        self.markers = {}
        self.m_active, self.m_error, self.m_finish = [
            6 + 3 * i for i in [0, 1, 2]
        ]
        self.preCalculateMarkers()
        for iMarker in self.m_active, self.m_error, self.m_finish:
            self.drawMarker(iMarker)

        self.setCallbacks()

        editor.callTipSetBack((255, 255, 225))
        editor.autoCSetSeparator(ord('\t'))
        editor.autoCSetIgnoreCase(False)
        editor.autoCSetCaseInsensitiveBehaviour(False)
        editor.autoCSetCancelAtStart(False)
        editor.autoCSetDropRestOfWord(False)

        console.clear()
        console.editor.setReadOnly(0)

        self.tTimerFlush = 0.15
        self.tTimerMiddleButton = 0.1
        self.middleButton = 0

        self.bufferActive = 0
        self.onTimerFlush(
        )  # start periodic timer to check output of subprocess
        self.onTimerMiddleButton(
        )  # start periodic timer to check state of middleButton
def main():
    editor.setMarginWidthN(0,
                           editor.textWidth(STYLESCOMMON.LINENUMBER, "_99999"))