コード例 #1
0
ファイル: Editor.py プロジェクト: rexmas/Trickplay
    def setEditorStyle(self):
        
        preference = self.editorManager.main.preference
        font = preference.lexerLuaFont[0]
        fcolor = preference.lexerLuaFColor[0]
        bcolor = preference.lexerLuaBColor[0]

        self.setFont(font)
        self.setMarginsFont(font)

        # Margin 0 is used for line numbers
        fontmetrics = QFontMetrics(font)
        self.setMarginsFont(font)
        self.setMarginWidth(0, fontmetrics.width("00000"))
        self.setMarginLineNumbers(0, True)
        self.setMarginsBackgroundColor(QColor("#E6E6E6")) # HJ

        # Set Python lexer
        # Set style for Python comments (style number 1) to a fixed-width
        # courier.
        #
        self.lexer = QsciLexerLua()
        self.lexer.setDefaultFont(font)
        self.setLexer(self.lexer)

        for index in range(0, len(preference.lexerLua)):
            if preference.lexerLua[index] != "":
                font = preference.lexerLuaFont[index]
                fcolor = preference.lexerLuaFColor[index]
                bcolor = preference.lexerLuaBColor[index]
                self.SendScintilla(QsciScintilla.SCI_STYLESETSIZE, index, font.pointSize())
                self.SendScintilla(QsciScintilla.SCI_STYLESETFONT, index, font.family())
                self.SendScintilla(QsciScintilla.SCI_STYLESETITALIC, index, font.italic())
                self.SendScintilla(QsciScintilla.SCI_STYLESETBOLD, index, font.bold())
                self.SendScintilla(QsciScintilla.SCI_STYLESETUNDERLINE, index, font.underline())
                self.SendScintilla(QsciScintilla.SCI_STYLESETFORE, index, self.colorfix(fcolor.name()))
                self.SendScintilla(QsciScintilla.SCI_STYLESETBACK, index, self.colorfix(bcolor.name()))
コード例 #2
0
dumpLexer( QsciLexerPython() )
dumpLexer( QsciLexerBash() )
dumpLexer( QsciLexerBatch() )
dumpLexer( QsciLexerCMake() )
dumpLexer( QsciLexerCPP() )
dumpLexer( QsciLexerCSharp() )
dumpLexer( QsciLexerCSS() )
dumpLexer( QsciLexerDiff() )
dumpLexer( QsciLexerD() )
dumpLexer( QsciLexerFortran77() )
dumpLexer( QsciLexerFortran() )
dumpLexer( QsciLexerHTML() )
dumpLexer( QsciLexerIDL() )
dumpLexer( QsciLexerJava() )
dumpLexer( QsciLexerJavaScript() )
dumpLexer( QsciLexerLua() )
dumpLexer( QsciLexerMakefile() )
dumpLexer( QsciLexerPascal() )
dumpLexer( QsciLexerPerl() )
dumpLexer( QsciLexerPostScript() )
dumpLexer( QsciLexerPOV() )
dumpLexer( QsciLexerProperties() )
dumpLexer( QsciLexerRuby() )
dumpLexer( QsciLexerSQL() )
dumpLexer( QsciLexerTCL() )
dumpLexer( QsciLexerTeX() )
dumpLexer( QsciLexerVHDL() )
dumpLexer( QsciLexerXML() )
dumpLexer( QsciLexerYAML() )