;ò c®Bc@sýdkZdkiZdkZdZdZeidjodZdZdZ dZ ndZd Zd Z d Z d ei fd „ƒYZ dZ d„ZdZedjoPdkZdkZdkZeideiieidƒgeidƒndS(Nis(This editor is provided by a class named wx.StyledTextCtrl. As the name suggests, you can define styles that can be applied to sections of text. This will typically be used for things like syntax highlighting code editors, but I'm sure that there are other applications as well. A style is a combination of font, point size, foreground and background colours. The editor can handle proportional fonts just as easily as monospaced fonts, and various styles can use different sized fonts. There are a few canned language lexers and colourizers included, (see the next demo) or you can handle the colourization yourself. If you do you can simply register an event handler and the editor will let you know when the visible portion of the text needs styling. wx.StyledTextEditor also supports setting markers in the margin... ...and indicators within the text. You can use these for whatever you want in your application. Cut, Copy, Paste, Drag and Drop of text works, as well as virtually unlimited Undo and Redo capabilities, (right click to try it out.) s __WXMSW__sArialsTimes New Romans Courier Newi s HelveticasTimessCourieri sMySTCcBsGtZd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(NcCs‘tii|||ƒ||_|iti|i ƒ|iti |i ƒ|iti |i ƒ|iti|iƒ|iti|iƒdS(N(sstcsStyledTextCtrls__init__sselfsparentsIDslogsBindsEVT_STC_DO_DROPsOnDoDropsEVT_STC_DRAG_OVERs OnDragOversEVT_STC_START_DRAGs OnStartDragsEVT_STC_MODIFIEDs OnModifiedswxsEVT_WINDOW_DESTROYs OnDestroy(sselfsparentsIDslog((sp/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/StyledTextCtrl_1.pys__init__<s cCstiiƒ|iƒdS(N(swxs TheClipboardsFlushsevtsSkip(sselfsevt((sp/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/StyledTextCtrl_1.pys OnDestroyGs cCsb|iid|iƒ|iƒfƒto|iƒdjo|it ƒ|i dƒndS(NsOnStartDrag: %d, %s iús DRAGGED TEXT( sselfslogswritesevtsGetDragAllowMoves GetDragTextsdebugs GetPositionsSetDragAllowMovesFalses SetDragText(sselfsevt((sp/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/StyledTextCtrl_1.pys OnStartDragNs& cCsj|iid|iƒ|iƒ|iƒ|iƒfƒto|iƒdjo|i t i ƒndS(Ns2OnDragOver: x,y=(%d, %d) pos: %d DragResult: %d iú( sselfslogswritesevtsGetXsGetYs GetPositions GetDragResultsdebugs SetDragResultswxsDragNone(sselfsevt((sp/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/StyledTextCtrl_1.pys OnDragOverXs8cCsp|iid|iƒ|iƒ|iƒ|iƒ|iƒfƒt o|iƒdjo|i dƒndS(Ns:OnDoDrop: x,y=(%d, %d) pos: %d DragResult: %d text: %s iôs DROPPED TEXT( sselfslogswritesevtsGetXsGetYs GetPositions GetDragResults GetDragTextsdebugs SetDragText(sselfsevt((sp/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/StyledTextCtrl_1.pysOnDoDropbsAcCsT|iid|i|iƒƒ|iƒ|iƒ|iƒt |i ƒƒfƒdS(NsˆOnModified Mod type: %s At position: %d Lines added: %d Text Length: %d Text: %s ( sselfslogswrites transModTypesevtsGetModificationTypes GetPositions GetLinesAddeds GetLengthsreprsGetText(sselfsevt((sp/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/StyledTextCtrl_1.pys OnModifiedtsc CsÞd}tidftidftidftidftidftidftidfti d fti d fti d fti d fg }x1|D])\}}||@o||d }q—q—W| o d}n|SdS(Nss InsertTexts DeleteTexts ChangeStyles ChangeFoldsUserFlagsUndosRedosLast-Undo/Redos ChangeMarkers B4-Inserts B4-Deletes sUNKNOWN(sstsstcsSTC_MOD_INSERTTEXTsSTC_MOD_DELETETEXTsSTC_MOD_CHANGESTYLEsSTC_MOD_CHANGEFOLDsSTC_PERFORMED_USERsSTC_PERFORMED_UNDOsSTC_PERFORMED_REDOsSTC_LASTSTEPINUNDOREDOsSTC_MOD_CHANGEMARKERsSTC_MOD_BEFOREINSERTsSTC_MOD_BEFOREDELETEstablesflagstextsmodType(sselfsmodTypestextsstsflagstable((sp/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/StyledTextCtrl_1.pys transModTypesŠ    ( s__name__s __module__s__init__s OnDestroys OnStartDrags OnDragOversOnDoDrops OnModifieds transModType(((sp/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/StyledTextCtrl_1.pysMySTC;s   c Cs¨t ot|d|ƒ}} npti|ddtiƒ} t| d|ƒ}ti ti ƒ} | i |dti ƒ| i| ƒ| itƒ|itƒtio…dk} | idƒd}|i|iƒƒ|idƒ|iƒ}|dƒ\}} |idƒ|i|ƒ|idƒn|iƒ|it i!d t"t#fƒ|i$ƒ|idd t"d t%fƒ|id d t&t"fƒ|id dt&t"d fƒ|iddt%t"dfƒ|i'ddƒ|i(ddƒ|i'ddƒ|i(dd ƒ|i'ddƒ|i(dd ƒ|i(d dƒ|i(ddƒ|i)dt i*ƒ|i+ddƒ|it i,d t"t%fƒ|i)dt i-ƒ|i.dt i/ddƒ|i.dt i0ddƒ|i.d t i1ddƒ|i.d t i2ddƒ|i3ddƒ|i3d dƒ|i3d!d ƒ|i3dd ƒ|i3ddƒ|i4dt i5ƒ|i6dti7ƒ|i4dt i8ƒ|i6dti9ƒ|i4d t i:ƒ|i6d ti7ƒ|i'd"t i;ƒ|i(dt i<ƒ|i(dt i=ƒ|i(dt i>t i=Bƒt?ohd#G|i@ƒGtA|iBƒƒGHd$GtC|iBƒƒGHHd%GtC|iDdd&ƒƒGtA|iDdd&ƒƒGHHd'GtC|iEƒƒGH|id(ƒd'GtC|iEƒƒGHHd)GtC|iFdƒƒGHH|iGd*d+ƒd,GtC|iHƒƒGHd-GtC|iId*d+ƒƒGHd.G|iJd|i@ƒd/ƒGHtioD|iƒ}|iL|ƒ}d0||fGtC|iI||ƒƒGHqntiN|idƒ| SdS(1Niÿÿÿÿsstyleisutf-8s) wx.StyledTextCtrl can also do Unicode: sFПитон - лучший Ñзык программированиÑ! s Russian: issize:%d,face:%ss!size:%d,bold,face:%s,fore:#0000FFis#face:%s,italic,fore:#FF0000,size:%disface:%s,bold,size:%disface:%s,size:%dibiÿii¾ii6i is#CCFF00sREDs FOREST GREENsSIENNAsblues#00FF00iiiiDsGetTextLength(): s GetText(): sGetStyledText(98, 104): ihsGetCurLine(): is GetLine(1): ii#sGetSelectedText(): sGetTextRange(25, 35): s FindText(0, max, 'indicators'): s indicatorssGetTextRange(%d, %d): (Os _USE_PANELsMySTCsnbslogsedspswxsPanelsNO_FULL_REPAINT_ON_RESIZEsBoxSizers HORIZONTALsssAddsEXPANDsSetSizers SetAutoLayoutsTruesSetTextsdemoTexts USE_UNICODEscodecsslookupsdecodesGotoPoss GetLengthsAddTextsGetCurrentLinesunilinesunitextslsEmptyUndoBuffers StyleSetSpecsstcsSTC_STYLE_DEFAULTspbsface3s StyleClearAllsface1sface2s StartStylings SetStylings SetMarginTypesSTC_MARGIN_NUMBERsSetMarginWidthsSTC_STYLE_LINENUMBERsSTC_MARGIN_SYMBOLs MarkerDefinesSTC_MARK_ROUNDRECTsSTC_MARK_CIRCLEsSTC_MARK_SHORTARROWsSTC_MARK_ARROWs MarkerAddsIndicatorSetStylesSTC_INDIC_SQUIGGLEsIndicatorSetForegroundsREDsSTC_INDIC_DIAGONALsBLUEsSTC_INDIC_STRIKEsSTC_INDICS_MASKsSTC_INDIC0_MASKsSTC_INDIC1_MASKsSTC_INDIC2_MASKsdebugs GetTextLengthslensGetTextsreprs GetStyledTexts GetCurLinesGetLines SetSelectionsGetSelectedTexts GetTextRangesFindTextsendsPositionFromLinesstarts CallAfter( sframesnbslogsedsunilinesunitextsdecodesendsstartscodecsslspss((sp/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/StyledTextCtrl_1.pysrunTest s¢           1   sÀ Once again, no docs yet. Sorry. But this and this should be helpful. s__main__si(swxswx.stcsstcsimagessdebugsdemoTextsPlatformsface1sface2sface3spbsStyledTextCtrlsMySTCs _USE_PANELsrunTestsoverviews__name__ssyssossrunsmainspathsbasenamesargv(srunTestsdemoTextsrunsossstcs _USE_PANELsMySTCspbsdebugssyssface1sface2sface3simagessoverviewswx((sp/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/StyledTextCtrl_1.pys?s*    c Ž