
;N9c       s  d  Z  d k Td k Z d e f d     YZ d k Z d e f d     YZ d e f d     YZ d	   Z d
 e f d     YZ	 d   Z
 d e f d     YZ d   Z e d j oW e   Z e i   e d d d d d GHe
 d d d d d d GHe d d  GHn d S(   s   Dialog boxes

This module handles dialog boxes. It contains the following
public symbols:

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
(   s   *Ns   Dialogc      sY   d  Z  e d  Z d   Z d   Z d   Z e d  Z e d  Z d   Z d   Z	 RS(	   sZ   Class to open dialogs.

    This class is intended as a base class for custom dialogs
    c    s  t  i |  |  |  i |  | o |  i |  n | |  _ t |  _ t |   } |  i	 |  |  _
 | i d d d d  |  i   |  i   |  i
 o |  |  _
 n |  i d |  i  |  i d | i   d | i   d f  |  i
 i   |  i |   d S(   s   Initialize a dialog.

        Arguments:

            parent -- a parent window (the application window)

            title -- the dialog title
        s   padxi   s   padys   WM_DELETE_WINDOWs   +%d+%di2   N(   s   Toplevels   __init__s   selfs   parents	   transients   titles   Nones   results   Frames   bodys   initial_focuss   packs	   buttonboxs   grab_sets   protocols   cancels   geometrys   winfo_rootxs   winfo_rootys	   focus_sets   wait_window(   s   selfs   parents   titles   bodys2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   __init__& s$    	 		

+c    s   t  |  _ t i |   d S(   s   Destroy the windowN(   s   Nones   selfs   initial_focuss   Toplevels   destroy(   s   selfs2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   destroyN s     	c    s   d S(   s   create dialog body.

        return widget that should have initial focus. 
        This method should be overridden, and is called
        by the __init__ method.
        N(    (   s   selfs   masters2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   bodyV s     c  
  s   t  |   } t | d d d d d |  i d t } | i d t d d	 d
 d	  t | d d d d d |  i	 } | i d t d d	 d
 d	  |  i
 d |  i  |  i
 d |  i	  | i   d S(   s[   add standard button box. 

        override if you don't want the standard buttons
        s   texts   OKs   widthi
   s   commands   defaults   sides   padxi   s   padys   Cancels   <Return>s   <Escape>N(   s   Frames   selfs   boxs   Buttons   oks   ACTIVEs   ws   packs   LEFTs   cancels   bind(   s   selfs   boxs   ws2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys	   buttonbox_ s     '!c    sO   |  i   o |  i i   d  Sn |  i   |  i   |  i   |  i   d  S(   N(   s   selfs   validates   initial_focuss	   focus_sets   withdraws   update_idletaskss   applys   cancel(   s   selfs   events2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   okt s    


c    s   |  i i   |  i   d  S(   N(   s   selfs   parents	   focus_sets   destroy(   s   selfs   events2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   cancel s    c    s   d Sd S(   s   validate the data

        This method is called automatically to validate the data before the 
        dialog is destroyed. By default, it always validates OK.
        i   N(    (   s   selfs2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   validate s     c    s   d S(   s   process the data

        This method is called automatically to process the data, *after*
        the dialog is destroyed. By default, it does nothing.
        N(    (   s   selfs2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   apply s     (
   s   __doc__s   Nones   __init__s   destroys   bodys	   buttonboxs   oks   cancels   validates   apply(    s2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   Dialog s    (							s   _QueryDialogc      s2   e  e  e  e  d  Z d   Z d   Z d   Z RS(   Nc    sY   | o d  k } | i } n | |  _ | |  _ | |  _ | |  _ t i	 |  | |  d  S(   N(   s   parents   Tkinters   _default_roots   prompts   selfs   minvalues   maxvalues   initialvalues   Dialogs   __init__s   title(   s   selfs   titles   prompts   initialvalues   minvalues   maxvalues   parents   Tkinters2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   __init__ s    					c    s   t  |  _ t i |   d  S(   N(   s   Nones   selfs   entrys   Dialogs   destroy(   s   selfs2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   destroy s    	c    s   t  | d |  i d t } | i d d d d d t  t | d d	 |  _	 |  i	 i d d
 d d d t t
  |  i o- |  i	 i d |  i  |  i	 i d t  n |  i	 Sd  S(   Ns   texts   justifys   rowi    s   padxi   s   stickys   names   entryi   (   s   Labels   masters   selfs   prompts   LEFTs   ws   grids   Ws   Entrys   entrys   Es   initialvalues   inserts   select_ranges   END(   s   selfs   masters   ws2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   body s    #
c    s   d  k  } y |  i   } Wn4 t j
 o( | i d |  i d d |  d Sn X|  i t j	 o | |  i j  o% | i d d |  i d |  d Sn |  i	 t j	 o | |  i	 j o% | i d d |  i	 d |  d Sn | |  _ d	 Sd  S(
   Ns   Illegal values   
Please try agains   parenti    s	   Too smalls2   The allowed minimum value is %s. Please try again.s	   Too larges2   The allowed maximum value is %s. Please try again.i   (
   s   tkMessageBoxs   selfs	   getresults   results
   ValueErrors   showwarnings   errormessages   minvalues   Nones   maxvalue(   s   selfs   tkMessageBoxs   results2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   validate s(    		

	 	

 	

	(   s   Nones   __init__s   destroys   bodys   validate(    s2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   _QueryDialog s    		s   _QueryIntegerc      s   d Z  d   Z RS(   Ns   Not an integer.c    s   t  i |  i i    Sd  S(   N(   s   strings   atois   selfs   entrys   get(   s   selfs2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys	   getresult s    (   s   errormessages	   getresult(    s2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   _QueryInteger s    c    s#   t  t |  | f |  } | i Sd S(   s   get an integer from the user

    Arguments:

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

    Return value is an integer
    N(   s   applys   _QueryIntegers   titles   prompts   kws   ds   result(   s   titles   prompts   kws   ds2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys
   askinteger s    
 s   _QueryFloatc      s   d Z  d   Z RS(   Ns   Not a floating point value.c    s   t  i |  i i    Sd  S(   N(   s   strings   atofs   selfs   entrys   get(   s   selfs2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys	   getresults    (   s   errormessages	   getresult(    s2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   _QueryFloat s    c    s#   t  t |  | f |  } | i Sd S(   s   get a float from the user

    Arguments:

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

    Return value is a float
    N(   s   applys   _QueryFloats   titles   prompts   kws   ds   result(   s   titles   prompts   kws   ds2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   askfloats    
 s   _QueryStringc      s   d   Z  RS(   Nc    s   |  i i   Sd  S(   N(   s   selfs   entrys   get(   s   selfs2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys	   getresults    (   s	   getresult(    s2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   _QueryStrings    c    s#   t  t |  | f |  } | i Sd S(   s   get a string from the user

    Arguments:

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

    Return value is a string
    N(   s   applys   _QueryStrings   titles   prompts   kws   ds   result(   s   titles   prompts   kws   ds2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys	   askstrings    
 s   __main__s   Spams	   Egg counts   initialvaluei   s   Egg weight
(in tons)s   minvaluei   s   maxvalueid   s	   Egg label(   s   __doc__s   Tkinters   oss   Toplevels   Dialogs   strings   _QueryDialogs   _QueryIntegers
   askintegers   _QueryFloats   askfloats   _QueryStrings	   askstrings   __name__s   Tks   roots   update(    s2   /mit/python/lib/python2.0/lib-tk/tkSimpleDialog.pys   ? s"   		J				
