³ò
Ÿ›\Kc           @   s   d  Z  d d k Td d k Z d e f d „  ƒ  YZ e d j o< e ƒ  Z d „  Z e	 e d d	 d
 e ƒi
 ƒ  e i ƒ  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  i |  | ƒ |  i d d ƒ |  i d t d t ƒ |  i | ƒ |  i | ƒ |  i ƒ  |  i d |  i	 ƒ | |  _
 | |  _ | |  _ d |  _ |  i ƒ  |  i ƒ  |  i ƒ  |  i i d |  i i ƒ  ƒ |  i d | i ƒ  | i ƒ  d |  i ƒ  d | i ƒ  | i ƒ  d |  i ƒ  d f ƒ |  i ƒ  |  i ƒ  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   (    (    s5   /usr/lib/python2.5/idlelib/configSectionNameDialog.pyR   	   s,    
				


	
c         C   sš  t  |  ƒ |  _ t  |  ƒ |  _ t |  d d d t ƒ|  _ |  i i d t d t d t	 ƒ t
 |  i d t d t d	 d
 d d
 d |  i ƒ|  _ t |  i d |  i d d ƒ} | i ƒ  |  i i d	 d
 d d
 ƒ | i d	 d
 d d
 ƒ t |  ƒ } | i d t d t ƒ t | d d d d d |  i ƒ|  _ |  i i d d d d d	 d
 d d
 ƒ t | d d d d d |  i ƒ|  _ |  i i 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(    (    s5   /usr/lib/python2.5/idlelib/configSectionNameDialog.pyR   &   s$    $
%c         C   sÃ   d } |  i  i ƒ  } | i ƒ  | p& t i d d d d d |  ƒ d } nt t | ƒ d j o* t i d d d d	 d
 d |  ƒ d } n7 | |  i j o& t i 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   (    (    s5   /usr/lib/python2.5/idlelib/configSectionNameDialog.pyt   NameOk:   s"    



c         C   s7   |  i  ƒ  o& |  i i ƒ  i ƒ  |  _ |  i ƒ  n d  S(   N(   RO   R4   RI   RJ   R   t   destroy(   R$   t   event(    (    s5   /usr/lib/python2.5/idlelib/configSectionNameDialog.pyR/   O   s    c         C   s   d |  _  |  i ƒ  d  S(   NR   (   R   RP   (   R$   RQ   (    (    s5   /usr/lib/python2.5/idlelib/configSectionNameDialog.pyR   T   s    	N(   t   __name__t
   __module__R   R   RO   t   NoneR/   R   (    (    (    s5   /usr/lib/python2.5/idlelib/configSectionNameDialog.pyR      s
   			t   __main__c          C   s$   d }  t  t d d ƒ } | i GHd  S(   NR   s   Get Names:   The information here should need to be word wrapped. Test.(   R   t   rootR   (   t   keySeqt   dlg(    (    s5   /usr/lib/python2.5/idlelib/configSectionNameDialog.pyt   run[   s    		R-   t   DialogR0   (   t   __doc__t   TkinterRK   R   R   RR   t   TkRV   RY   RC   R8   t   mainloop(    (    (    s5   /usr/lib/python2.5/idlelib/configSectionNameDialog.pys   <module>   s   
P		