B PоmýcÀã@s2dZddlTdZdZdZdZdZGdd „d ƒZd S) a—DetailsViewer class. This class implements a pure input window which allows you to meticulously edit the current color. You have both mouse control of the color (via the buttons along the bottom row), and there are keyboard bindings for each of the increment/decrement buttons. The top three check buttons allow you to specify which of the three color variations are tied together when incrementing and decrementing. Red, green, and blue are self evident. By tying together red and green, you can modify the yellow level of the color. By tying together red and blue, you can modify the magenta level of the color. By tying together green and blue, you can modify the cyan level, and by tying all three together, you can modify the grey level. The behavior at the boundaries (0 and 255) are defined by the `At boundary' option menu: Stop When the increment or decrement would send any of the tied variations out of bounds, the entire delta is discarded. Wrap Around When the increment or decrement would send any of the tied variations out of bounds, the out of bounds variation is wrapped around to the other side. Thus if red were at 238 and 25 were added to it, red would have the value 7. Preserve Distance When the increment or decrement would send any of the tied variations out of bounds, all tied variations are wrapped as one, so as to preserve the distance between them. Thus if green and blue were tied, and green was at 238 while blue was at 223, and an increment of 25 were applied, green would be at 15 and blue would be at 0. Squash When the increment or decrement would send any of the tied variations out of bounds, the out of bounds variation is set to the ceiling of 255 or floor of 0, as appropriate. In this way, all tied variations are squashed to one edge or the other. The following key bindings can be used as accelerators. Note that Pynche can fall behind if you hold the key down as a key repeat: Left arrow == -1 Right arrow == +1 Control + Left == -10 Control + Right == 10 Shift + Left == -25 Shift + Right == +25 é)Ú*ZStopz Wrap AroundzPreserve DistanceZSquashzDetails Window...c@s’eZdZddd„Zddd„Zd dd„Zd!dd „Zd"d d „Zd#d d „Zd$dd„Z d%dd„Z d&dd„Z d'dd„Z d(dd„Z dd„Zdd„Zdd„ZdS))Ú DetailsViewerNcCsˆ||_| ¡}| ¡\|_|_|_t|dd}|_| d|j ¡|  d¡|  d¡|  d|j ¡|  d|j ¡|  d|j ¡|  d|j ¡|  d |j¡|  d |j¡|  d |j¡|  d |j¡|  d |j¡|  d|j¡t|ƒ}|_|jttdt|dd|_|jjddtdtƒ|_|j |  dd¡¡t!|d|j|j"ddd|_#|j#jddt$dtƒ|_%|j% |  dd¡¡t!|d|j%|j"ddd|_&|j&jddt$dtƒ|_'|j' |  dd¡¡t!|d|j'|j"ddd|_(|j(jddt$dt|ƒ|_)|j)jddt$d| "¡t|dd|_*|j*jd dtdt+ƒ|_,|j, |  d!t-¡¡t.||j,t-t/t0t1ƒ|_2|j2jd dt$d|j2j3d"d#t|ƒ}|_4|jdddd$d%t5|d&|jd'|_6t5|d(|jd'|_7t5|d)|jd'|_8t5|d*|jd'|_9t5|d+|jd'|_:t5|d,|jd'|_;|j6jtttzzzzzzzzz)ÚexpandÚfillz Move Sliders:)Útextér)ÚrowÚcolumnÚstickyÚRSLIDERéZRed)rZvariableÚcommandZonvalueZoffvalueÚGSLIDERéZGreenÚBSLIDERZBlueéz At boundary:éÚATBOUNDé)ÚwidthZEW)rr Z columnspanr z-25)rr z-10z-1z+1z+10z+25)rrZside)=Ú_DetailsViewer__sbÚoptiondbZ current_rgbÚ_DetailsViewer__redÚ_DetailsViewer__greenÚ_DetailsViewer__blueZToplevelÚ_DetailsViewer__rootZprotocolÚwithdrawÚtitleZiconnameZbindÚ_DetailsViewer__quitÚ_DetailsViewer__minus1Ú_DetailsViewer__plus1Ú_DetailsViewer__minus10Ú_DetailsViewer__plus10Ú_DetailsViewer__minus25Ú_DetailsViewer__plus25ZFrameZ_DetailsViewer__frameZpackZYESÚXZLabelZ_DetailsViewer__l1ZgridÚEZIntVarÚ_DetailsViewer__rvarÚsetÚgetZ CheckbuttonÚ_DetailsViewer__effectZ_DetailsViewer__radio1ÚWÚ_DetailsViewer__gvarZ_DetailsViewer__radio2Ú_DetailsViewer__bvarZ_DetailsViewer__radio3Ú_DetailsViewer__l2Z_DetailsViewer__l3Z StringVarÚ_DetailsViewer__boundvarÚSTOPZ OptionMenuÚWRAPÚRATIOÚGRAVZ_DetailsViewer__omenuÚ configureZ_DetailsViewer__btnframeZButtonZ_DetailsViewer__down25Z_DetailsViewer__down10Z_DetailsViewer__down1Z_DetailsViewer__up1Z_DetailsViewer__up10Z_DetailsViewer__up25ZLEFT)ÚselfZ switchboardZmasterrÚrootÚframe©r8ú?/opt/alt/python37/lib64/python3.7/Tools/pynche/DetailsViewer.pyÚ__init__Bs’            zDetailsViewer.__init__cCsT|j ¡|j ¡|j ¡}|dkr,d}nddddddœ|}|jj|d dS) N)rrrr Úz (= %s Level)ZCyanZMagentaZYellowZGrey)rréé)r)r'r)r,r-r.r4)r5ÚeventÚtierr8r8r9Z__effect•szDetailsViewer.__effectcCs|j ¡dS)N)rÚquit)r5r>r8r8r9Z__quit szDetailsViewer.__quitcCs|j ¡dS)N)rr)r5r>r8r8r9r£szDetailsViewer.withdrawcCs|j ¡dS)N)rÚ deiconify)r5r>r8r8r9rA¦szDetailsViewer.deiconifycCs| d¡dS)Niçÿÿÿ)Ú_DetailsViewer__delta)r5r>r8r8r9Z __minus25©szDetailsViewer.__minus25cCs| d¡dS)Niöÿÿÿ)rB)r5r>r8r8r9Z __minus10¬szDetailsViewer.__minus10cCs| d¡dS)Néÿÿÿÿ)rB)r5r>r8r8r9Z__minus1¯szDetailsViewer.__minus1cCs| d¡dS)Nr)rB)r5r>r8r8r9Z__plus1²szDetailsViewer.__plus1cCs| d¡dS)Né )rB)r5r>r8r8r9Z__plus10µszDetailsViewer.__plus10cCs| d¡dS)Né)rB)r5r>r8r8r9Z__plus25¸szDetailsViewer.__plus25c CsÆg}|j ¡r$|j|}| |¡n|j}|j ¡rJ|j|}| |¡n|j}|j ¡rp|j|}| |¡n|j}|j ¡}|t krÒ|dks¸|dks¸|dks¸|dks¸|dks¸|dkrÎ|j|j|j}}}nÖ|t ksò|t krbt |ƒdkrb|dkr|d7}|dkr|d7}|dkr(|d7}|dkr:|d8}|dkrL|d8}|dkr¨|d8}nF|t krJd}x,|D]$}|dkrŠd}n|dkrvd}qvW|dkrút |ƒ}|j ¡rÈ|d|}|j ¡rà|d|}|j ¡rH|d|}nN|dkr¨t|ƒ}|j ¡r ||}|j ¡r4||}|j ¡r¨||}n^|tkr¨|dkrbd}|dkrpd}|dkr~d}|dkrŒd}|dkršd}|dkr¨d}|j |||¡|j ¡dS)NréÿrérCr)r'r)rÚappendr,rr-rr/r0r1r2ÚlenÚmaxÚminr3rZ update_viewsrZupdate_idletasks) r5Zdeltar?ÚredÚgreenÚblueZatboundÚdirÚcr8r8r9Z__delta»sŠ                                         zDetailsViewer.__deltacCs||_||_||_dS)N)rrr)r5rLrMrNr8r8r9Úupdate_yourselfszDetailsViewer.update_yourselfcCs<|j ¡|d<|j ¡|d<|j ¡|d<|j ¡|d<dS)Nr rrr)r'r)r,r-r/)r5rr8r8r9Ú save_options szDetailsViewer.save_options)N)N)N)N)N)N)N)N)N)N)N)Ú__name__Ú __module__Ú __qualname__r:r*rrrAr#r!rr r"r$rBrQrRr8r8r8r9rAs S         MrN)Ú__doc__Ztkinterr0r1r2r3Z ADDTOVIEWrr8r8r8r9Ú5s