forked from geraldspreer/the-maker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makerAbout.py
executable file
·73 lines (57 loc) · 2.68 KB
/
makerAbout.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import wx
import os
import os.path
import sys
from makerWidgets import MakerDialog
def create(parent):
return MakerAbout(parent)
class MakerAbout(MakerDialog):
def __init__(self, parent, versionNr):
self.version = versionNr
self.createDialog(parent)
# ================================================================
def createDialog(self, prnt):
MakerDialog.__init__(self,
{'name' : '',
'parent' : prnt,
'pos' : wx.Point(490, 398),
'size' : wx.Size(647, 318),
'style' : wx.DEFAULT_DIALOG_STYLE,
'title' : 'About',
'clientSize' : wx.Size(639, 284),
'centerPos' : wx.BOTH})
# ----- OK BUTTON -----
self.OKbutton = self.add('button', {'label' : 'OK',
'name' : 'okButton',
'parent' : self,
'pos' : None,
'size' : None,
'style' : 0,
'handler' : self.onOKButton})
iName = os.path.join(os.path.dirname(sys.argv[0]), 'system/Splash.png')
theBitMap = wx.Bitmap(iName, wx.BITMAP_TYPE_PNG)
self.staticBitmap1 = wx.StaticBitmap(self,
id=wx.NewId(),
bitmap=theBitMap,
pos=wx.Point(0, 0),
size=wx.Size(641, 246),
style=0,
name='staticBitmap1')
self.staticText1 = self.add('staticText',
{'label' : 'Version number',
'name' : 'staticText1',
'parent' : self,
'pos' : wx.Point(10, 250),
'size' : wx.Size(184, 13),
'style' : 0})
self.staticText1.SetLabel(u'Version: %s' % str(self.version))
# set correct position for button
# using a sizer for just one button seemed overkill
buttonSize = self.OKbutton.GetSizeTuple()
winSize = self.GetSizeTuple()
diff = winSize[0] - buttonSize[0]
self.OKbutton.SetPosition(wx.Point(diff - 10, 245))
# ================================================================
def onOKButton(self, event):
self.Close()
event.Skip()