2019-09-04 09:47:09 +00:00
#!/usr/bin/env python3
#
2019-09-10 10:06:56 +00:00
# RoarWindowAbout.py
2019-09-04 14:23:59 +00:00
# Copyright (c) 2018, 2019 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de>
2019-09-04 09:47:09 +00:00
#
from glob import glob
import os , random , wx , wx . adv
2019-09-10 10:06:56 +00:00
class RoarWindowAbout ( wx . Dialog ) :
2019-09-08 16:08:04 +00:00
# {{{ onButtonRoar(self, event)
2019-09-04 09:47:09 +00:00
def onButtonRoar ( self , event ) :
self . Destroy ( )
# }}}
#
2019-09-08 16:08:04 +00:00
# __init__(self, parent, size=(320, 240), title="About roar")
2019-09-04 09:47:09 +00:00
def __init__ ( self , parent , size = ( 320 , 240 ) , title = " About roar " ) :
2019-09-10 08:22:02 +00:00
super ( ) . __init__ ( parent , size = size , title = title )
2019-09-04 09:47:09 +00:00
self . panel , self . sizer , self . sizerH1 , self . sizerH2 = wx . Panel ( self ) , wx . BoxSizer ( wx . VERTICAL ) , wx . BoxSizer ( wx . HORIZONTAL ) , wx . BoxSizer ( wx . HORIZONTAL )
logoPathNames = glob ( os . path . join ( " assets " , " images " , " logo*.bmp " ) )
logoPathName = logoPathNames [ random . randint ( 0 , len ( logoPathNames ) - 1 ) ]
self . logo = wx . StaticBitmap ( self , - 1 , wx . Bitmap ( logoPathName ) )
self . sizerH1 . Add ( self . logo , 0 , wx . CENTER )
2019-09-09 17:34:22 +00:00
self . title = wx . StaticText ( self . panel , label = " roar -- mIRC art editor for Windows && Linux \n Git revision __ROAR_RELEASE_GIT_SHORT_REV__ \n https://www.github.com/lalbornoz/roar/ \n Copyright (c) 2018, 2019 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> " , style = wx . ALIGN_CENTER )
2019-09-04 09:47:09 +00:00
self . title . SetFont ( wx . Font ( 8 , wx . DEFAULT , wx . NORMAL , wx . NORMAL , underline = False ) )
self . sizer . Add ( self . title )
labelsText = [ " roar! " , " ROAR! " , " roaaaaaaar! " , " ROAROARAOR " , " _ROAR_ " ]
labelText = labelsText [ random . randint ( 0 , len ( labelsText ) - 1 ) ]
self . buttonRoar = wx . Button ( self . panel , label = labelText , pos = ( 75 , 10 ) )
self . buttonRoar . Bind ( wx . EVT_BUTTON , self . onButtonRoar )
self . sizerH2 . Add ( self . buttonRoar , 0 , wx . CENTER )
self . sizer . Add ( self . sizerH1 , 0 , wx . CENTER )
self . sizer . Add ( self . sizerH2 , 0 , wx . CENTER )
self . SetSizer ( self . sizer ) ; self . sizer . Fit ( self . panel ) ;
self . SetSize ( size ) ; self . SetTitle ( title ) ; self . Center ( ) ;
soundBitePathNames = glob ( os . path . join ( " assets " , " audio " , " roar*.wav " ) )
soundBitePathName = soundBitePathNames [ random . randint ( 0 , len ( logoPathNames ) - 1 ) ]
self . soundBite = wx . adv . Sound ( soundBitePathName )
if self . soundBite . IsOk ( ) :
self . soundBite . Play ( wx . adv . SOUND_ASYNC )
self . ShowModal ( )
# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120