;ò “†¹Cc@s½dkZdkZdkZdeifd„ƒYZdeifd„ƒYZd„ZdZe djoPdk Z dk Z dk Z e i de iie id ƒge id ƒndS( Ns TestWindowcBs;tZd„Zd„Zd„Zd„Zeed„ZRS(NcCs-tii||dƒtiiiƒ|_t i ƒ|_ ti dti titiƒ|_ti|ƒ}|i|iƒ|idƒ\}}}}|||_|id|_||_d}|i|i|i|t|iƒdƒ|itiƒ|i ti!|i"ƒ|i ti#|i$ƒdS(Niÿÿÿÿi sWyiii(%swxsScrolledWindows__init__sselfsparentslibscolourdbs getColourListsclrListsimagessgetGridBGBitmapsbg_bmpsFontsSWISSsNORMALsfontsClientDCsdcsSetFontsGetFullTextExtentswshsdses textHeights lineHeights cellWidthsnumCellss SetScrollbarsslensSetBackgroundStylesBG_STYLE_CUSTOMsBinds EVT_PAINTsOnPaintsEVT_ERASE_BACKGROUNDsOnEraseBackground(sselfsparentsesdshsdcswsnumCells((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ColourDB.pys__init__ s$  )c CsÜ|iƒ}|iiƒ} |iiƒ}|iƒ\}}|i ƒ\}} ||| || |f\}}| } x^| |ijoM| } x5| |ijo$|i|i| | ƒ| |} q”W| | } qzWdS(N(sselfs GetClientSizesszsbg_bmpsGetWidthsws GetHeightshsGetScrollPixelsPerUnitsspxsspys GetViewStartsvsxsvsysdxsdysxswidthsysheightsdcs DrawBitmap( sselfsdcsspxsszsdxsspysvsxshsdyswsvsysysx((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ColourDB.pysTileBackground>s "cCsW|iƒ}| o2ti|ƒ}|iƒiƒ}|i |ƒn|i |ƒdS(N( sevtsGetDCsdcswxsClientDCsselfsGetUpdateRegionsGetBoxsrectsSetClippingRectsTileBackground(sselfsevtsdcsrect((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ColourDB.pysOnEraseBackgroundSs  cCs?ti|ƒ}|i|ƒ|i||iƒ|iƒƒdS(N(swxsPaintDCsselfsdcs PrepareDCsDrawsGetUpdateRegions GetViewStart(sselfsevtsdc((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ColourDB.pysOnPaint^s cCsy|iƒ|idƒ|itiddtiƒƒ|i|i ƒ|i }t |ƒ}|oS|iƒ} |d|i| i} | | i}| |id}||i}n d}|}x§ttd|ƒt||ƒƒD]„} || }| d|id} |i||i| ƒti |tiƒ} |i"| ƒ|i#d|i| d|i|i$ƒqãW|i%ƒdS(NsBLACKiiii i(&sdcs BeginDrawingsSetTextForegroundsSetPenswxsPensSOLIDsSetFontsselfsfontsclrListscoloursslens numColourssrgnsGetBoxsrectsvss lineHeightsyspixStartsheightspixStopsstartsstopsrangesmaxsminslinesclrsDrawTexts cellWidthsBrushsbrushsSetBrushs DrawRectangles textHeights EndDrawing(sselfsdcsrgnsvsspixStopsstartsstops numColoursscoloursspixStartsbrushsrectsyslinesclr((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ColourDB.pysDrawds0      "  (s__name__s __module__s__init__sTileBackgroundsOnEraseBackgroundsOnPaintsNonesDraw(((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ColourDB.pys TestWindow s  3  s TestPanelcBstZd„Zd„ZRS(NcCs?tii||dƒt|ƒ|_|iti|i ƒdS(Niÿÿÿÿ( swxsPanels__init__sselfsparents TestWindowswinsBindsEVT_SIZEsOnSize(sselfsparent((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ColourDB.pys__init__ŠscCs|ii|iƒƒdS(N(sselfswinsSetSizesevtsGetSize(sselfsevt((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ColourDB.pysOnSizes(s__name__s __module__s__init__sOnSize(((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ColourDB.pys TestPanel‰s cCs$tiiiƒt|ƒ}|SdS(N(swxslibscolourdbsupdateColourDBs TestPanelsnbswin(sframesnbslogswin((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ColourDB.pysrunTest˜s s& ColourDB

wxWindows maintains a database of standard RGB colours for a predefined set of named colours (such as "BLACK'', "LIGHT GREY''). The application may add to this set if desired by using Append. There is only one instance of this class: TheColourDatabase.

The colourdb library is a lightweight API that pre-defines a multitude of colors for you to use 'out of the box', and this demo serves to show you these colors (it also serves as a handy reference).

A secondary benefit of this demo is the use of the ScrolledWindow class and the use of various *DC() classes, including background tiling and the use of font data to generate a "building block" type of construct for repetitive use.

Important note

With implementation of V2.5 and later, it is required to have a wx.App already initialized before wx.updateColourDB() can be called. Trying to do otherwise will cause an exception to be raised. s__main__sii(swxswx.lib.colourdbsimagessScrolledWindows TestWindowsPanels TestPanelsrunTestsoverviews__name__ssyssossrunsmainspathsbasenamesargv( ssyssrunsoverviewsrunTests TestWindowsimagesswxsoss TestPanel((sh/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/ColourDB.pys?s