Current File : //usr/local/apps/python3/lib/python3.11/idlelib/__pycache__/zoomheight.cpython-311.pyc
�

�Kek���dZddlZddlZddlZGd�de��ZGd�d��Zd�Zd�Ze	d	krdd
l
mZeddd
���dSdS)z Zoom a window to maximum height.�Nc��eZdZdS)�WmInfoGatheringErrorN)�__name__�
__module__�__qualname__���</usr/local/apps/python3/lib/python3.11/idlelib/zoomheight.pyrrs�������Dr	rc�,�eZdZiZd�Zdd�Zd�Zd�ZdS)�
ZoomHeightc�6�||_|jj|_dS�N)�editwin�top)�selfrs  r
�__init__zZoomHeight.__init__s������<�#����r	Nc��|���}|�|j���n&|rdnd}|j�dd|�d����dS)N�Restore�Zoom�optionsz* Heightz Height)�menu�index�label�break)�zoom_heightr�bellr�update_menu_label)r�event�zoomed�menu_statuss    r
�zoom_height_eventzZoomHeight.zoom_height_eventsp���!�!�#�#���>��H�M�M�O�O�O�O�'-�9�)�)�6�K��L�*�*�	��4?�1H�1H�1H�
+�
J�
J�
J��wr	c�&�|j}t|��\}}}}|���dkrdS	|���\}}n#t$rYdSwxYw||krt|||||f��dS|�d��dS)N�normalT�F)r�get_window_geometry�wm_state�get_max_height_and_y_coordr�set_window_geometry�wm_geometry)rr�width�height�x�y�	maxheight�maxys        r
rzZoomHeight.zoom_height!s����h��1�#�6�6���v�q�!��<�<�>�>�X�%�%��4�	�"�=�=�?�?�O�I�t�t��#�	�	�	��4�4�	�����Y�����e�Y��4�%@�A�A�A��4�
�O�O�B�����5s�A�
A�Ac�2�|j}|���|���f}||jv�rR|���}	|�d��n"#t
j$rtd���wxYw|���t|��\}}}}tjdkrd}|���}|�d��|���t|��}	|	dd�|fz}
t||
��|���|���}|||z
z
}||f|j|<t||	��|�|��|j|S)Nrz_Failed getting geometry of maximized windows, because the "zoomed" window state is unavailable.�win32rr#�)r�winfo_screenwidth�winfo_screenheight�_max_height_and_y_coordsr&�tkinter�TclErrorr�updater%�sys�platform�winfo_rootyr()rr�screen_dimensions�
orig_state�maxwidthr.�maxxr/�maxrooty�	orig_geom�
max_y_geom�max_y_geom_rootys            r
r'z%ZoomHeight.get_max_height_and_y_coord<s����h�� �2�2�4�4� �3�3�5�5�7���D�$A�A�A������J�
A����X�&�&�&�&���#�
A�
A�
A�+�@�A�A�A�
A����
�J�J�L�L�L�.A�#�.F�.F�+�H�i��t��|�w�&�&������(�(�H�
�L�L��"�"�"��J�J�L�L�L�+�C�0�0�I�"�2�A�2��$��0�J���Z�0�0�0��J�J�L�L�L�"���0�0��
��$4�4�4�I�?H�$��D�)�*;�<���Y�/�/�/��L�L��$�$�$��,�->�?�?s�A%�%Br)rrrr5rr!rr'rr	r
rrsb������ "��$�$�$�
�
�
�
����6/@�/@�/@�/@�/@r	rc��|���}tjd|��}tt	t
|�������S)Nz(\d+)x(\d+)\+(-?\d+)\+(-?\d+))r)�re�match�tuple�map�int�groups)r�geom�ms   r
r%r%nsC���?�?���D�
��1�4�8�8�A���S�!�(�(�*�*�%�%�&�&�&r	c�@�|�dj|���dS)Nz{:d}x{:d}+{:d}+{:d})r)�format)r�geometrys  r
r(r(ts&���O�O�0�)�0�(�;�<�<�<�<�<r	�__main__)�mainz!idlelib.idle_test.test_zoomheight�F)�	verbosity�exit)�__doc__rEr9r6�	Exceptionrrr%r(r�unittestrQrr	r
�<module>rXs���"�"�	�	�	�	�
�
�
�
�����	�	�	�	�	�9�	�	�	�_@�_@�_@�_@�_@�_@�_@�_@�D'�'�'�=�=�=��z����������D�	,���F�F�F�F�F�F��r