Package arcjobtool :: Module ArcSplash
[hide private]
[frames] | no frames]

Source Code for Module arcjobtool.ArcSplash

 1  # -*- coding: iso-8859-15 -*- 
 2  # generated by wxGlade HG on Fri Jul  3 20:15:50 2009 
 3   
 4  # 
 5  # ArcSplash main window class 
 6  # 
 7   
 8  import wx 
 9   
10  # begin wxGlade: dependencies 
11  # end wxGlade 
12   
13  # begin wxGlade: extracode 
14   
15  # end wxGlade 
16   
17  import os 
18   
19 -class ArcSplash(wx.Frame):
20 """ 21 Splash window class 22 23 Implements the ArcGui splash window. 24 """
25 - def __init__(self, *args, **kwds):
26 # begin wxGlade: ArcSplash.__init__ 27 kwds["style"] = wx.CAPTION|wx.CLOSE_BOX|wx.STAY_ON_TOP 28 wx.Frame.__init__(self, *args, **kwds) 29 self.splashBitmap = wx.StaticBitmap(self, -1, wx.NullBitmap) 30 31 self.__set_properties() 32 self.__do_layout() 33 # end wxGlade 34 35 self.__initWindow()
36
37 - def __set_properties(self):
38 # begin wxGlade: ArcSplash.__set_properties 39 self.SetTitle("ARC Job Submission Tool 0.3.0") 40 self.SetSize((400, -1)) 41 self.SetBackgroundColour(wx.Colour(255, 255, 255)) 42 self.splashBitmap.SetMinSize((400,300))
43 # end wxGlade 44
45 - def __do_layout(self):
46 # begin wxGlade: ArcSplash.__do_layout 47 sizer_34 = wx.BoxSizer(wx.VERTICAL) 48 sizer_34.Add(self.splashBitmap, 1, wx.SHAPED, 0) 49 self.SetSizer(sizer_34) 50 sizer_34.SetSizeHints(self) 51 self.Layout() 52 self.Centre()
53 # end wxGlade 54
55 - def __initWindow(self):
56 """ 57 Window initialisation. 58 59 Loads the splash image from the ArcGui install directory. Starts a timer for closing the window. 60 """ 61 if os.environ.has_key("ARCJOBTOOL_SHARE"): 62 arcGuiImagePath = os.path.join(os.environ["ARCJOBTOOL_SHARE"], "images") 63 if os.path.exists(arcGuiImagePath): 64 self.splashBitmap.SetBitmap(wx.Bitmap(os.path.join(arcGuiImagePath,"ARClogo.png"), wx.BITMAP_TYPE_ANY)) 65 66 self.__splashTimerID = 100 67 self.__splashTimer = wx.Timer(self, self.__splashTimerID) # message will be sent to the panel 68 wx.EVT_TIMER(self, self.__splashTimerID, self.onSplashTimer) 69 70 self.__splashTimer.Start(4000)
71
72 - def onSplashTimer(self, event):
73 """ 74 Event method responding the splash timer. 75 76 Closes the window. 77 """ 78 self.Destroy()
79 80 81 # end of class ArcSplash 82