Sindbad~EG File Manager
�
&Μgk���dZddlZddlZddlZGd�de�ZGd�d�Zd�Zd�Ze d k(rdd
l
mZeddd
��yy)z Zoom a window to maximum height.�Nc��eZdZy)�WmInfoGatheringErrorN)�__name__�
__module__�__qualname__���//usr/local/lib/python3.12/idlelib/zoomheight.pyrrs��r rc�*�eZdZiZd�Zdd�Zd�Zd�Zy)�
ZoomHeightc�H�||_|jj|_y�N)�editwin�top)�selfrs r
�__init__zZoomHeight.__init__s������<�<�#�#��r Nc��|j�}|�|jj�y|rdnd}|jj dd|�d���y)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_events]���!�!�#���>��H�H�M�M�O�� (.�)�6�K��L�L�*�*� ��4?�=��1H�
+�
J�r c��|j}t|�\}}}}|j�dk7ry |j�\}}||k7rt|||||f�y|j
d�y#t$rYywxYw)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�h��1�#�6���v�q�!��<�<�>�X�%�� �"�=�=�?�O�I�t��Y����e�Y��4�%@�A��
�O�O�B����$� �� �s�A-�- A9�8A9c���|j}|j�|j�f}||jvr�|j �} |j d�|j�t|�\}}}}tjdk(rd}|j�}|j d�|j�t|�} | dd|fz}
t||
�|j�|j�}|||z
z
}||f|j|<t|| �|j |�|j|S#t
j$rtd��wxYw)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<sf���h�h�� �2�2�4� �3�3�5�7���D�$A�$A�A�����J�
A����X�&�
�J�J�L�.A�#�.F�+�H�i��t��|�|�w�&������(�H�
�L�L��"��J�J�L�+�C�0�I�"�2�A��$��0�J���Z�0��J�J�L�"���0��
��$4�4�4�I�?H�$��D�)�)�*;�<���Y�/��L�L��$��,�,�->�?�?��I�#�#�
A�+�@�A�A�
A�s�E�E'r)rrrr5rr!rr'rr r
rrs�� "��$�
��6/@r rc��|j�}tjd|�}tt t
|j
���S)Nz(\d+)x(\d+)\+(-?\d+)\+(-?\d+))r)�re�match�tuple�map�int�groups)r�geom�ms r
r%r%ns7���?�?��D�
���1�4�8�A���S�!�(�(�*�%�&�&r c�@�|jdj|��y)Nz{:d}x{:d}+{:d}+{:d})r)�format)r�geometrys r
r(r(ts���O�O�0�)�0�0�(�;�<r �__main__)�mainz!idlelib.idle_test.test_zoomheight�F)� verbosity�exit)�__doc__rEr9r6� Exceptionrrr%r(r�unittestrQrr r
�<module>rXsU��"� �
�� �9� �_@�_@�D'�=��z���� ,���F�r
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists