-
Notifications
You must be signed in to change notification settings - Fork 11
/
PartyInfoPanel.py
78 lines (57 loc) · 2.82 KB
/
PartyInfoPanel.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
74
75
76
77
78
# All works in this code have been curated by ECCC and licensed under the GNU General Public License v3.0.
# Read more: https://www.gnu.org/licenses/gpl-3.0.en.html
import wx
class PartyInfoPanel(wx.Panel):
def __init__(self, mode, *args, **kwargs):
super(PartyInfoPanel, self).__init__(*args, **kwargs)
self.partyLbl = "Party:"
self.completeLbl = "Completed by:"
self.checkLbl= "Checked by:"
self.reviewedLbl = "Reviewed"
self.mode=mode
self.manager = None
self.InitUI()
def InitUI(self):
if self.mode=="DEBUG":
print("Party Info Panel")
layoutSizer = wx.BoxSizer(wx.HORIZONTAL)
partySizer = wx.BoxSizer(wx.HORIZONTAL)
partyTxt = wx.StaticText(self, label=self.partyLbl, style=wx.ALIGN_CENTRE_HORIZONTAL)
self.partyCtrl = wx.TextCtrl(self, style=wx.TE_PROCESS_ENTER)
partySizer.Add(partyTxt, 0, wx.EXPAND|wx.LEFT|wx.TOP|wx.BOTTOM, 8)
partySizer.Add(self.partyCtrl, 1, wx.EXPAND|wx.LEFT|wx.TOP|wx.BOTTOM, 5)
completeSizer = wx.BoxSizer(wx.HORIZONTAL)
completeTxt = wx.StaticText(self, label=self.completeLbl, style=wx.ALIGN_CENTRE_HORIZONTAL)
self.completeCtrl = wx.TextCtrl(self, style=wx.TE_PROCESS_ENTER)
completeSizer.Add(completeTxt, 0, wx.EXPAND|wx.LEFT|wx.TOP|wx.BOTTOM, 8)
completeSizer.Add(self.completeCtrl, 1, wx.EXPAND|wx.LEFT|wx.TOP|wx.BOTTOM, 5)
checkSizer = wx.BoxSizer(wx.HORIZONTAL)
checkTxt = wx.StaticText(self, label=self.checkLbl, style=wx.ALIGN_CENTRE_HORIZONTAL)
self.checkCtrl = wx.TextCtrl(self, style=wx.TE_PROCESS_ENTER)
checkSizer.Add(checkTxt, 0, wx.EXPAND|wx.LEFT|wx.TOP|wx.BOTTOM, 8)
checkSizer.Add(self.checkCtrl, 1, wx.EXPAND|wx.LEFT|wx.TOP|wx.BOTTOM, 5)
for i in range(len(checkSizer.GetChildren())):
checkSizer.Hide(i)
# Reviewed Checkbox
reviewedSizer = wx.BoxSizer(wx.HORIZONTAL)
self.reviewedCB = wx.CheckBox(self, label=self.reviewedLbl, style=wx.ALIGN_RIGHT)
reviewedSizer.Add((-1, -1), 1, wx.EXPAND)
reviewedSizer.Add(self.reviewedCB, 0, wx.EXPAND)
reviewedSizer.Add((-1, -1), 1, wx.EXPAND)
controlRemarksSizer = wx.BoxSizer(wx.VERTICAL)
layoutSizer.Add(partySizer, 3, wx.EXPAND)
layoutSizer.Add(completeSizer, 2, wx.EXPAND)
layoutSizer.Add(checkSizer, 2, wx.EXPAND)
layoutSizer.Add(reviewedSizer, 1, wx.EXPAND|wx.ALL|wx.CENTER, 5)
self.SetSizer(layoutSizer)
def ReviewedIsChecked(self):
return self.reviewedCB.IsChecked()
def main():
app = wx.App()
frame = wx.Frame(None, size=(800, 70))
PartyInfoPanel("DEBUG", frame)
frame.Centre()
frame.Show()
app.MainLoop()
if __name__ == '__main__':
main()