
     f8                     (   d Z 	 	 ddlZej        d         dk    ZdZ	 erddlZnddlZdZej	        dk     r e
d eej	                  z   dz             n# e$ r d	ZY nw xY wd
ZdZdZdZdZg dZdZdZdZdZdZdZdZdZdZdZdZdadadZ da!da"da#dZ$dZ%dZ&da'da(da)ddeddfdZ*e*Z+ddeefddfdZ,e,Z-d3dZ.e.Z/d4dZ0e0Z1ej2        d k    rd!d"l3m4Z4 dZ5d#Z6d$Z7d%Z8d&Z9e4j+        Z+e4j-        Z-d' Z:d5d(Z;d) Z<d6d*Z=d+ Z>d, Z?d- Z@d. ZAd7d/ZBd0 ZCd1 ZDd2 ZEdS )8z1.0.9    N   Tz+300+200g       @zYou are running Tk version: z<You must be using Tk version 8.0 or greater to use PyMsgBox.F)MSSansSerifCourier
   	      )ReturnzButton-1spaceOKCancelYesNoRetryAbortIgnorez	Try AgainContinueTimeout c                     t           s
J d            t          |           } t          | |t          |          g||          }||S |S )zjDisplays a simple message box with text and a single OK button. Returns the text of the button clicked on. Tkinter is required for pymsgboxmsgtitlechoicesroottimeoutTKINTER_IMPORT_SUCCEEDEDstr
_buttonbox)textr   buttonr   r   retVals         T/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/pymsgbox/__init__.py_alertTkinterr'   l   sZ    #GG%GGGGt99DF}4  F ~    c                 ~    t           s
J d            t          |           } t          | |d |D             ||          S )zDisplays a message box with OK and Cancel buttons. Number and text of buttons can be customized. Returns the text of the button clicked on.r   c                 ,    g | ]}t          |          S  )r!   ).0bs     r&   
<listcomp>z#_confirmTkinter.<locals>.<listcomp>   s    )))AQ)))r(   r   r   )r#   r   buttonsr   r   s        r&   _confirmTkinterr0   |   sX     $GG%GGGGt99D)))))   r(   c                 l    t           s
J d            t          |           } t          | ||d||          S )zyDisplays a message box with text input, and OK & Cancel buttons. Returns the text entered, or None if Cancel was clicked.r   N)defaultmaskr   r   r    r!   __fillablebox)r#   r   r2   r   r   s        r&   _promptTkinterr6      sF    #GG%GGGGt99DeW4dG   r(   *c                 l    t           s
J d            t          |           } t          | |||||          S )zDisplays a message box with text input, and OK & Cancel buttons. Typed characters appear as *. Returns the text entered, or None if Cancel was clicked.r   )r3   r   r   r4   )r#   r   r2   r3   r   r   s         r&   _passwordTkinterr9      s=    #GG%GGGGt99DugDtWUUUUr(   win32   )_native_win       0   @   c                  T    t                                            t          at          ad S N)boxRootdestroyTIMEOUT_RETURN_VALUE__replyButtonText__enterboxTextr+   r(   r&   timeoutBoxRootrH      s!    OO,)NNNr(   c                    |d         a |rC|                                 t          j        |          at                                           n,t          j                    at                                           t                              |           t                              d           t                              t                     t          
                    dd           t          j        t                    }|                    t          j        t          j                   t          j        t                    at                              t          j        t          j                   t          j        || d          }|                    t$          t&          f           |                    t          j        t          j        t          j        d	d	
           t-          |           t.                                           t                                           | t                              |t6                     t                                           	 t                                           n'# t          j        $ r t           t>          k    rda Y nw xY w|r|                                 t           S )a;  
    Display a msg, a title, and a set of buttons.
    The buttons are defined by the members of the choices list.
    Return the text of the button that the user selected.

    @arg msg: the msg to be displayed.
    @arg title: the window title
    @arg choices: a list or tuple of the choices to be displayed
    r   masterDialogi  d   sidefill)r#   widthfont3mrO   expandrP   padxpadyN) rF   withdrawtkToplevelrC   Tkr   iconnamegeometryrootWindowPositionminsizeFramepackTOPBOTHbuttonsFrameMessage	configurePROPORTIONAL_FONT_FAMILYPROPORTIONAL_FONT_SIZEYESX__put_buttons_in_buttonframe__firstWidgetfocus_force	deiconifyafterrH   mainlooprD   TclErrorrE   )r   r   r   r   r   messageFramemessageWidgets          r&   r"   r"      s<     
 +T***%''MM%X'(((OOC 87+++L26000 87+++L26000 J|#SAAAM":<R!STTTBF264dSSS ))) g~...%; % % % 444 $%  s   %I? ?!J#"J#c           	         da i ad}| D ]}t          j        t          d|          }t          |           |                    t          j        t          j        dddd           |t          |<   |dk    r|a d}|}t          }t          D ]}|                    d|z  |           t          | v r|                    d	t                     dS )
z$Put the buttons in the buttons frameNr   r;   	takefocusr#   1m2mrV   rO   rW   rX   ipadxipady<%s><Escape>)rm   __widgetTextsrZ   Buttonre   _bindArrowsrb   rj   LEFT__buttonEventSTANDARD_SELECTION_EVENTSbindCANCEL_TEXT__cancelButtonEvent)r   i
buttonText
tempButtoncommandButtonhandlerselectionEvents          r&   rl   rl      s     MM	A @ @
Y|qzJJJ
J6dTQU 	 	
 	
 	

 %/j! 66&MA #7 	A 	ANv6@@@@'!!z+>???-@ @r(   c                     |                      dt                     |                      dt                     |s8|                      dt                     |                      dt                     d S d S )Nz<Down>z<Up>z<Right>z<Left>)r   	_tabRight_tabLeft)widgetskipArrowKeyss     r&   r   r     sj    
