本文整理汇总了Python中CScite.pane_ScintillaFn方法的典型用法代码示例。如果您正苦于以下问题:Python CScite.pane_ScintillaFn方法的具体用法?Python CScite.pane_ScintillaFn怎么用?Python CScite.pane_ScintillaFn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CScite
的用法示例。
在下文中一共展示了CScite.pane_ScintillaFn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __getattr__
# 需要导入模块: import CScite [as 别名]
# 或者: from CScite import pane_ScintillaFn [as 别名]
def __getattr__(self, sprop):
if sprop.startswith("_"):
# if looking for a special method, don't try to do anything.
raise exceptions.AttributeError
elif sprop.startswith("Get"):
if sprop in CScite._dictIsScintillaFnNotGetter:
return lambda *args: CScite.pane_ScintillaFn(self.nPane, sprop, args)
else:
sprop = sprop[3:]
return lambda param=None: CScite.pane_ScintillaGet(self.nPane, sprop, param)
elif sprop.startswith("Set"):
if sprop in CScite._dictIsScintillaFnNotSetter:
return lambda *args: CScite.pane_ScintillaFn(self.nPane, sprop, args)
else:
sprop = sprop[3:]
return lambda a1, a2=None: CScite.pane_ScintillaSet(self.nPane, sprop, a1, a2)
else:
return lambda *args: CScite.pane_ScintillaFn(self.nPane, sprop, args)
raise exceptions.AttributeError
示例2: test_1_1
# 需要导入模块: import CScite [as 别名]
# 或者: from CScite import pane_ScintillaFn [as 别名]
def test_1_1():
CurrentPane.ClearAll()
expectEqual(CurrentPane.GetAllText(), "")
CurrentPane.Write("ab")
CurrentPane.Write("bc")
expectEqual(CurrentPane.GetAllText(), "abbc")
# append not affected by position
CurrentPane.ClearAll()
CurrentPane.Append("123")
CurrentPane.GotoPos(1)
CurrentPane.Append("456")
expectEqual(CurrentPane.GetAllText(), "123456")
# Write -is- affected by position
CurrentPane.ClearAll()
CurrentPane.Write("ABC")
CurrentPane.GotoPos(1)
CurrentPane.Write("DEF")
expectEqual(CurrentPane.GetAllText(), "ADEFBC")
CurrentPane.ClearAll()
CurrentPane.Write("aaaa")
CurrentPane.InsertText("bb", 2)
CurrentPane.InsertText("cc", 3)
expectEqual(CurrentPane.GetAllText(), "aabccbaa")
CurrentPane.ClearAll()
CurrentPane.Write("123456789")
CurrentPane.Remove(1, 1)
CurrentPane.Remove(3, 5)
expectEqual(CurrentPane.GetAllText(), "134789")
CurrentPane.ClearAll()
CurrentPane.Write("123456789")
expectEqual(CurrentPane.Textrange(1, 1), "")
expectEqual(CurrentPane.Textrange(1, 2), "2")
expectEqual(CurrentPane.Textrange(1, 3), "23")
expectEqual(CurrentPane.Textrange(2, 5), "345")
CurrentPane.ClearAll()
CurrentPane.Write("a teststringnotwhole teststring testStringnotwhole testString end")
expectEqual(CurrentPane.FindText("testString", wholeWord=True, matchCase=True), (51, 61))
expectEqual(CurrentPane.FindText("testString", matchCase=True), (32, 42))
expectEqual(CurrentPane.FindText("testString", wholeWord=True), (21, 31))
expectEqual(CurrentPane.FindText("testString"), (2, 12))
expectThrow((lambda: CScite.pane_ScintillaFn(3, "a", ("b", "C"))), "Invalid pane")
expectThrow((lambda: CurrentPane.NotAValid()), "Could not find fn.")
expectThrow((lambda: CurrentPane.SetNotAValid("f")), "Could not find prop.")
expectThrow((lambda: CurrentPane.GetNotAValid()), "Could not find prop.")
# scintilla fns
expectThrow((lambda: CurrentPane.ClearAll(1)), "Wrong # of args")
expectThrow((lambda: CurrentPane.SetWhitespaceBack(1, 1, 1)), "Wrong # of args")
expectThrow((lambda: CurrentPane.AppendText("a", "b", "c", "d")), "Wrong # of args")
expectThrow((lambda: CurrentPane.AppendText("a", "a")), "int expected")
expectThrow((lambda: CurrentPane.AppendText(False, False)), "string expected")
expectThrow((lambda: CurrentPane.MarkerAdd(1, 1, 1)), "Wrong # of args")
expectThrow((lambda: CurrentPane.CanRedo(None)), "Wrong # of args")
expectThrow((lambda: CurrentPane.CanRedo(0)), "Wrong # of args")
# scintilla get/set
expectThrow((lambda: CurrentPane.SetLineCount(4)), "prop can't be set")
expectThrow((lambda: CurrentPane.GetWhitespaceChars()), "prop can't be get")
expectThrow((lambda: CurrentPane.GetLineCount("a")), "property does not take params")
expectThrow((lambda: CurrentPane.GetLineCount(1)), "property does not take params")
expectThrow((lambda: CurrentPane.GetCharAt()), "prop needs param")
expectThrow((lambda: CurrentPane.GetCharAt("a")), "Int expected")
expectThrow((lambda: CurrentPane.SetStyleBold("a")), "prop needs param")
expectThrow((lambda: CurrentPane.SetStyleBold(True)), "prop needs param")
expectThrow((lambda: CurrentPane.SetViewEOL(1)), "Bool expected")
expectThrow((lambda: CurrentPane.SetViewEOL(True, 45)), "property does not take params")
示例3: LoadLexerLibrary
# 需要导入模块: import CScite [as 别名]
# 或者: from CScite import pane_ScintillaFn [as 别名]
def LoadLexerLibrary(self, s):
return CScite.pane_ScintillaFn(self.nPane, "LoadLexerLibrary", (None, s))
示例4: ReplaceSel
# 需要导入模块: import CScite [as 别名]
# 或者: from CScite import pane_ScintillaFn [as 别名]
def ReplaceSel(self, s):
return CScite.pane_ScintillaFn(self.nPane, "ReplaceSel", (None, s))
示例5: SetLexerLanguage
# 需要导入模块: import CScite [as 别名]
# 或者: from CScite import pane_ScintillaFn [as 别名]
def SetLexerLanguage(self, s):
return CScite.pane_ScintillaFn(self.nPane, "SetLexerLanguage", (None, s))
示例6: AutoCStops
# 需要导入模块: import CScite [as 别名]
# 或者: from CScite import pane_ScintillaFn [as 别名]
def AutoCStops(self, s):
return CScite.pane_ScintillaFn(self.nPane, "AutoCStops", (None, s))
示例7: AutoCSelect
# 需要导入模块: import CScite [as 别名]
# 或者: from CScite import pane_ScintillaFn [as 别名]
def AutoCSelect(self, s):
return CScite.pane_ScintillaFn(self.nPane, "AutoCSelect", (None, s))
示例8: CopyText
# 需要导入模块: import CScite [as 别名]
# 或者: from CScite import pane_ScintillaFn [as 别名]
def CopyText(self, s):
return CScite.pane_ScintillaFn(self.nPane, "CopyText", (len(s), s))
示例9: SetText
# 需要导入模块: import CScite [as 别名]
# 或者: from CScite import pane_ScintillaFn [as 别名]
def SetText(self, s):
return CScite.pane_ScintillaFn(self.nPane, "SetText", (None, s))
示例10: LoadLexerLibrary
# 需要导入模块: import CScite [as 别名]
# 或者: from CScite import pane_ScintillaFn [as 别名]
def LoadLexerLibrary(self, s): return CScite.pane_ScintillaFn(self.nPane, 'LoadLexerLibrary', (None, s))
# pane methods
def Append(self, txt): return CScite.pane_Append(self.nPane, txt)
示例11: test_1_1
# 需要导入模块: import CScite [as 别名]
# 或者: from CScite import pane_ScintillaFn [as 别名]
def test_1_1():
CurrentPane.ClearAll()
expectEqual(CurrentPane.GetAllText(), '')
CurrentPane.Write('ab'); CurrentPane.Write('bc')
expectEqual(CurrentPane.GetAllText(), 'abbc')
# append not affected by position
CurrentPane.ClearAll()
CurrentPane.Append('123'); CurrentPane.GotoPos(1); CurrentPane.Append('456')
expectEqual(CurrentPane.GetAllText(), '123456')
# Write -is- affected by position
CurrentPane.ClearAll()
CurrentPane.Write('ABC'); CurrentPane.GotoPos(1); CurrentPane.Write('DEF')
expectEqual(CurrentPane.GetAllText(), 'ADEFBC')
CurrentPane.ClearAll()
CurrentPane.Write('aaaa'); CurrentPane.InsertText('bb',2); CurrentPane.InsertText('cc',3)
expectEqual(CurrentPane.GetAllText(), 'aabccbaa')
CurrentPane.ClearAll()
CurrentPane.Write('123456789'); CurrentPane.Remove(1,1); CurrentPane.Remove(3,5)
expectEqual(CurrentPane.GetAllText(), '134789')
CurrentPane.ClearAll()
CurrentPane.Write('123456789');
expectEqual(CurrentPane.Textrange(1,1), ''); expectEqual(CurrentPane.Textrange(1,2), '2')
expectEqual(CurrentPane.Textrange(1,3), '23'); expectEqual(CurrentPane.Textrange(2,5), '345')
CurrentPane.ClearAll()
CurrentPane.Write('a teststringnotwhole teststring testStringnotwhole testString end');
expectEqual( CurrentPane.FindText('testString',wholeWord=True, matchCase=True), (51,61))
expectEqual( CurrentPane.FindText('testString',matchCase=True), (32,42))
expectEqual( CurrentPane.FindText('testString',wholeWord=True), (21,31))
expectEqual( CurrentPane.FindText('testString'), (2,12))
expectThrow( (lambda:CScite.pane_ScintillaFn(3, 'a', ('b','C'))), 'Invalid pane')
expectThrow( (lambda:CurrentPane.NotAValid()), 'Could not find fn.')
expectThrow( (lambda:CurrentPane.SetNotAValid('f')), 'Could not find prop.')
expectThrow( (lambda:CurrentPane.GetNotAValid()), 'Could not find prop.')
# scintilla fns
expectThrow( (lambda:CurrentPane.ClearAll(1)), 'Wrong # of args')
expectThrow( (lambda:CurrentPane.SetWhitespaceBack(1,1,1)), 'Wrong # of args')
expectThrow( (lambda:CurrentPane.AppendText('a','b','c','d')), 'Wrong # of args')
expectThrow( (lambda:CurrentPane.AppendText('a','a')), 'int expected')
expectThrow( (lambda:CurrentPane.AppendText(False,False)), 'string expected')
expectThrow( (lambda:CurrentPane.MarkerAdd(1,1,1)), 'Wrong # of args')
expectThrow( (lambda:CurrentPane.CanRedo(None)), 'Wrong # of args')
expectThrow( (lambda:CurrentPane.CanRedo(0)), 'Wrong # of args')
# scintilla get/set
expectThrow( (lambda:CurrentPane.SetLineCount(4)), 'prop can\'t be set')
expectThrow( (lambda:CurrentPane.GetWhitespaceChars()), 'prop can\'t be get')
expectThrow( (lambda:CurrentPane.GetLineCount('a')), 'property does not take params')
expectThrow( (lambda:CurrentPane.GetLineCount(1)), 'property does not take params')
expectThrow( (lambda:CurrentPane.GetCharAt()), 'prop needs param')
expectThrow( (lambda:CurrentPane.GetCharAt('a')), 'Int expected')
expectThrow( (lambda:CurrentPane.SetStyleBold('a')), 'prop needs param')
expectThrow( (lambda:CurrentPane.SetStyleBold(True)), 'prop needs param')
expectThrow( (lambda:CurrentPane.SetViewEOL(1)), 'Bool expected')
expectThrow( (lambda:CurrentPane.SetViewEOL(True, 45)), 'property does not take params')
示例12: SetLexerLanguage
# 需要导入模块: import CScite [as 别名]
# 或者: from CScite import pane_ScintillaFn [as 别名]
def SetLexerLanguage(self, s): return CScite.pane_ScintillaFn(self.nPane, 'SetLexerLanguage', (None, s))
def LoadLexerLibrary(self, s): return CScite.pane_ScintillaFn(self.nPane, 'LoadLexerLibrary', (None, s))
示例13: ReplaceSel
# 需要导入模块: import CScite [as 别名]
# 或者: from CScite import pane_ScintillaFn [as 别名]
def ReplaceSel(self, s): return CScite.pane_ScintillaFn(self.nPane, 'ReplaceSel', (None, s))
def SetLexerLanguage(self, s): return CScite.pane_ScintillaFn(self.nPane, 'SetLexerLanguage', (None, s))
示例14: AutoCSelect
# 需要导入模块: import CScite [as 别名]
# 或者: from CScite import pane_ScintillaFn [as 别名]
def AutoCSelect(self, s): return CScite.pane_ScintillaFn(self.nPane, 'AutoCSelect', (None, s))
def ReplaceSel(self, s): return CScite.pane_ScintillaFn(self.nPane, 'ReplaceSel', (None, s))
示例15: AutoCStops
# 需要导入模块: import CScite [as 别名]
# 或者: from CScite import pane_ScintillaFn [as 别名]
def AutoCStops(self, s): return CScite.pane_ScintillaFn(self.nPane, 'AutoCStops', (None, s))
def AutoCSelect(self, s): return CScite.pane_ScintillaFn(self.nPane, 'AutoCSelect', (None, s))