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.0142 sec