Your IP : 18.222.184.184
B
YI~d(2 � @ s� d dl Z d dlZd dlmZ d dlmZ d dlm Z d dl
mZ d dlm
Z
ddd�ZG d d
� d
ej�ZG dd� d�Ze�� ed
kr�d dlmZ edddd� dS )� N)�idleConf)� view_text)�Hovertip)�macosx�P c C s� d}d}d}d}x�t �d| �D ]~}|�� | }||7 }||7 }| | dkrp||krb||d | 7 }|d7 }d}n$|||| 7 }||kr�|d7 }|}|d7 }qW |t| �| 7 }|dkr�||d | 7 }n|d8 }|S )N� r � z[\t\n]�
)�re�finditer�start�len)�sZ linewidthZtabwidth�posZ linecountZcurrent_column�m�numchars� r �5/opt/alt/python37/lib64/python3.7/idlelib/squeezer.py�count_lines_with_wrapping s. r c @ sF e Zd Zdd� Zdd� Zddd�Zddd �Zdd
d�ZdZd
d� Z dS )�ExpandingButtonc
s� � | _ || _|| _|| _|j | _}|j | _}|jj| _|dkrFdnd}d|� d|� d�}t j
j| ||ddd � d
} t| | dd� | �
d
| j� t�� r�| �
d| j� n| �
d| j� | �� fdd�� d | _| �| j� d S )Nr �lines�linezSqueezed text (� z).z#FFFFC0z#FFFFE0)�textZ
backgroundZactivebackgroundz5Double-click to expand, right-click for more options.r )Zhover_delayz<Double-Button-1>z
<Button-2>z
<Button-3>c s � t | �t | �t |� � S )N)�int)�offset�length)r r r �<lambda>z � z*ExpandingButton.__init__.<locals>.<lambda>)r �tags�
numoflines�squeezer�editwinr �per�bottom� base_text�tk�Button�__init__r Zbind�expandr ZisAquaTk�context_menu_eventZselection_handle�is_dangerousZ
after_idle�set_is_dangerous)
�selfr r r r! r"