; iDc@sdkTdkTdkZdkZdklZdkZdkZdkZdk Z dZ dfdYZ de fdYZ de fd YZ d fd YZd e efd YZde efdYZde efdYZdfdYZdfdYZdfdYZdeifdYZdfdYZdfdYZdfdYZd eefd!YZd"eefd#YZd$eefd%YZd&eefd'YZ d(efd)YZ!d*eefd+YZ"d,eefd-YZ#d.eefd/YZ$d0e%fd1YZ&e'd2joe&Z(e(i)ndS(3(s*N(saskcolorcCs/t||}ti|i|_|SdS(N(stypesvarsvalsresultscopys__dict__(svarsvalsresult((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pys typed_assign2ss TkStringEntrycBs;tZdZdZdZdZdZdZRS(s"Tk entry field for editing stringscCst|d|dt|_dS(Nswidthsexportselection(sEntrysmasterswidthsFALSEsselfs entryWidget(sselfsmasterswidth((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pys__init__=scCs |iSdS(N(sselfs entryWidget(sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pystkWidget@scCs|iiSdS(N(sselfs entryWidgetsget(sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pysgetCscCs.|iidt|iidd|dS(Nis%s(sselfs entryWidgetsdeletesENDsinsertsvalue(sselfsvalue((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pyssetFscCs$|iidd|iidS(Nisend(sselfs entryWidgetsselection_ranges focus_set(sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pysselectJs(s__name__s __module__s__doc__s__init__stkWidgetsgetssetsselect(((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pys TkStringEntry:s     s TkIntEntrycBstZdZdZRS(s&Tk entry field for editing one integercCst|iiSdS(N(sintsselfs entryWidgetsget(sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pysgetRs(s__name__s __module__s__doc__sget(((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pys TkIntEntryOs s TkFloatEntrycBstZdZdZRS(s$Tk entry field for editing one floatcCst|iiSdS(N(sfloatsselfs entryWidgetsget(sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pysgetYs(s__name__s __module__s__doc__sget(((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pys TkFloatEntryVs sTkDefaultMixincBs;tZdZdZdZdZdZdZRS(sMixin for TkStringEntry, TkIntEntry, TkFloatEntry, ... to deal with values which have an externally defined default value. Combination of 'use default' checkbox and corresponding entry field c Cst|dt|_t|_|ii|||_t |iddd|id|i }|i ddddd d d d d t dS(Nsreliefstexts Use defaultsvariablescommandsrowiscolumnspadxispadyissticky(sFramesmastersFLATsselfsframesIntVars useDefaultssets defaultValues Checkbuttons toggleDefaultsuseDefaultButtonsgridsW(sselfsmasters useDefaults defaultValuesuseDefaultButton((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pys__init__bs   c CsE|iiddddddddd t|i|iidS( Nsrowiscolumnispadxispadyissticky(sselfs entryWidgetsgridsWs switchDefaults useDefaultsget(sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pysfinishls+cCs|iiSdS(N(sselfs useDefaultsget(sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pys UseDefaultpscCse|djo4t|id<|iidt|i|in!|iidtt|idssheightiswidth(s value2popsselfs pop2values StringVars popupvaluessetskeysssortsmapspopssmasterstuplesargssapplys OptionMenustkwidgetsconfigswidth(sselfsmasters value2pops pop2valueswidthskeyssargsspops((s value2popsG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pys__init__s    cCs |iSdS(N(sselfstkwidget(sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pystkWidgetscCs|i|iiSdS(N(sselfs pop2values popupvaluesget(sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pysgetscCsFy|ii|i|Wn$|ii|iidnXdS(Ni(sselfs popupvaluessets value2popsvalues pop2valueskeys(sselfsvalue((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pyssetscCsdS(N((sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pysselects(s__name__s __module__s__init__stkWidgetsgetssetsselect(((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pysTkPopupSelectors     sTkStringPopupSelectorcBs5tZdZdZdZdZdZRS(NcCs||_t|_t|idjo|ii|idnttt|i}||ift |i}t t ||_|iiddd|dS(Nisheightiswidth(sstringssselfs StringVars popupvalueslenssetsmaxsmapswidthsmasterstuplesargssapplys OptionMenustkwidgetsconfig(sselfsmastersstringssargsswidth((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pys__init__s  cCs |iSdS(N(sselfstkwidget(sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pystkWidgetscCs|iiSdS(N(sselfs popupvaluesget(sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pysgetscCs9y|ii|Wn|ii|idnXdS(Ni(sselfs popupvaluessetsvaluesstrings(sselfsvalue((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pyssetscCsdS(N((sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pysselects(s__name__s __module__s__init__stkWidgetsgetssetsselect(((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pysTkStringPopupSelectors    sTkColorSelectorcBsAtZddZdZdZdZdZdZRS(Nsblackc CsNt|dddddtdd|_|iid|i|i|dS( Nsheightiswidthi<sreliefs borderwidthis( sFramesmastersRIDGEsselfstkwidgetsbinds editColorssetscolor(sselfsmasterscolor((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pys__init__s'cCs5t|id}|tj o|i|ndS(Ni(saskcolorsselfscolorsNonesset(sselfseventscolor((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pys editColors cCs |iSdS(N(sselfstkwidget(sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pystkWidgetscCs |iSdS(N(sselfscolor(sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pysgetscCs#||_|iid|idS(Nsbg(svaluesselfscolorstkwidgetsconfig(sselfsvalue((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pyssets cCsdS(N((sself((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pysselects(s__name__s __module__s__init__s editColorstkWidgetsgetssetsselect(((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pysTkColorSelectors      sEditObjectAttributesDialogcBs2tZdZdZdZdZdZRS(su Creates an editable (pseudo-)inspector for a selected set of attributes of a given object - master : tk master widget - object : the object, whose attributes we want to edit - attr_names : a list of attr_names By making use of Python 2.2's capability of subclassing built-in types such as ints, information about editing etc. is conveyed. An attr must have: - validate(value) method [return 1, if value is a valid new value for attr] The class of an attr can have the following mix-ins: - Popubable - WithDefault cCs?||_||_h|_tii||d|iidS(NsEdit: %s( sobjectsselfs attr_namesseditstkSimpleDialogsDialogs__init__smastersdesc(sselfsmastersobjects attr_names((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pys__init__s   cCse|i|}t|}t}t|t }t|t o"t ||i|i|i}nt|toT|o+t|tdt||i|}qPt|tdt|}nt|to6|ot|d|i|}qPt|d}nGt|to6|ot|d|i|}qPt|d}n|i||SdS(sH Create a widget capable of editing attr and insert attr's current valuei iiN(sobjects__dict__s attr_namesattrstypes attr_typesNoneswidgets isinstances WithDefaultsdefaults PopupablesTkPopupSelectorsmastersval2popspop2valswidthsstrsTkDefaultStringEntrysmaxslens useDefaults TkStringEntrysintsTkDefaultIntEntrys TkIntEntrysfloatsTkDefaultFloatEntrys TkFloatEntrysset(sselfsmastersobjects attr_nameswidgetsattrsdefaults attr_type((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pys editWidget"s*  "+" c Csh|iddt|dddt}|iddddddd d d tt|dd dt}|idddd ddd d d td }x|i D]}t|dd|dt}|id|ddddd d d t|i ||i ||i |<|i |tjo9|i |iid|dd ddd d d tn|d }qWdS(NistextsNamesanchorsrowscolumnspadxispadyisstickysValueis%si(sselfs resizablesLabelsmastersEslabelsgridsWscur_rows attr_namessattrs editWidgetsobjectseditsNonestkWidget(sselfsmasterscur_rowsattrslabel((sG/mnt/gmirror/ports/math/py-gato/work/Gato/EditObjectAttributesDialog.pysbodyFs(( (9cCs9x|iiD]}yA|i|i}|ii|i|djo t nWqt j o<d|}t i d|d||i|i dSqXqWx|iiD]w}t|ii||i|i|ii|