B
    2*\^                 @   s\   d Z ddlZddlZddlmZ G dd dZdd ZedkrXdd	lm	Z	 e	d
ddd dS )z Zoom a window to maximum height.    N)macosxc               @   s   e Zd Zdd ZdddZdS )
ZoomHeightc             C   s
   || _ d S )N)editwin)selfr    r   =C:\ALexclude\prg\programme\Python37\Lib\idlelib\zoomheight.py__init__   s    zZoomHeight.__init__Nc             C   s8   | j j}t|}|rdnd}| j jdd| dd dS )NZRestoreZZoomoptionsz* Heightz Height)ZmenuindexZlabelbreak)r   topzoom_heightZupdate_menu_label)r   Zeventr   ZzoomedZmenu_statusr   r   r   zoom_height_event   s    
zZoomHeight.zoom_height_event)N)__name__
__module____qualname__r   r   r   r   r   r   r   	   s   r   c       
      C   s   |   }td|}|s$|   d S tt| \}}}}|  }tj	dkrZd}|d }n&t
 rtd}|| d }nd}|d }||krd}	nd||||f }	|  |	 |	dkS )	Nz(\d+)x(\d+)\+(-?\d+)\+(-?\d+)win32r   H      X    z%dx%d+%d+%d)Zwm_geometryrematchZbellmapintgroupsZwinfo_screenheightsysplatformr   ZisAquaTk)
r   ZgeommwidthZheightxyZ	newheightZnewyZnewgeomr   r   r   r      s(    


r   __main__)mainz!idlelib.idle_test.test_zoomheight   F)	verbosityexit)
__doc__r   r   Zidlelibr   r   r   r   Zunittestr#   r   r   r   r   <module>   s    