ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     U
    e5d-                     @   s   d Z ddlT ddlmZmZ G dd dZG dd deZdd	 ZG d
d deZG dd deZ	dd Z
G dd deZdd ZG dd deZdd Zedkrdd Ze  dS )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
    )*)
messagebox_get_default_rootc                   @   sL   e Zd Zdg ddddfddZdddZd	d
 Zdd Zdd Zdd ZdS )SimpleDialog Nc                 C   s  |rt ||d| _n
t || _|r:| j| | j| t| j t| j|dd| _| jjdtd t	| j| _
| j
  || _|| _|| _| jd| j tt|D ]L}|| }	t| j
|	| |fddd	}
||kr|
jtd
d |
jttdd q| jd| j | | d S )N)class_i  )textZaspect   )expandfill<Return>c                 S   s
   |  |S N)doneselfnum r   ,/usr/lib64/python3.8/tkinter/simpledialog.py<lambda>8       z'SimpleDialog.__init__.<locals>.<lambda>r   command   )ZreliefZborderwidth)sider   r
   WM_DELETE_WINDOW)ToplevelroottitleZiconname_setup_dialogZMessagemessagepackZBOTHFrameframer   canceldefaultbindreturn_eventrangelenButtonZconfigZRIDGELEFTprotocolwm_delete_window_set_transient)r   masterr   buttonsr$   r#   r   r   r   sbr   r   r   __init__    s2    


zSimpleDialog.__init__      ?333333?c                 C   s  | j }|  || |  | rJ| }| }| }| }n|	 }|
 }d }}| }	| }
|||	 |  }|||
 |  }||	 |	 kr|	 |	 }n|dk rd}||
 |
 kr|
 |
 }n|dk rd}|d||f  |  d S )Nr   +%d+%d)r   withdraw	transientupdate_idletasksZwinfo_ismappedZwinfo_widthZwinfo_heightwinfo_rootxwinfo_rootyZwinfo_screenwidthZwinfo_screenheightZwinfo_reqwidthZwinfo_reqheightgeometry	deiconify)r   r.   ZrelxZrelyZwidgetZm_widthZm_heightZm_xZm_yZw_widthZw_heightxyr   r   r   r-   ?   s4    

zSimpleDialog._set_transientc                 C   s.   | j   | j   | j   | j   | jS r   )r   wait_visibilitygrab_setmainloopdestroyr   r   r   r   r   go\   s
    



zSimpleDialog.goc                 C   s&   | j d kr| j  n| | j  d S r   )r$   r   bellr   r   Zeventr   r   r   r&   c   s    
zSimpleDialog.return_eventc                 C   s&   | j d kr| j  n| | j  d S r   )r#   r   rE   r   rC   r   r   r   r,   i   s    
zSimpleDialog.wm_delete_windowc                 C   s   || _ | j  d S r   )r   r   quitr   r   r   r   r   o   s    zSimpleDialog.done)r3   r4   )	__name__
__module____qualname__r2   r-   rD   r&   r,   r   r   r   r   r   r      s       

r   c                   @   sV   e Zd ZdZdddZdd Zdd Zd	d
 ZdddZdddZ	dd Z
dd ZdS )DialogzZClass to open dialogs.

    This class is intended as a base class for custom dialogs
    Nc                 C   s   |}|st d}t| | |   |dk	r>| r>| | |rL| | t|  || _d| _	t
| }| || _|jddd |   | js| | _| d| j |dk	r| d| d | d f  |   | j  |   |   | |  dS )zInitialize a dialog.

        Arguments:

            parent -- a parent window (the application window)

            title -- the dialog title
        zcreate dialog windowN   )padxpadyr   r5   2   )r   r   r2   r6   Zwinfo_viewabler7   r   r   parentresultr!   bodyinitial_focusr    	buttonboxr+   r#   r;   r9   r:   r<   	focus_setr?   r@   Zwait_window)r   rP   r   r.   rR   r   r   r   r2   {   s8    	



zDialog.__init__c                 C   s   d| _ t|  dS )zDestroy the windowN)rS   r   rB   rC   r   r   r   rB      s    zDialog.destroyc                 C   s   dS )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.   r   r   r   rR      s    zDialog.bodyc                 C   sv   t | }t|dd| jtd}|jtddd t|dd| jd}|jtddd | d| j | d	| j |  d
S )z[add standard button box.

        override if you do not want the standard buttons
        ZOK
   )r   widthr   r$   rL   )r   rM   rN   Cancel)r   rW   r   r   z<Escape>N)r!   r)   okZACTIVEr    r*   r#   r%   )r   Zboxwr   r   r   rT      s    zDialog.buttonboxc                 C   sB   |   s| j  d S |   |   z|   W 5 |   X d S r   )validaterS   rU   r6   r8   r#   applyrF   r   r   r   rY      s    
