Your IP : 3.144.9.183
��Yf� � @ s� d Z d d l Td d l j Z Gd d � d e � Z e d k r� d d l Z e j d d d d
d �d d l
m Z e e � d S)
a
Dialog that allows user to specify a new config file section name.
Used to get new highlight theme and keybinding set names.
The 'return value' for the dialog, used two placed in configDialog.py,
is the .result attribute set in the Ok and Cancel methods.
� )�*Nc @ sU e Z d Z d d d � Z d d � Z d d � Z d d d
� Z d d d � Z d S)
�GetCfgSectionNameDialogFc C sA t j | | � | j d d � | j d t d t � | j | � | j | � | j � | j d | j � | | _
| | _ | | _ | j
� | j � | j � | j j d | j j � � | j d | j � | j � d | j � d | j � | s| j � d | j � d n d f � | j � | j � d S)
z�
message - string, informational message to display
used_names - string collection, names already in use for validity check
_htest - bool, change box location when running htest
�borderwidth� Zheight�widthZWM_DELETE_WINDOWz+%d+%d� �d N)�Toplevel�__init__Z configureZ resizableZFALSE�titleZ transientZgrab_setZprotocol�Cancel�parent�message�
used_names�create_widgetsZwithdrawZupdate_idletasks�messageInfo�config� frameMainZwinfo_reqwidthZgeometryZwinfo_rootxZwinfo_widthZwinfo_rootyZwinfo_heightZwinfo_reqheightZ deiconifyZwait_window)�selfr
r r r Z_htest� r �D/opt/alt/python35/lib64/python3.5/idlelib/configSectionNameDialog.pyr
s,
0
z GetCfgSectionNameDialog.__init__c C s� t | j � | _ t | j � | _ 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 | d d �} | j d t � t | d d d d d | j �| _ | j j d t
d d
� t | d d d d d | j �| _ | j j d t d d
� d S)Nr r ZreliefZside�expandZfillZanchorZjustifyZpadxr Zpady�textZtextvariabler � �Ok� Zcommandr )Z StringVarr
�nameZfontSizeZFrameZSUNKENr ZpackZTOPZTRUEZBOTHZMessage�WZLEFTr r ZEntryZ focus_setZBOTTOMZButtonr ZbuttonOkr ZbuttonCancelZRIGHT)r Z entryNameZframeButtonsr r r r + s$
z&GetCfgSectionNameDialog.create_widgetsc C s� | j j � j � } | s: t j d d d d d | � nl t | � d k ru t j d d d d d d | � d } n1 | | j k r� t j d d d d
d | � d } | S)z� After stripping entered name, check that it is a sensible
ConfigParser file section name. Return it if it is, '' if not.
r z
Name Errorr zNo name specified.r
r z)Name too long. It should be no more than z30 characters.� zThis name is already in use.)r �get�strip�tkMessageBoxZ showerror�lenr )r r r r r �name_ok@ s
zGetCfgSectionNameDialog.name_okNc C s) | j � } | r% | | _ | j � d S)N)r# �result�destroy)r �eventr r r r r S s zGetCfgSectionNameDialog.Okc C s d | _ | j � d S)Nr )r$ r% )r r&