KK)$$$
KK!!! (Iy)))Hh'''''( (r(   c                 :    t                               d           d S )Nz<Tab>rC   event_generateevents    r&   r   r   "  s    7#####r(   c                 :    t                               d           d S )Nz<Shift-Tab>r   r   s    r&   r   r   &  s    =)))))r(   c                 \    t           | j                 at                                           dS )zJ
    Handle an event that is generated by a person clicking a button.
    N)r   r   rF   rC   quitr   s    r&   r   r   *  s"    
 &el3LLNNNNNr(   c                 F    t           at                                           dS )z2Handle pressing Esc by clicking the Cancel button.N)r   rF   rC   r   r   s    r&   r   r   3  s     $LLNNNNNr(   c                    |dk    r|dk     |dk    rd}|a t           a|rC|                                 t          j        |          at
                                           n,t          j                    at
                                           t
                              |           t
                              d           t
          	                    t                     t
                              dt                     t          j        t
                    }|                    t          j        t          j                   t          j        t
                    }|                    t          j        t          j                   t          j        t
                    }|                    t          j        t          j                   t          j        t
                    }|                    t          j        t          j                   t          j        |d|           }	|	                    t&          t(          f	           |	                    t          j        d
t          j        dd           t          j        |d          at1          t.          d           t.                              t&          t2          f	           |rt.                              |           t.                              t          j        d           t.                              dt6                     t.                              dt                     t           dk    rEt.                              dt                      t.                              dt          j                   t          j        |d
t@                    a!t1          tB                     tB                              d
t          j        dddd           tB          }
t6          }tD          D ]}|
                    d|z  |           t          j        |d
tF                    a$t1          tH                     tH                              d
t          j        dddd           tH          }
t          }tD          D ]}|
                    d|z  |           t.          %                                 t
          &                                 | t
          '                    |tP                     t
          )                                 |r|&                                 	 t
          *                                 n(# t          j+        $ r t          tX          k    rY dS Y nw xY wt          S )z
    Show a box in which a user can enter some text.
    You may optionally specify some default text, which will appear in the
    enterbox when it is displayed.
    Returns the text that the user entered, or None if he cancels the operation.
    Nr   rJ   rL   r~   rN   z4.5i)rQ   r#   rR   r;   rT   rU   (   )rQ   T)r   )show)rO   rW   z<Return>r   rv   ry   rx   rz   r}   )-__enterboxDefaultTextrG   rY   rZ   r[   rC   r\   r   r]   r^   r_   r   __enterboxCancelra   rb   rc   rd   rf   rg   rh   ri   RIGHTEntryentryWidgetr   TEXT_ENTRY_FONT_SIZEr   __enterboxGetTextinsertselect_rangeENDr   OK_TEXTokButtonr   r   cancelButtonrn   ro   rp   rH   rq   rD   rr   rE   )r   r   r2   r3   r   r   rs   re   
entryFramert   r   r   r   s                r&   r5   r5   :  s    }}$#*N +T***%''MM%X'(((LL-... 87+++L26000 87+++L26000 )))JOObgO... 87+++L26000 J|6DDDM":<R!STTTBHQRW4dSSS (:R000K40000 8:NOPPP )4((("'---Z!2333Z!1222 ""13444  BF+++ yAAAHMMt$dRVMWWW MG3 = =6N2G<<<< 9\Q[IIILrxdT    
 !MG3 = =6N2G<<<< g~...  ;   11144 21 s   =U U<;U<c                 j    t                                           at                                           d S rB   )r   getrG   rC   r   r   s    r&   r   r     s$     !__&&NLLNNNNNr(   c                     t                               dt          t                                                                t                               dt
                     d S )Nr   )r   deletelenr   r   r   r   s    r&   __enterboxRestorer     sI     q#koo//00111q/00000r(   c                 <    d a t                                           d S rB   )rG   rC   r   r   s    r&   r   r     s     NLLNNNNNr(   )r   r   r   NN)r   r   r   r7   NN)NN)F)r   r   NNN)F__version__sysversion_infoRUNNING_PYTHON_2r    TkinterrZ   tkinterr_   	TkVersionRuntimeErrorr!   ImportErrorrh   MONOSPACE_FONT_FAMILYri   MONOSPACE_FONT_SIZEr   r   r   r   YES_TEXTNO_TEXT
RETRY_TEXT
ABORT_TEXTIGNORE_TEXTTRY_AGAIN_TEXTCONTINUE_TEXTrE   __choiceboxMultipleSelectr   rF   __choiceboxResultsrm   rG   r   __multenterboxTextchoiceboxChoiceschoiceboxWidgetr   rC   re   r'   alertr0   confirmr6   promptr9   passwordplatformr   r<   NO_ICONSTOPQUESTIONWARNINGINFOrH   r"   rl   r   r   r   r   r   r5   r   r   r   r+   r(   r&   <module>r      s9   
( 


#A&!+    % #	|cl*c", LM
 
 	
   % % %$% 3 !      <;;  


   !      
 G$ 
 
 
 
 	 
25D$        
V V V V  <7GDHGDE!G* * *< < < <~@ @ @D( ( ( ($ $ $* * *    k k k k\  1 1 1    s   7A AA