z	Dialog.okc                 C   s    | j d k	r| j   |   d S r   )rP   rU   rB   rF   r   r   r   r#      s    

zDialog.cancelc                 C   s   dS )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   rC   r   r   r   r[      s    zDialog.validatec                 C   s   dS )zprocess the data

        This method is called automatically to process the data, *after*
        the dialog is destroyed. By default, it does nothing.
        Nr   rC   r   r   r   r\      s    zDialog.apply)N)N)N)rH   rI   rJ   __doc__r2   rB   rR   rT   rY   r#   r[   r\   r   r   r   r   rK   t   s   
7	


	rK   c                 C   s:   | j dkr | jdd| dd n| j dkr6| dd d S )	NZaquaz!::tk::unsupported::MacWindowStyleZstyleZmoveableModalr   Zx11z-typeZdialog)Z_windowingsystemZtkZcallZwm_attributes)rZ   r   r   r   r     s    

  
r   c                   @   s.   e Zd Zd
ddZdd Zdd Zdd	 ZdS )_QueryDialogNc                 C   s*   || _ || _|| _|| _t| || d S r   )promptminvaluemaxvalueinitialvaluerK   r2   )r   r   r_   rb   r`   ra   rP   r   r   r   r2     s
    z_QueryDialog.__init__c                 C   s   d | _ t|  d S r   )entryrK   rB   rC   r   r   r   rB     s    z_QueryDialog.destroyc                 C   sr   t || jtd}|jddtd t|dd| _| jjddtt d | jd k	rl| j	d| j | j
dt | jS )N)r   Zjustifyr   rL   )rowrM   Zstickyrc   )namer	   )ZLabelr_   r*   ZgridWZEntryrc   Erb   insertZselect_rangeZEND)r   r.   rZ   r   r   r   rR      s    
z_QueryDialog.bodyc                 C   s   z|   }W n, tk
r8   tjd| jd | d Y dS X | jd k	rh|| jk rhtjdd| j | d dS | jd k	r|| jkrtjdd| j | d dS || _d	S )
NzIllegal valuez
Please try again)rP   r   z	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errormessager`   ra   rQ   )r   rQ   r   r   r   r[   .  s:    z_QueryDialog.validate)NNNN)rH   rI   rJ   r2   rB   rR   r[   r   r   r   r   r^     s        
r^   c                   @   s   e Zd ZdZdd ZdS )_QueryIntegerzNot an integer.c                 C   s   |  | j S r   )Zgetintrc   getrC   r   r   r   ri   S  s    z_QueryInteger.getresultNrH   rI   rJ   rl   ri   r   r   r   r   rm   P  s   rm   c                 K   s   t | |f|}|jS )zget an integer from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is an integer
    )rm   rQ   r   r_   kwdr   r   r   
askintegerW  s    rs   c                   @   s   e Zd ZdZdd ZdS )_QueryFloatzNot a floating point value.c                 C   s   |  | j S r   )Z	getdoublerc   rn   rC   r   r   r   ri   i  s    z_QueryFloat.getresultNro   r   r   r   r   rt   f  s   rt   c                 K   s   t | |f|}|jS )zget a float from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is a float
    )rt   rQ   rp   r   r   r   askfloatm  s    ru   c                   @   s$   e Zd Zdd Zdd Zdd ZdS )_QueryStringc                 O   s6   d|kr|d | _ |d= nd | _ tj| f|| d S )Nshow)_QueryString__showr^   r2   )r   argsrq   r   r   r   r2   }  s
    
z_QueryString.__init__c                 C   s(   t | |}| jd k	r$|j| jd |S )N)rw   )r^   rR   rx   Z	configure)r   r.   rc   r   r   r   rR     s    
z_QueryString.bodyc                 C   s
   | j  S r   )rc   rn   rC   r   r   r   ri     s    z_QueryString.getresultN)rH   rI   rJ   r2   rR   ri   r   r   r   r   rv   |  s   rv   c                 K   s   t | |f|}|jS )zget a string from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is a string
    )rv   rQ   rp   r   r   r   	askstring  s    rz   __main__c                  C   sL   t  } | fdd}t| d|d}|  t| d|jd}|  |  d S )Nc                 S   s^   t | ddddgdddd}t|  ttd	d
dd ttd	dddd ttd	d d S )NzThis 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?ZYesZNorX   r      zTest Dialog)r   r/   r$   r#   r   ZSpamz	Egg count   )rb   zEgg weight
(in tons)r	   d   )r`   ra   z	Egg label)r   printrD   rs   ru   rz   )r   rr   r   r   r   doit  s    

ztest.<locals>.doitZTestr   ZQuit)ZTkr)   r    rG   rA   )r   r   tqr   r   r   test  s    r   N)r]   Ztkinterr   r   r   r   rK   r   r^   rm   rs   rt   ru   rv   rz   rH   r   r   r   r   r   <module>   s    V 
C