;ò ±¿Ac@sådkZdkZdkiZdeifd„ƒYZddeiffddeiffddei d d ffd d ei ffdd effgZ ddei ffddei ddffddei ffddeiffdd eiffddeiddddddddgeffgZd d!eiei fd"d ei eifgZd#eifd$„ƒYZd%eifd&„ƒYZed'joBdkZeiƒZeeeiƒZeie ƒei!ƒndS((NsMyCustomRenderercBs,tZd„Zd„Zd„Zd„ZRS(NcCstii|ƒdS(N(sgridlibsPyGridCellRenderers__init__sself(sself((sm/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/GridStdEdRend.pys__init__ scCs |itiƒ|itititiƒƒ|itiƒ|i |ƒ|iti ƒ|i |iƒƒ|i||ƒ} dddg} |id}|id} xo| D]g}|iti| ƒƒ|i||| ƒ|i|ƒ\} } || }||idjoPq±q±WdS(NsREDsWHITEsSKY BLUEii( sdcsSetBackgroundModeswxsSOLIDsSetBrushsBrushsBLACKsSetPensTRANSPARENT_PENsDrawRectangleRectsrects TRANSPARENTsSetFontsattrsGetFontsgrids GetCellValuesrowscolstextscolorssxsyschsSetTextForegroundsrandomschoicesDrawTexts GetTextExtentswshsright(sselfsgridsattrsdcsrectsrowscols isSelectedschstextscolorsswshsysx((sm/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/GridStdEdRend.pysDraw s$    c CsN|i||ƒ}|i|iƒƒ|i |ƒ\}}t i ||ƒSdS(N(sgrids GetCellValuesrowscolstextsdcsSetFontsattrsGetFonts GetTextExtentswshswxsSize( sselfsgridsattrsdcsrowscolstextswsh((sm/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/GridStdEdRend.pys GetBestSize$scCs tƒSdS(N(sMyCustomRenderer(sself((sm/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/GridStdEdRend.pysClone+s(s__name__s __module__s__init__sDraws GetBestSizesClone(((sm/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/GridStdEdRend.pysMyCustomRenderer s   s$GridCellStringRenderer (the default)sthis is a text valuesGridCellNumberRenderers12345sGridCellFloatRenderers 1234.5678iisGridCellBoolRenderers1sThis is my renderers GridCellTextEditor (the default)sHere is some more texts!GridCellNumberEditor with min,maxs101ii's#GridCellNumberEditor without boundssGridCellFloatEditorsGridCellBoolEditorsGridCellChoiceEditorsonestwosthreesfourskicks Microsoftsout thesdoors+GridCellNumberRenderer GridCellNumberEditors20792s'GridCellBoolRenderer GridCellBoolEditorsEditorsAndRenderersGridcBstZd„Zd„ZRS(NcCsÂtii||dƒ||_|iddƒd}d} |i d|dƒ|i d| dƒ|i d |d ƒd }xqt D]i\}}} } | | Œ}|i |||ƒ|i ||d|ƒ|i||d|ƒ|d }qWd }xqtD]i\}}}} || Œ} |i || |ƒ|i || d|ƒ|i|| d| ƒ|d }qûWd }xŽtD]†\}}}}|i |||ƒ|i ||d|ƒ|ƒ} |ƒ}|i||d| ƒ|i||d|ƒ|d }quW|iƒ}|itiƒtiƒ} | i |ƒ| i!ti"ƒ| i#t$ƒ| i%ti&dƒ|i'|| ƒ| i(ƒ|i'| | ƒ|i)t$ƒ|i*t$ƒ|i+ti,|i-ƒdS( NiÿÿÿÿiiiiisøCell Renderers are used to draw the contents of the cell when they need to be refreshed. Different types of Renderers can be plugged in to different cells in the grid, it can even be automatically determined based on the type of data in the cell. sÒCell Editors are used when the value of the cell is edited by the user. An editor class is wrapped around a an object derived from wxControl and it implements some methods required to integrate with the grid. isCHere are some combinations of Editors and Renderers used together. ii(.sgridlibsGrids__init__sselfsparentslogs CreateGridsrenColsedCols SetCellValuesrowsrendererDemoDataslabelsvalues renderClasssargssrenderersSetCellRendererseditorDemoDatas editorClassseditors SetCellEditors comboDemoDatasrenClasssedClasssGetFontsfonts SetWeightswxsBOLDs GridCellAttrsattrsSetFontsSetBackgroundColours LIGHT_GREYs SetReadOnlysTrues SetAlignmentsRIGHTs SetColAttrsIncRefsAutoSizeColumnss AutoSizeRowssBindsEVT_GRID_CELL_LEFT_DCLICKs OnLeftDClick(sselfsparentslogs editorClasssrenderersfontsedClasssrowslabelsedCols renderClassseditorsargssattrsvaluesrenColsrenClass((sm/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/GridStdEdRend.pys__init__Ksd               cCs|iƒo|iƒndS(N(sselfsCanEnableCellControlsEnableCellEditControl(sselfsevt((sm/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/GridStdEdRend.pys OnLeftDClick s (s__name__s __module__s__init__s OnLeftDClick(((sm/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/GridStdEdRend.pysEditorsAndRenderersGridJs Us TestFramecBstZd„ZRS(NcCs8tii||dddddfƒt||ƒ}dS(NiÿÿÿÿsEditors and Renderers Demossizei€ià(swxsFrames__init__sselfsparentsEditorsAndRenderersGridslogsgrid(sselfsparentslogsgrid((sm/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/GridStdEdRend.pys__init__¨s%(s__name__s __module__s__init__(((sm/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/GridStdEdRend.pys TestFrame§ss__main__("srandomswxswx.gridsgridsgridlibsPyGridCellRenderersMyCustomRenderersGridCellStringRenderersGridCellNumberRenderersGridCellFloatRenderersGridCellBoolRenderersrendererDemoDatasGridCellTextEditorsGridCellNumberEditorsGridCellFloatEditorsGridCellBoolEditorsGridCellChoiceEditorsFalseseditorDemoDatas comboDemoDatasGridsEditorsAndRenderersGridsFrames TestFrames__name__ssyss PySimpleAppsappsNonesstdoutsframesShowsTruesMainLoop( seditorDemoDatasMyCustomRenderersappsrandomsrendererDemoDatas TestFrames comboDemoDatassyssgridlibsEditorsAndRenderersGridsframeswx((sm/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/GridStdEdRend.pys?s   (c– 0]