
;N9c       sI    d  Z    d k T d 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 of &e   Z 'e i   )e d d d d d GH*e
 d d d d d d GH+e 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      sw    d  Z  $ & e d  Z N d   Z V d   Z _ d   Z t 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<  & / 0 t  i |  |  1 |  i |  3 | o 4 |  i |  n 6 | |  _ 8 t |  _ : t |   } ; |  i	 |  |  _
 < | i d d d d  > |  i   @ |  i   B |  i
 o C |  |  _
 n E |  i d |  i  G |  i d | i   d | i   d f  J |  i
 i   L |  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&   N O P t  |  _ Q 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   V \ ] 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   _ c e t  |   } g t | d d d d d |  i d t } h | i d t d d	 d
 d	  i t | d d d d d |  i	 } j | i d t d d	 d
 d	  l |  i
 d |  i  m |  i
 d |  i	  o | 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    sg   t v |  i   o w |  i i   x d  Sn z |  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      sA     e  e  e  e  d  Z  d   Z  d   Z  d   Z RS(   Nc    st     | 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 o3  |  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   } WnC  t j
 o4  | i d  |  i d  d |   d Sn X |  i t j	 o | |  i j  o1  | i d  d |  i  d |   d Sn  |  i	 t j	 o | |  i	 j o1  | 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