PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  mY,@sdZddlTddlmZddlZGdddZGdddeZGd d d eZGd d d eZd dZGdddeZ ddZ GdddeZ ddZ e dkrddZedS)a&This modules handles dialog boxes. It contains the following public symbols: SimpleDialog -- A simple but flexible modal dialog box Dialog -- a base class for dialogs askinteger -- get an integer from the user askfloat -- get a float from the user askstring -- get a string from the user )*) messageboxNc@speZdZdgddddddZddddZd d Zd d Zd dZddZdS) SimpleDialogNc Cs|rt|d||_nt||_|rS|jj||jj|t|jd|dd|_|jjdddtt|j|_ |j j||_ ||_ ||_ |jj d|jxtt|D]u}||} t|j d| d ||d d } ||krF| jd td d| jdtdtddqW|jjd|j|j|dS)Nclass_textZaspectiexpandfillzcommandcSs |j|S)N)done)selfnumr+/opt/python35/lib/python3.5/simpledialog.py6sz'SimpleDialog.__init__..ZreliefZ borderwidthsideWM_DELETE_WINDOW)ToplevelroottitleZiconnameZMessagemessagepackZBOTHFrameframercanceldefaultbind return_eventrangelenButtonconfigZRIDGELEFTprotocolwm_delete_window_set_transient) r masterrbuttonsrrrrrsbrrr__init__!s.       zSimpleDialog.__init__g?g333333?c Csb|j}|j|j||j|jri|j}|j}|j}|j}n"|j }|j }d}}|j } |j } ||| |} ||| |} | | |j kr|j | } n| dkrd} | | |j kr+|j | } n| dkr=d} |j d| | f|jdS)Nrz+%d+%d)rwithdraw transientupdate_idletasksZwinfo_ismappedZ winfo_widthZ winfo_height winfo_rootx winfo_rootyZwinfo_screenwidthZwinfo_screenheightZwinfo_reqwidthZwinfo_reqheightgeometry deiconify) r r(ZrelxZrelyZwidgetZm_widthZm_heightZm_xZm_yZw_widthZw_heightxyrrrr'=s4               zSimpleDialog._set_transientcCs;|jj|jj|jj|jj|jS)N)rwait_visibilitygrab_setmainloopdestroyr)r rrrgoZs     zSimpleDialog.gocCs3|jdkr|jjn|j|jdS)N)rrbellr )r eventrrrraszSimpleDialog.return_eventcCs3|jdkr|jjn|j|jdS)N)rrr;r )r rrrr&gszSimpleDialog.wm_delete_windowcCs||_|jjdS)N)rrquit)r rrrrr ms zSimpleDialog.done) __name__ __module__ __qualname__r,r'r:rr&r rrrrrs     rc@seZdZdZdddZddZddZd d Zdd d Zdd dZ ddZ ddZ dS)DialogzZClass to open dialogs. This class is intended as a base class for custom dialogs NcCs1tj|||j|jr3|j||rF|j|||_d|_t|}|j ||_ |j dddd|j |j s||_ |j d|j|jdk r|jd|jd|jdf|j|j j|j|j|j|dS)zInitialize a dialog. Arguments: parent -- a parent window (the application window) title -- the dialog title Npadxpadyrz+%d+%d2)rr,r-Zwinfo_viewabler.rparentresultrbody initial_focusr buttonboxr%rr2r0r1r3 focus_setr6r7Z wait_window)r rFrrHrrrr,ys.               zDialog.__init__cCsd|_tj|dS)zDestroy the windowN)rIrr9)r rrrr9s zDialog.destroycCsdS)zcreate dialog body. return widget that should have initial focus. This method should be overridden, and is called by the __init__ method. Nr)r r(rrrrHsz Dialog.bodyc Cst|}t|ddddd|jdt}|jdtdd d d t|dd ddd|j}|jdtdd d d |jd |j|jd |j|jdS)z[add standard button box. override if you do not want the standard buttons rZOKwidth r rrrBrCrDCancelzzN)rr"okZACTIVErr$rr)r ZboxwrrrrJs '!zDialog.buttonboxc CsQ|js|jjdS|j|jz|jWd|jXdS)N)validaterIrKr-r/applyr)r r<rrrrOs    z Dialog.okcCs*|jdk r|jj|jdS)N)rFrKr9)r r<rrrrs z Dialog.cancelcCsdS)zvalidate the data This method is called automatically to validate the data before the dialog is destroyed. By default, it always validates OK. r r)r rrrrQszDialog.validatecCsdS)zprocess the data This method is called automatically to process the data, *after* the dialog is destroyed. By default, it does nothing. Nr)r rrrrRsz Dialog.apply) r>r?r@__doc__r,r9rHrJrOrrQrRrrrrrArs 2   rAc@sLeZdZddddddZddZddZdd ZdS) _QueryDialogNcCsJ|stj}||_||_||_||_tj|||dS)N)tkinterZ _default_rootpromptminvaluemaxvalue initialvaluerAr,)r rrVrYrWrXrFrrrr,s     z_QueryDialog.__init__cCsd|_tj|dS)N)entryrAr9)r rrrr9s z_QueryDialog.destroycCst|d|jdt}|jdddddtt|dd |_|jjdd dddtt|jdk r|jj d|j|jj dt |jS) NrZjustifyrowrrBrCZstickynamerZr ) ZLabelrVr$ZgridWZEntryrZErYinsertZ select_rangeZEND)r r(rPrrrrHs#z_QueryDialog.bodyc Csy|j}Wn3tk rEtjd|jdd|dSYnX|jdk r||jkrtjdd|jd|dS|jdk r||jkrtjdd|jd|dS||_d S) Nz Illegal valuez Please try againrFrz Too smallz2The allowed minimum value is %s. Please try again.z Too largez2The allowed maximum value is %s. Please try again.r ) getresult ValueErrorr showwarning errormessagerWrXrG)r rGrrrrQ#s0      z_QueryDialog.validate)r>r?r@r,r9rHrQrrrrrTs   rTc@s"eZdZdZddZdS) _QueryIntegerzNot an integer.cCs|j|jjS)N)ZgetintrZget)r rrrr`Gsz_QueryInteger.getresultN)r>r?r@rcr`rrrrrdEs rdcKst|||}|jS)zget an integer from the user Arguments: title -- the dialog title prompt -- the label text **kw -- see SimpleDialog class Return value is an integer )rdrG)rrVkwdrrr askintegerJs rhc@s"eZdZdZddZdS) _QueryFloatzNot a floating point value.cCs|j|jjS)N)Z getdoublerZre)r rrrr`Zsz_QueryFloat.getresultN)r>r?r@rcr`rrrrriXs ricKst|||}|jS)zget a float from the user Arguments: title -- the dialog title prompt -- the label text **kw -- see SimpleDialog class Return value is a float )rirG)rrVrfrgrrraskfloat]s rjc@s4eZdZddZddZddZdS) _QueryStringcOsCd|kr#|d|_|d=n d|_tj|||dS)Nshow)_QueryString__showrTr,)r argsrfrrrr,ls     z_QueryString.__init__cCs8tj||}|jdk r4|jd|j|S)Nrl)rTrHrmZ configure)r r(rZrrrrHtsz_QueryString.bodycCs |jjS)N)rZre)r rrrr`zsz_QueryString.getresultN)r>r?r@r,rHr`rrrrrkks   rkcKst|||}|jS)zget a string from the user Arguments: title -- the dialog title prompt -- the label text **kw -- see SimpleDialog class Return value is a string )rkrG)rrVrfrgrrr askstring}s ro__main__cCsmt}|dd}t|ddd|}|jt|ddd|j}|j|jdS)Nc Sst|ddddddgddd d d d }t|jttd dddttd dddddttd ddS)NrzThis is a test dialog. Would this have been an actual dialog, the buttons below would have been glowing in soft pink light. Do you believe this?r)ZYesZNorNrrrrz Test DialogZSpamz Egg countrY zEgg weight (in tons)rWr rXdz Egg label)rprintr:rhrjro)rrgrrrdoits   ztest..doitrZTestr ZQuit)ZTkr"rr=r8)rrvtqrrrtests   ry)rSrUrrrrArTrdrhrirjrkror>ryrrrrs  SF