a
    §ˆc¢  ã                   @   s¦   d Z ddlmZ ddlZddlZddlmZmZmZm	Z	 ddlm
Z
mZ ddlmZmZ ddlmZ ddlmZ d	d
lmZ d	dlmZ e	eƒG dd„ deeƒƒZdS )z$ Enthought pyface package component
é    )ÚDEBUGN)ÚAnyÚBoolÚIntÚprovides)ÚTupleÚStr)ÚISplashScreenÚMSplashScreen)ÚImage)Únew_font_likeé   )ÚImageResource)ÚWindowc                   @   s`   e Zd ZdZeedƒƒZeeƒZ	e
dƒZeƒ Zeƒ Zeƒ ZeddƒZdd„ Zdd„ Zd	d
„ ZdS )ÚSplashScreenz| The toolkit specific implementation of a SplashScreen.  See the
    ISplashScreen interface for the API documentation.
    ZsplashTé   c                 C   sl   | j  ¡ }tjj| ¡ tjjtjjB d|dtjtj	B d�}t
tjtj ¡ d tjd�| _| tj| j¡ |S )Nr   éÿÿÿÿ)Ústyler   )Z
point_sizer   )ÚimageZcreate_imageÚwxZadvr   ZConvertToBitmapZSPLASH_NO_TIMEOUTZSPLASH_CENTRE_ON_SCREENZSIMPLE_BORDERZFRAME_NO_TASKBARr   ZNORMAL_FONTZGetPointSizeZITALICÚ_wx_default_text_fontZBindZ	EVT_PAINTÚ	_on_paint)ÚselfÚparentr   Zsplash_screen© r   ú]/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pyface/ui/wx/splash_screen.pyÚ_create_control<   s     

ôýzSplashScreen._create_controlc                 C   s2   | j dur | j  d¡ | j  ¡  t ¡  d¡ dS )z6 Called when the splash screen text has been changed. NFT)ÚcontrolZRefreshZUpdater   ZGetAppÚYield)r   r   r   r   Ú_text_changeda   s    

zSplashScreen._text_changedc                 C   s‚   | j durv| j }t |¡}| jdu r,| j}n| j}| |¡ | jdu rLd}n| j}| |¡ | j\}}| 	| j
||¡ | ¡  dS )z3 Called when the splash window is being repainted. NZblack)r   r   ZPaintDCÚ	text_fontr   ZSetFontÚ
text_colorZSetTextForegroundÚtext_locationZDrawTextÚtextZSkip)r   ÚeventÚwindowÚdcr    r!   ÚxÚyr   r   r   r   j   s    






zSplashScreen._on_paintN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   Z	log_levelr   Zshow_log_messagesr   r#   r   r!   r    r   r"   r   r   r   r   r   r   r   r   "   s   
%	r   )r,   Úloggingr   r   Zwx.advZ
traits.apir   r   r   r   r   r   Zpyface.i_splash_screenr	   r
   Zpyface.ui_traitsr   Zpyface.wx.util.font_helperr   Zimage_resourcer   r%   r   r   r   r   r   r   Ú<module>   s   