def __init__(self, parent=None): """ Constructor @param parent parent widget of this lexer """ QsciLexerVHDL.__init__(self, parent) Lexer.__init__(self) self.commentString = "--"
def defaultKeywords(self, kwSet): """ Public method to get the default keywords. @param kwSet number of the keyword set (integer) @return string giving the keywords (string) or None """ return QsciLexerVHDL.keywords(self, kwSet)
def __init__(self, parent=None): """ Constructor @param parent parent widget of this lexer """ QsciLexerVHDL.__init__(self, parent) Lexer.__init__(self) self.commentString = "--" self.keywordSetDescriptions = [ self.tr("Keywords"), self.tr("Operators"), self.tr("Attributes"), self.tr("Standard Functions"), self.tr("Standard Packages"), self.tr("Standard Types"), self.tr("User defined"), ]
def __init__(self, type, parent=None): super(CodeEditor, self).__init__(parent) self.parent = parent self.type = type # indent settings self.setIndentationsUseTabs(True) self.setTabWidth(4) self.setIndentationGuides(True) self.setAutoIndent(True) self.setWrapMode(QsciScintilla.WrapWord) self.setWrapIndentMode(QsciScintilla.WrapIndentIndented) self.setCaretForegroundColor(QColor("#ff0000ff")) self.setCaretLineVisible(True) self.setCaretLineBackgroundColor(QColor("#1fff0000")) # margin settings self.setMarginType(0, QsciScintilla.NumberMargin) self.setMarginWidth(0, "0000000000") self.setMarginsForegroundColor(QColor("#ff0000ff")) # font settings font = QFont() font.setFamily('Courier') font.setFixedPitch(True) font.setPointSize(10) self.setFont(font) self.setMarginsFont(font) self.setBraceMatching(QsciScintilla.SloppyBraceMatch) # set what lexer this editor will use self.vhdlLexer = QsciLexerVHDL() self.verilogLexer = QsciLexerVerilog() if self.type == "vhdl": self.setLexer(self.vhdlLexer) self.lexer().setFoldAtBegin(True) self.lexer().setFoldAtParenthesis(True) else: self.setLexer(self.verilogLexer) self.lexer().setFoldAtModule(True) self.lexer().setFoldPreprocessor(True) self.lexer().setDefaultFont(font) self.lexer().setFont(font) self.lexer().setFoldAtElse(True) self.lexer().setFoldComments(True) self.setFolding(QsciScintilla.BoxedTreeFoldStyle) # auto complete settings self.setAutoCompletionSource(QsciScintilla.AcsDocument) self.setAutoCompletionThreshold(2) self.setAutoCompletionCaseSensitivity(False) self.setAutoCompletionReplaceWord(False) self.setAutoCompletionUseSingle(QsciScintilla.AcusNever) self.setCallTipsStyle(QsciScintilla.CallTipsNoContext) self.setCallTipsVisible(0) self.SendScintilla(QsciScintilla.SCI_SETHSCROLLBAR, 0)