Sindbad~EG File Manager
�
�=Og�-���dZddlTddlmZmZddlmZGd�d��ZGd�de��Zdd
�Zd�Z Gd�d
e��Z
Gd�de
��Zd�ZGd�de
��Z
d�ZGd�de
��Zd�Zedkrd�Ze��d Sd S)a&This modules handles dialog boxes.
It contains the following public symbols:
SimpleDialog -- A simple but flexible modal dialog box
Dialog -- a base class for dialogs
askinteger -- get an integer from the user
askfloat -- get a float from the user
askstring -- get a string from the user
�)�*)�_get_temp_root�_destroy_temp_root)�
messageboxc�:�eZdZdgddddfd�Zd�Zd�Zd�Zd�ZdS)�SimpleDialog�Nc���|rt||���|_nt|��|_|r4|j�|��|j�|��t |j��t|j|d���|_|j�dt���t|j��|_
|j
���||_||_||_
|j�d|j��t!t#|����D]i}||} t%|j
| ||fd����}
||kr|
�t(d �
��|
�t*td����j|j�d|j��|j�|��t3|j|��dS)
N)�class_i�)�text�aspect�)�expand�fill�<Return>c�,�|�|��S�N)�done��self�nums �-/usr/lib64/python3.11/tkinter/simpledialog.py�<lambda>z'SimpleDialog.__init__.<locals>.<lambda>9s��4�9�9�S�>�>���r�command�)�relief�borderwidth)�siderr�WM_DELETE_WINDOW)�Toplevel�root�title�iconname�
_setup_dialog�Message�message�pack�BOTH�Frame�framer�cancel�default�bind�return_event�range�len�Button�config�RIDGE�LEFT�protocol�wm_delete_window� transient�
_place_window)r�masterr�buttonsr.r-r$rr�s�bs r�__init__zSimpleDialog.__init__!s���� )� ���7�7�7�D�I�I� ��(�(�D�I�� &��I�O�O�E�"�"�"��I���u�%�%�%��d�i� � � ��t�y�t�C�@�@�@����������.�.�.��4�9�%�%��
��
���������������� ���z�4�#4�5�5�5���W���&�&� 3� 3�C����A��t�z��,0�c� I� I� I�L�L�L�A��g�~�~�����1��5�5�5�
�F�F��4��F�2�2�2�2�� ���-�t�/D�E�E�E�� ���F�#�#�#��d�i��(�(�(�(�(rc���|j���|j���|j���|j���|jSr)r#�wait_visibility�grab_set�mainloop�destroyr�rs r�gozSimpleDialog.goAsY��� �!�!�#�#�#�� ������� ������� �������x�rc�~�|j�|j���dS|�|j��dSr)r.r#�bellr�r�events rr0zSimpleDialog.return_eventHs<���<���I�N�N�������I�I�d�l�#�#�#�#�#rc�~�|j�|j���dS|�|j��dSr)r-r#rHrrEs rr8zSimpleDialog.wm_delete_windowNs<���;���I�N�N�������I�I�d�k�"�"�"�"�"rc�F�||_|j���dSr)rr#�quitrs rrzSimpleDialog.doneTs!������ �������r)�__name__�
__module__�__qualname__r?rFr0r8r�rrrrsu�������"�d�4��D�)�)�)�)�@���$�$�$�#�#�#�����rrc�H�eZdZdZdd�Zd�Zd�Zd�Zdd�Zdd�Z d �Z
d
�ZdS)�DialogzZClass to open dialogs.
This class is intended as a base class for custom dialogs
Nc��|}|�t��}t�||��|���|�)|���r|�|��|r|�|��t|��||_d|_ t|��}|�|��|_|�
dd���|���|j�||_|�d|j��t#||��|j���|���|���|�|��dS)z�Initialize a dialog.
Arguments:
parent -- a parent window (the application window)
title -- the dialog title
N�)�padx�padyr!)rr"r?�withdraw�winfo_viewabler9r$r&�parent�resultr+�body�
initial_focusr)� buttonboxr7r-r:� focus_setrArB�wait_window)rrZr$r;r\s rr?zDialog.__init__`sh�����>�#�%�%�F����$��'�'�'��
�
������&�"7�"7�"9�"9���N�N�6�"�"�"�� ��J�J�u�����d�����������T�{�{��!�Y�Y�t�_�_���� � �q�q� �!�!�!���������%�!%�D���
�
�(�$�+�6�6�6��d�F�#�#�#���$�$�&�&�&�
�������
�
������������rc�p�d|_t�|��t|j��dS)zDestroy the windowN)r]r"rDrr;rEs rrDzDialog.destroy�s4��!�����������4�;�'�'�'�'�'rc��dS)z�create dialog body.
return widget that should have initial focus.
This method should be overridden, and is called
by the __init__ method.
NrQ)rr;s rr\zDialog.body�� ��
�rc��t|��}t|dd|jt���}|�t
dd���t|dd|j���}|�t
dd���|�d|j��|�d |j��|���d
S)z[add standard button box.
override if you do not want the standard buttons
�OK�
)r�widthrr.rU)r rVrW�Cancel)rrgrrz<Escape>N)r+r3�ok�ACTIVEr)r6r-r/)r�box�ws rr^zDialog.buttonbox�s����D�k�k���3�T��T�W�f�M�M�M�� ���D�q�q��)�)�)��3�X�R���E�E�E�� ���D�q�q��)�)�)�� � �*�d�g�&�&�&�� � �*�d�k�*�*�*����
�
�
�
�
rc�8�|���s|j���dS|���|��� |���|���dS#|���wxYwr)�validater]r_rX�update_idletasks�applyr-rIs rriz Dialog.ok�s����}�}��� ���(�(�*�*�*��F��
�
���������� ��J�J�L�L�L��K�K�M�M�M�M�M��D�K�K�M�M�M�M���s�B�Bc�n�|j�|j���|���dSr)rZr_rDrIs rr-z
Dialog.cancel�s1���;�"��K�!�!�#�#�#��������rc��dS)z�validate the data
This method is called automatically to validate the data before the
dialog is destroyed. By default, it always validates OK.
rrQrEs rrnzDialog.validate�s ���qrc��dS)z�process the data
This method is called automatically to process the data, *after*
the dialog is destroyed. By default, it does nothing.
NrQrEs rrpzDialog.apply�rcrr)rNrOrP�__doc__r?rDr\r^rir-rnrprQrrrSrSYs���������
1�1�1�1�f(�(�(�
�
�
����*�����������
�
�
�
�
rrSNc���|���|���|���}|���}|���}|���}|��|���r�|���|���|z
dzz}|� ��|�
��|z
dzz}|���}|���} t|||z|z
��}t||��}t|| |z|z
��}t|| ��}|jdkrt|d��}n4|���|z
dz}|���|z
dz}|�||��|�d||fz��|���dS)N��aqua�z+%d+%d)�wm_withdrawro�winfo_reqwidth�winfo_reqheight�winfo_vrootwidth�winfo_vrootheight�winfo_ismapped�winfo_rootx�winfo_width�winfo_rooty�winfo_height�winfo_vrootx�winfo_vrooty�min�max�_windowingsystem�winfo_screenwidth�winfo_screenheight�
wm_maxsize�wm_geometry�wm_deiconify)
rlrZ�minwidth� minheight�maxwidth� maxheight�x�y�vrootx�vrootys
rr:r:�s����M�M�O�O�O����������!�!�H��!�!�#�#�I��!�!�#�#�H��#�#�%�%�I�
��f�3�3�5�5����� � �F�$6�$6�$8�$8�8�$C��#I�I����� � �F�$7�$7�$9�$9�I�$E�!�#K�K�����!�!�����!�!����6�H�$�x�/�0�0����6�N�N����6�I�%� �1�2�2����6�N�N�����'�'��A�r�
�
�A��
�
�
�
"�
"�X�
-�!�3��
�
!�
!�
#�
#�i�
/�A�5���L�L��9�%�%�%��M�M�(�a��V�#�$�$�$��N�N�����rc��|jdkr |j�dd|dd��dS|jdkr|�dd��dSdS) Nrwz!::tk::unsupported::MacWindowStyle�style�
moveableModalr �x11z-type�dialog)r��tk�call�
wm_attributes)rls rr&r&sn����V�#�#� �� � �5�w��_�b� *� *� *� *� *�
� �u� $� $� �����*�*�*�*�*�
%� $rc�.�eZdZ dd�Zd�Zd�Zd�ZdS)�_QueryDialogNc�v�||_||_||_||_t�|||��dSr)�prompt�minvalue�maxvalue�initialvaluerSr?)rr$r�r�r�r�rZs rr?z_QueryDialog.__init__s=��
��� ��
� ��
�(�������f�e�,�,�,�,�,rc�H�d|_t�|��dSr)�entryrSrDrEs rrDz_QueryDialog.destroys!����
����t�����rc��t||jt���}|�ddt���t|d���|_|j�ddttz���|j�@|j� d|j��|j�
dt��|jS)N)r�justifyrrU)�rowrV�stickyr�)�namer)�Labelr�r6�grid�W�Entryr��Er��insert�select_range�END)rr;rls rr\z_QueryDialog.body!s����&�t�{�D�9�9�9�� ���1�1�Q��'�'�'��6��0�0�0��
��
���A�A�a��c��2�2�2���(��J���a��!2�3�3�3��J�#�#�A�s�+�+�+��z�rc�l� |���}n0#t$r#tjd|jdz|���YdSwxYw|j�,||jkr!tjdd|jz|���dS|j�,||jkr!tjdd|jz|���dS||_d S)
Nz
Illegal valuez
Please try again)rZrz Too smallz2The allowed minimum value is %s. Please try again.z Too largez2The allowed maximum value is %s. Please try again.r)� getresult�
ValueErrorr�showwarning�errormessager�r�r[)rr[s rrnz_QueryDialog.validate/s
�� ��^�^�%�%�F�F��� � � ��"���!�$8�8��
�
�
�
�
�1�1�
�����=�$��$�-�)?�)?��"��$�&*�m�4��
�
�
�
��1��=�$��$�-�)?�)?��"��$�&*�m�4��
�
�
�
��1�����qs��)A�A)NNNN)rNrOrPr?rDr\rnrQrrr�r�s`������#�-1��-�-�-�-�����������rr�c��eZdZdZd�ZdS)�
_QueryIntegerzNot an integer.c�Z�|�|j�����Sr)�getintr��getrEs rr�z_QueryInteger.getresultTs ���{�{�4�:�>�>�+�+�,�,�,rN�rNrOrPr�r�rQrrr�r�Qs(������$�L�-�-�-�-�-rr�c�,�t||fi|��}|jS)z�get an integer from the user
Arguments:
title -- the dialog title
prompt -- the label text
**kw -- see SimpleDialog class
Return value is an integer
)r�r[�r$r��kw�ds r�
askintegerr�Xs"�� �e�V�*�*�r�*�*�A��8�Orc��eZdZdZd�ZdS)�_QueryFloatzNot a floating point value.c�Z�|�|j�����Sr)� getdoubler�r�rEs rr�z_QueryFloat.getresultjs ���~�~�d�j�n�n�.�.�/�/�/rNr�rQrrr�r�gs(������0�L�0�0�0�0�0rr�c�,�t||fi|��}|jS)z�get a float from the user
Arguments:
title -- the dialog title
prompt -- the label text
**kw -- see SimpleDialog class
Return value is a float
)r�r[r�s r�askfloatr�ns"�� �E�6�(�(�R�(�(�A��8�Orc� �eZdZd�Zd�Zd�ZdS)�_QueryStringc�h�d|vr|d|_|d=nd|_tj|g|�Ri|��dS)N�show)�_QueryString__showr�r?)r�argsr�s rr?z_QueryString.__init__~sM���R�<�<��V�*�D�K��6�
�
��D�K���d�0�T�0�0�0�R�0�0�0�0�0rc��t�||��}|j�|�|j���|S)N)r�)r�r\r�� configure)rr;r�s rr\z_QueryString.body�s:���!�!�$��/�/���;�"��O�O���O�-�-�-��rc�4�|j���Sr)r�r�rEs rr�z_QueryString.getresult�s���z�~�~���rN)rNrOrPr?r\r�rQrrr�r�}sA������1�1�1���� � � � � rr�c�,�t||fi|��}|jS)z�get a string from the user
Arguments:
title -- the dialog title
prompt -- the label text
**kw -- see SimpleDialog class
Return value is a string
)r�r[r�s r� askstringr��s"�� �U�F�)�)�b�)�)�A��8�Or�__main__c��t��}|fd�}t|d|���}|���t|d|j���}|���|���dS)Nc�.�t|dgd�ddd���}t|�����ttddd �
����tt dddd
�����ttdd����dS)Nz�This is a test dialog. Would this have been an actual dialog, the buttons below would have been glowing in soft pink light.
Do you believe this?)�Yes�NorhrrvzTest Dialog)rr<r.r-r$�Spamz Egg count�)r�zEgg weight
(in tons)r�d)r�r�z Egg label)r�printrFr�r�r�)r#r�s r�doitztest.<locals>.doit�s����T�5�
"9�!8�!8�!"� !�,� .� .� .�A�
�!�$�$�&�&�M�M�M��*�V�[�u�E�E�E�F�F�F��(�6�#:�Q�$'�)�)�)�
*�
*�
*��)�F�K�0�0�1�1�1�1�1r�Testr�Quit)�Tkr3r)rMrC)r#r��t�qs r�testr��sy���t�t��� 2� 2� 2� 2�
�4�f�d�3�3�3�� �������4�f�a�f�5�5�5�� ������ �
�
�����rr)rt�tkinterrrrrr"rSr:r&r�r�r�r�r�r�r�rNr�rQrr�<module>r�s���
�
�����6�6�6�6�6�6�6�6�������7�7�7�7�7�7�7�7�tI
�I
�I
�I
�I
�X�I
�I
�I
�\����:+�+�+�@�@�@�@�@�6�@�@�@�F-�-�-�-�-�L�-�-�-����0�0�0�0�0�,�0�0�0���� � � � � �<� � � �&����z������0 �D�F�F�F�F�F�5�r
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists