<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
2a                 @   s   d dl mZmZ d dlmZmZmZmZmZ G dd dZ	G dd de	Z
edkrd dlmZ ed	d
dd d dlmZ ee
 dS )    )ToplevelFrame)EntryLabelButtonCheckbuttonRadiobuttonc               @   sx   e Zd ZdZdZdZdd ZdddZdd	d
Zdd Z	dd Z
dd ZdddZdd Zdd ZdddZdd ZdS ) SearchDialogBasezSearch DialogZSearch   c             C   s   || _ || _d | _d S )N)rootenginetop)selfr   r    r   //opt/alt/python36/lib64/python3.6/searchbase.py__init__    s    zSearchDialogBase.__init__Nc             C   s|   || _ | js| j  n| jj  | jj  |rJ| jjdd | jjd| | jj  | jj	dd | jj
d | jj  d S )Nr   end)textr   create_widgetsZ	deiconifyZtkraiseentdeleteinsertZ	focus_setZselection_rangeZicursorZgrab_set)r   r   Zsearchphraser   r   r   open0   s    



zSearchDialogBase.openc             C   s   | j r| j j  | j j  d S )N)r   Zgrab_releaseZwithdraw)r   Zeventr   r   r   close@   s    
zSearchDialogBase.closec             C   s   t | j}|jd| j |jd| j |jd| j |j| j |j| j	 || _
|j| _d| _| j
jdddd | j
jddddd	 | j  | j  | j  | j  d S )
Nz<Return>z<Escape>ZWM_DELETE_WINDOWr      )padweightr
   d   )r   Zminsizer   )r   r   Zbinddefault_commandr   ZprotocolZwm_titletitleZwm_iconnameiconr   ZbellrowZgrid_columnconfigurecreate_entriescreate_option_buttonscreate_other_buttonscreate_command_buttons)r   r   r   r   r   r   F   s    
zSearchDialogBase.create_widgetsc             C   sV   t | j|d}|j| jddd t| j|dd}|j| jddd | jd | _||fS )N)r   r   nw)r!   columnsticky)ZtextvariableZexportselectionr
   nwe)r   r   gridr!   r   )r   Z
label_textvarlabelentryr   r   r   
make_entry^   s    zSearchDialogBase.make_entryc             C   s   | j d| jjd | _d S )NzFind:r   )r.   r   Zpatvarr   )r   r   r   r   r"   k   s    zSearchDialogBase.create_entriesc             C   s\   |r&t | j|d}|j| jddd nd}t| j}|j| jdddd | jd | _||fS )	N)r   r   r&   )r!   r'   r(    r
   r)   )r!   r'   Z
columnspanr(   )r   r   r*   r!   r   )r   Z	labeltextr,   framer   r   r   
make_frameo   s    
zSearchDialogBase.make_framec             C   s|   | j dd }| j}|jdf|jdf|jdfg}| jrF|j|jdf x,|D ]$\}}t|||d}|j	dd	d
 qLW ||fS )NZOptionsr   zRegular expressionz
Match casez
Whole wordzWrap around)variabler   leftboth)sidefill)
r1   r   ZrevarZcasevarZwordvarneedwrapbuttonappendZwrapvarr   pack)r   r0   r   optionsr+   r,   btnr   r   r   r#      s    z&SearchDialogBase.create_option_buttonsc             C   sV   | j dd }| jj}d
dg}x.|D ]&\}}t||||d}|jddd	 q$W ||fS )NZ	Directionr   r
   UpDown)r2   valuer   r3   r4   )r5   r6   )r
   r<   )r   r=   )r1   r   Zbackvarr   r9   )r   r0   r+   Zothersvalr,   r;   r   r   r   r$      s    z%SearchDialogBase.create_other_buttonsr   c             C   sP   t | j|||rdpdd}| jj \}}|jd|ddd | jj|d d |S )	NZactiveZnormal)r   commanddefaultr
   r   Zew)padyr!   r'   r(   )Zrowspan)r   buttonframeZ	grid_sizer*   )r   r,   r@   ZisdefbZcolsZrowsr   r   r   make_button   s    zSearchDialogBase.make_buttonc             C   s@   t | j }| _|jddddddd | jd| j}|j  d S )Nr   r   )r!   r'   ZpadxrB   ZipadxZipadyr   )r   r   rC   r*   rE   r   lower)r   frD   r   r   r   r%      s    z'SearchDialogBase.create_command_buttons)N)N)N)r   )__name__
__module____qualname__r   r    r7   r   r   r   r   r.   r"   r1   r#   r$   rE   r%   r   r   r   r   r	      s   




r	   c               @   s   e Zd Zdd Zdd ZdS )_searchbasec             C   s|   dd l }ddlm} || _|j|| _| j  t|j  t	t
t|jd|j \}}}}| jjd|d |d f  d S )Nr   )searchenginez[x+]z+%d+%d(      )reZidlelibrL   r   getr   r   printZgeometrylistmapintsplitr   )r   parentrO   rL   widthZheightxyr   r   r   r      s    "z_searchbase.__init__c             C   s   d S )Nr   )r   Zdummyr   r   r   r      s    z_searchbase.default_commandN)rH   rI   rJ   r   r   r   r   r   r   rK      s   rK   __main__)mainz!idlelib.idle_test.test_searchbaser   F)	verbosityexit)runN)Ztkinterr   r   Ztkinter.ttkr   r   r   r   r   r	   rK   rH   Zunittestr[   Zidlelib.idle_test.htestr^   r   r   r   r   <module>   s    -