Current File : //usr/local/apps/python3/lib/python3.11/idlelib/__pycache__/configdialog.cpython-311.pyc |
�
�Ke� � �N � d Z ddlZddlmZmZmZmZmZmZm Z m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z ddl!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z. ddlm/Z/ ddl0m1Z2 ddlm3Z3 ddl4m5Z5m6Z6 ddl7m8Z8 dd l9m:Z: dd
l;m<Z< ddl=m>Z>m?Z? ddl@mAZA dd
lBmCZC ddlDmEZE ddlFmGZG ddlHmIZI ddlJmKZK ddl@mLZL e6� � ZMeCeEeGeIeKfZN G d� de� � ZOdaP G d� de"� � ZQ G d� de"� � ZR G d� de"� � ZS G d� de"� � ZT G d� de"� � ZU G d � d!e"� � ZV G d"� d#e#� � ZW G d$� d%� � ZX eX� � ZYd&ZZd'd(d)d*d+d,�Z[d-� Z\ G d.� d/e"� � Z]e^d0k r'dd1l_m`Z` e`d2d3d4�5� � dd6lambZb ebeO� � dS dS )7a� IDLE Configuration Dialog: support user customization of IDLE by GUI
Customize font faces, sizes, and colorization attributes. Set indentation
defaults. Customize keybindings. Colorization and keybindings can be
saved as user defined sets. Select startup options including shell/editor
and default window size. Define additional help sources.
Note that tab width in IDLE is currently fixed at eight due to Tk issues.
Refer to comments in EditorWindow autoindent code for details.
� N)�Toplevel�Listbox�Canvas� StringVar�
BooleanVar�IntVar�TRUE�FALSE�TOP�BOTTOM�RIGHT�LEFT�SOLID�GROOVE�NONE�BOTH�X�Y�W�E�EW�NS�NSEW�NW�
HORIZONTAL�VERTICAL�ANCHOR�ACTIVE�END�TclError)
�Frame�
LabelFrame�Button�Checkbutton�Entry�Label�
OptionMenu�Notebook�Radiobutton� Scrollbar�Style�Spinbox�Combobox)�colorchooser)�
messagebox)�idleConf�
ConfigChanges)�
GetKeysWindow)�
DynOptionMenu)�macosx)�SectionName�
HelpSource)� view_text)�AutoComplete)�CodeContext)�
ParenMatch)�FormatParagraph)�Squeezer)�ScrollableTextFramec �b � � e Zd ZdZdddd�d�Zd� Zd� Zd� Zd � Zd
� Z � fd�Z
d� Zd
� Zd� Z
� xZS )�ConfigDialogzConfig dialog for IDLE.
� F)�_htest�_utestc � � t j | |� � || _ |ri |_ |s| � � � | � |pd� � |� � � dz }|� � � |sdndz }| � d|� d|� �� � | � � � | �
t t �� � | � |� � | �
d| j � � | j j � � � t$ � � � |s>| � � � | � � � | � � � dS dS ) a� Show the tabbed dialog for user configuration.
Args:
parent - parent of this dialog
title - string which is the title of this popup dialog
_htest - bool, change box location when running htest
_utest - bool, don't wait_window when running unittest
Note: Focus set on font page fontlist.
Methods:
create_widgets
cancel: Bound to DELETE_WINDOW protocol.
zIDLE Preferences� � � �+��height�width�WM_DELETE_WINDOWN)r �__init__�parent�
instance_dict�withdraw�title�winfo_rootx�winfo_rooty�geometry�create_widgets� resizabler
� transient�protocol�cancel�fontpage�fontlist� focus_set�tracers�attach�grab_set�wm_deiconify�wait_window)�selfrM rP rA rB �x�ys �>/usr/local/apps/python3/lib/python3.11/idlelib/configdialog.pyrL zConfigDialog.__init__1 ss � � ��$��'�'�'����� &�#%�F� �� ��M�M�O�O�O��
�
�5�.�.�/�/�/���� � �2�%����� � �f�$=�B�B�#�>���
�
�k�!�k�k�a�k�k�"�"�"�
���������e�5��1�1�1����v�����
�
�(�$�+�6�6�6��
��(�(�*�*�*� ������� ��M�M�O�O�O��������������� � � c �� � t | d�� � x| _ }| j � d�� � t |� � x| _ }t |� � | _ t || j � � | _ t || j � � | _
t || j � � | _ t |� � | _ t |� � | _ |� | j
d�� � |� | j d�� � |� | j d�� � |� | j d �� � |� | j d
�� � |� | j d�� � |� � � |� t( t* t, �� � | � � � � t0 �
� � dS )a Create and place widgets for tabbed dialog.
Widgets Bound to self:
frame: encloses all other widgets
note: Notebook
highpage: HighPage
fontpage: FontPage
keyspage: KeysPage
winpage: WinPage
shedpage: ShedPage
extpage: ExtPage
Methods:
create_action_buttons
load_configs: Load pages except for extensions.
activate_config_changes: Tell editors to reload.
�5px��padding�nwes)�stickyz Fonts ��text�
Highlightsz Keys z Windows z
Shell/Ed �
Extensions��side�expand�fill�rq N)r! �frame�gridr( �note�ExtPage�extpage�HighPage�highpage�FontPagerY �KeysPage�keyspage�WinPage�winpage�ShedPage�shedpage�add�enable_traversal�packr r r �create_action_buttonsr )ra ru rw s rd rT zConfigDialog.create_widgets` s� � �$ #�4��7�7�7�7��
�U��
���v��&�&�&�#�E�?�?�*�� �D��t�}�}��� ��t�|�4�4��
� ��t�}�5�5��
� ��t�|�4�4��
��t�}�}��� �����
������Y��/�/�/������\��2�2�2������X��.�.�.������K��0�0�0������\��2�2�2������L��1�1�1�������� � �s�4�d� �3�3�3��"�"�$�$�)�)�v�)�6�6�6�6�6re c � � t j � � ri }nddi}t | j d�� � }t |d�� � }i | _ d| j fd| j fd| j fd| j ffD ]J\ }}t |f||t d �|��| j |<