U E D R , A S I H C RSS

Py Ide/Scintilla


Scintilla € จ ฐธกฐ „ํํŠธ“ค. (Refactoring ํ•„š”)
PythonCard ˜ ฝ”“œ ฝ–ดณดฉด„œ ดšฉฐฉฒ•“ค„ ตํžˆฒŒ ˜—ˆ‹ค.

syntax hilighting …‹ํŒ…

Boa Constructor ‚˜ Pythoncard, wxPython ˜ samples ˜ StyleEditor “„ ณดฉด STCStyleEditor ชจ“ˆด žˆ‹ค. ด ชจ“ˆ—„œ initSTC ํ•จˆ˜ ‚ฌšฉํ•˜ฉด œ‹ค.
ํ™˜ฒฝ …‹ํŒ… ‹คด–กœทธ „šฐณ  ‹ถ‹คฉด STCStyleEditDlg ‚ฌšฉํ•œ‹ค.


~cpp 
stcControl = self
language = 'python'
configFileAbsolutePath = os.path.abspath("stc-styles.rc.cfg")

STCStyleEditor.STCStyleEditDlg(stcControl, language, configFileAbsolutePath)
try:
    dlg.ShowModal()
finally:
    dlg.Destroy()
stcControl.setDefaultStyles()

ปค„œ œ„˜ € จ ฉ”†Œ“œ“ค

GetCurrentPos()
LineFromPosition(aPos)
GetColumn(aPos)

Refactor ํ•  ฒƒ“ค


SetEdgeColumn(aCol)
GetModify() - ˆ˜ •ƒํ™ฉธ€ •„‹Œ€ ํ‘œ‹œ
setEditorStyle('python')
text
SetSavePoint()
SetUndoCollection(0)
ClearAll()
EmptyUndoBuffer()
SetUndoCollection(1)
SetSavePoint()
GotoLine(lineNum - 1)

CmdKeyExecute(stc.wxSTC_CMD_TAB)
CmdKeyExecute(stc.wxSTC_CMD_BACKTAB)

sel=GetSelection()
LineFromPosition(sel0)
LineFromPosition(sel1)
if end > start and doc.GetColumn(sel1) == 0:
end = end-1

BeginUndoAction()
firstChar = PositionFromLine(lineNumber)
InsertText(firstChar, "##")
SetCurrentPos(PositionFromLine(start))
SetAnchor(GetLineEndPosition(end))
EndUndoAction()

SetCurrentPos(aPos)
GetCharAt(aPos)
DelLineLeft()

SetViewWhiteSpace(boolean)
SetIndentationGuides(boolean)
SetEdgeMode(stc.wxSTC_EDGE_LINE)
SetEdgeMode(stc.wxSTC_EDGE_NONE)
getStyleConfigPath()


SetWrapMode(boolean)

CmdKeyExecute(stc.wxSTC_CMD_NEWLINE)
indent = GetLineIndentation(line)
padding = " " * indent
pos = GetCurrentPos()

GetStyleAt(colonPos) not in [stc.wxSTC_P_COMMENTLINE,
stc.wxSTC_P_COMMENTBLOCK,
stc.wxSTC_P_TRIPLEDOUBLE]:
padding += " " * 4
InsertText(pos, padding)
newpos = pos + len(pandding)
SetCurrentPos(newpos)
SetSelection(newpos, newpos)


Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:24:08
Processing time 0.0165 sec