1
2
3
4
5
6
7
8 import wx
9
10
11
12
13
14
15
16
17 import os
18
20 """
21 Splash window class
22
23 Implements the ArcGui splash window.
24 """
26
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
34
35 self.__initWindow()
36
38
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
44
46
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
54
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)
68 wx.EVT_TIMER(self, self.__splashTimerID, self.onSplashTimer)
69
70 self.__splashTimer.Start(4000)
71
73 """
74 Event method responding the splash timer.
75
76 Closes the window.
77 """
78 self.Destroy()
79
80
81
82