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