ó
|Nc           @   s}   d  Z  d d l Td d l Z d e f d     YZ e d k ry e   Z d   Z e	 e d d	 d
 e j
   e j   n  d S(   s~   
Dialog that allows user to specify a new config file section name.
Used to get new highlight theme and keybinding set names.
i˙˙˙˙(   t   *Nt   GetCfgSectionNameDialogc           B   s;   e  Z d    Z d   Z d   Z d d  Z d d  Z RS(   c         C   s>  t  j |  |  |  j d d  |  j d t d t  |  j |  |  j |  |  j   |  j d |  j	  | |  _
 | |  _ | |  _ d |  _ |  j   |  j   |  j   |  j j d |  j j    |  j d | j   | j   d |  j   d | j   | j   d |  j   d f  |  j   |  j   d	 S(
   s   
        message - string, informational message to display
        usedNames - list, list of names already in use for validity check
        t   borderwidthi   t   heightt   widtht   WM_DELETE_WINDOWt    s   +%d+%di   N(   t   Toplevelt   __init__t	   configuret	   resizablet   FALSEt   titlet	   transientt   grab_sett   protocolt   Cancelt   parentt   messaget	   usedNamest   resultt   CreateWidgetst   withdrawt   update_idletaskst   messageInfot   configt	   frameMaint   winfo_reqwidtht   geometryt   winfo_rootxt   winfo_widtht   winfo_rootyt   winfo_heightt   winfo_reqheightt	   deiconifyt   wait_window(   t   selfR   R   R   R   (    (    s4   C:\RCS\Python\lib\idlelib\configSectionNameDialog.pyR   	   s,    
				


	
c         C   s  t  |   |  _ t  |   |  _ t |  d d d t |  _ |  j j d t d t d t	  t
 |  j d t d t d	 d
 d d
 d |  j |  _ t |  j d |  j d d } | j   |  j j d	 d
 d d
  | j d	 d
 d d
  t |   } | j d t d t  t | d d d d d |  j |  _ |  j j d d d d d	 d
 d d
  t | d d d d d |  j |  _ |  j j d d d d d	 d
 d d
  d  S(   NR   i   t   relieft   sidet   expandt   fillt   anchort   justifyt   padxi   t   padyt   textt   textvariableR   i   t   Oki   t   commandt   rowi    t   columnR   i   (   t	   StringVart   namet   fontSizet   Framet   SUNKENR   t   packt   TOPt   TRUEt   BOTHt   Messaget   Wt   LEFTR   R   t   Entryt	   focus_sett   BOTTOMt   Xt   ButtonR/   t   buttonOkt   gridR   t   buttonCancel(   R$   t	   entryNamet   frameButtons(    (    s4   C:\RCS\Python\lib\idlelib\configSectionNameDialog.pyR   &   s$    $
%c         C   s½   d } |  j  j   } | j   | sJ t j d d d d d |   d } no t |  d k r t j d d d d	 d
 d |   d } n4 | |  j k rı t j d d d d d |   d } n  | S(   Ni   R   s
   Name ErrorR   s   No name specified.R   i    i   s)   Name too long. It should be no more than s   30 characters.s   This name is already in use.(   R4   t   gett   stript   tkMessageBoxt	   showerrort   lenR   (   R$   t   nameOkR4   (    (    s4   C:\RCS\Python\lib\idlelib\configSectionNameDialog.pyt   NameOk:   s"    
			c         C   s5   |  j    r1 |  j j   j   |  _ |  j   n  d  S(   N(   RO   R4   RI   RJ   R   t   destroy(   R$   t   event(    (    s4   C:\RCS\Python\lib\idlelib\configSectionNameDialog.pyR/   O   s    c         C   s   d |  _  |  j   d  S(   NR   (   R   RP   (   R$   RQ   (    (    s4   C:\RCS\Python\lib\idlelib\configSectionNameDialog.pyR   T   s    	N(   t   __name__t
   __module__R   R   RO   t   NoneR/   R   (    (    (    s4   C:\RCS\Python\lib\idlelib\configSectionNameDialog.pyR      s
   			t   __main__c          C   s$   d }  t  t d d  } | j GHd  S(   NR   s   Get Names:   The information here should need to be word wrapped. Test.(   R   t   rootR   (   t   keySeqt   dlg(    (    s4   C:\RCS\Python\lib\idlelib\configSectionNameDialog.pyt   run[   s    		R-   t   DialogR0   (   t   __doc__t   TkinterRK   R   R   RR   t   TkRV   RY   RC   R8   t   mainloop(    (    (    s4   C:\RCS\Python\lib\idlelib\configSectionNameDialog.pyt   <module>   s   
P		