2019-09-04 05:47:09 -04:00
#!/usr/bin/env python3
#
2019-09-10 06:06:56 -04:00
# RoarWindowAbout.py
2019-09-04 10:23:59 -04:00
# Copyright (c) 2018, 2019 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de>
2019-09-04 05:47:09 -04:00
#
from glob import glob
import os , random , wx , wx . adv
2019-09-10 06:06:56 -04:00
class RoarWindowAbout ( wx . Dialog ) :
2019-09-08 12:08:04 -04:00
# {{{ onButtonRoar(self, event)
2019-09-04 05:47:09 -04:00
def onButtonRoar ( self , event ) :
self . Destroy ( )
# }}}
#
2019-09-10 07:24:47 -04:00
# __init__(self, parent, minSize=(320, 300), title="About roar")
def __init__ ( self , parent , minSize = ( 320 , 300 ) , title = " About roar " ) :
super ( ) . __init__ ( parent , size = minSize , title = title )
2019-09-10 12:43:08 -04:00
self . panel , self . sizer , self . sizerV = wx . Panel ( self ) , wx . FlexGridSizer ( 2 , 2 , 4 , 4 ) , wx . BoxSizer ( wx . VERTICAL )
2019-09-04 05:47:09 -04:00
logoPathNames = glob ( os . path . join ( " assets " , " images " , " logo*.bmp " ) )
logoPathName = logoPathNames [ random . randint ( 0 , len ( logoPathNames ) - 1 ) ]
2019-09-10 07:24:47 -04:00
self . logo = wx . StaticBitmap ( self . panel , - 1 , wx . Bitmap ( logoPathName ) )
2019-09-04 05:47:09 -04:00
2019-09-14 10:16:36 -04:00
self . title = wx . StaticText ( self . panel , label = " roar -- mIRC art editor for Windows && Linux \n __ROAR_RELEASE_VERSION__ \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 05:47:09 -04:00
self . title . SetFont ( wx . Font ( 8 , wx . DEFAULT , wx . NORMAL , wx . NORMAL , underline = False ) )
2019-09-10 07:24:47 -04:00
labelsText = [ " &roar! " , " &ROAR! " , " &roaaaaaaar! " , " &ROAROARAOR " , " _&ROAR_ " ]
2019-09-04 05:47:09 -04:00
labelText = labelsText [ random . randint ( 0 , len ( labelsText ) - 1 ) ]
2019-09-10 07:24:47 -04:00
self . buttonRoar = wx . Button ( self . panel , label = labelText )
2019-09-04 05:47:09 -04:00
self . buttonRoar . Bind ( wx . EVT_BUTTON , self . onButtonRoar )
2019-09-10 12:43:08 -04:00
self . sizerV . AddMany ( ( ( self . title , 0 , wx . ALL | wx . CENTER , 4 ) , ( self . buttonRoar , 0 , wx . ALL | wx . CENTER , 4 ) , ) )
2019-09-04 05:47:09 -04:00
2019-09-10 12:43:08 -04:00
self . sizer . AddMany ( (
( self . logo , 0 , wx . ALL | wx . CENTER , 4 ) ,
( self . sizerV , 0 , wx . ALL | wx . CENTER , 3 ) , ) )
2019-09-10 07:24:47 -04:00
self . panel . SetSizerAndFit ( self . sizer )
self . SetClientSize ( self . sizer . ComputeFittingClientSize ( self ) ) ; self . Center ( ) ;
self . SetTitle ( title )
2019-09-04 05:47:09 -04:00
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