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