-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathfirdariadlg.py
More file actions
91 lines (64 loc) · 2.68 KB
/
firdariadlg.py
File metadata and controls
91 lines (64 loc) · 2.68 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
import wx
import mtexts
# ##################################
# Roberto V 7.3.0
# All texts txtsxxx -> txts
# ##################################
#---------------------------------------------------------------------------
# Create and set a help provider. Normally you would do this in
# the app's OnInit as it must be done before any SetHelpText calls.
provider = wx.SimpleHelpProvider()
wx.HelpProvider.Set(provider)
#---------------------------------------------------------------------------
class FirdariaDlg(wx.Dialog):
def __init__(self, parent):
# Instead of calling wx.Dialog.__init__ we precreate the dialog
# so we can set an extra style that must be set before
# creation, and then we create the GUI object using the Create
# method.
# pre = wx.PreDialog()
# pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
# pre.Create(parent, -1, mtexts.txts['Firdaria'], pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_DIALOG_STYLE)
# This next step is the most important, it turns this Python
# object into the real wrapper of the dialog (instead of pre)
# as far as the wxPython extension is concerned.
# self.PostCreate(pre)
wx.Dialog.__init__(self, None, -1, mtexts.txts['Firdaria'], size=wx.DefaultSize)
#main vertical sizer
mvsizer = wx.BoxSizer(wx.VERTICAL)
#Time
sfirdaria =wx.StaticBox(self, label=mtexts.txts['Nocturnal'])
firdariasizer = wx.StaticBoxSizer(sfirdaria, wx.VERTICAL)
vsizer = wx.BoxSizer(wx.VERTICAL)
self.bonrb = wx.RadioButton(self, -1, mtexts.txts['Bonatus'], style=wx.RB_GROUP)
vsizer.Add(self.bonrb, 0, wx.ALIGN_LEFT, 5)
self.birrb = wx.RadioButton(self, -1, mtexts.txts['AlBiruni'])
vsizer.Add(self.birrb, 0, wx.ALIGN_LEFT, 5)
firdariasizer.Add(vsizer, 0, wx.ALIGN_LEFT|wx.ALL, 5)
mvsizer.Add(firdariasizer, 0, wx.GROW|wx.ALIGN_CENTER|wx.LEFT|wx.RIGHT|wx.BOTTOM, 5)
btnsizer = wx.StdDialogButtonSizer()
if wx.Platform != '__WXMSW__':
btn = wx.ContextHelpButton(self)
btnsizer.AddButton(btn)
btnOk = wx.Button(self, wx.ID_OK, mtexts.txts['Ok'])
btnsizer.AddButton(btnOk)
btnOk.SetHelpText(mtexts.txts['HelpOk'])
btnOk.SetDefault()
btn = wx.Button(self, wx.ID_CANCEL, mtexts.txts['Cancel'])
btnsizer.AddButton(btn)
btn.SetHelpText(mtexts.txts['HelpCancel'])
btnsizer.Realize()
mvsizer.Add(btnsizer, 0, wx.GROW|wx.ALL, 10)
self.SetSizer(mvsizer)
mvsizer.Fit(self)
btnOk.SetFocus()
def fill(self, opts):
if opts.isfirbonatti:
self.bonrb.SetValue(True)
else:
self.birrb.SetValue(True)
def check(self, opts):
changed = self.bonrb.GetValue() != opts.isfirbonatti
if changed:
opts.isfirbonatti = self.bonrb.GetValue()
return changed