3
7ßL]  ã               @   sš   d Z ddlmZ ddlZddlmZmZ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 e
eƒG dd„ deeƒƒZdS )z$ Enthought pyface package component
é    )ÚDEBUGN)ÚAnyÚBoolÚFontÚInstanceÚIntÚprovides)ÚTupleÚUnicode)ÚISplashScreenÚMSplashScreen)ÚImageResource)Únew_font_likeé   )ÚWindowc               @   s\   e Zd ZdZe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   sd   | j jƒ }tj|jƒ tjtjB d|dtjtjB d�}t	tj
tj
jƒ d tjd�| _tj|| jƒ |S )Nr   r   )Ústyle)Z
point_sizer   éÿÿÿÿ)ÚimageZcreate_imageÚwxr   ZConvertToBitmapZSPLASH_NO_TIMEOUTZSPLASH_CENTRE_ON_SCREENZSIMPLE_BORDERZFRAME_NO_TASKBARr   ZNORMAL_FONTZGetPointSizeZITALICÚ_wx_default_text_fontZ	EVT_PAINTÚ	_on_paint)ÚselfÚparentr   Zsplash_screen© r   ú>/tmp/pip-install-5sebvq2j/pyface/pyface/ui/wx/splash_screen.pyÚ_create_controlA   s    

zSplashScreen._create_controlc             C   s2   | j dk	r | j jdƒ | j jƒ  tjƒ j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_changedf   s    

zSplashScreen._text_changedc             C   s†   | j dk	rz| j jƒ }tj|ƒ}| jdkr0| j}n| j}|j|ƒ | jdkrPd}n| j}|j|ƒ | j	\}}|j
| j||ƒ |jƒ  dS )z3 Called when the splash window is being repainted. NZblack)r   ZGetSplashWindowr   ZPaintDCÚ	text_fontr   ZSetFontÚ
text_colorZSetTextForegroundÚtext_locationZDrawTextÚtextZSkip)r   ÚeventÚwindowÚdcr!   r"   ÚxÚyr   r   r   r   o   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
traits.apir   r   r   r   r   r   r	   r
   Zpyface.i_splash_screenr   r   Zpyface.image_resourcer   Zpyface.wx.util.font_helperr   r&   r   r   r   r   r   r   Ú<module>   s    