-
Notifications
You must be signed in to change notification settings - Fork 0
/
Layouts.py
143 lines (133 loc) · 4.15 KB
/
Layouts.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import PySimpleGUI as sg
Login_Layout = [
[sg.Text(text="Enter Mysql Login Credentials")],
## Layout for window
[sg.Text(text="Username"), sg.In(default_text="root", key="username")],
[sg.Text(text="Password"), sg.In(password_char="*", key="password")],
[
sg.Button(button_text="Login", key="login"),
sg.Button(button_text="Cancel", key="Cancel"),
],
[
sg.Text(text="Save Password?"),
sg.Radio("Yes", "radio1", key="--SAVE--"),
sg.Radio("No", "radio1"),
],
[sg.Text(key="label", text="", size=(60, 1))],
]
RightColumn = [
[
sg.Text(
text="Create Users Here",
)
],
[
sg.Text(text="Enter Name"),
sg.In(default_text="ABCD", text_color="black", key="name"),
],
[
sg.Text(text="Enter Phone"),
sg.In(default_text="1234567890", text_color="black", key="phone"),
],
[
sg.Text(text="Enter Address"),
sg.In(default_text="H-1892", text_color="black", key="address"),
],
[
sg.Text(text="Covid Status"),
sg.Radio(text="+ve", key="+ve", group_id="radio1"),
sg.Radio(text="-ve", key="-ve", group_id="radio1", default=True),
],
[sg.Button(button_text="Submit", key="submit", pad=(70, 0))],
[sg.Button(button_text="Update", key="Update", pad=(70, 10))],
[sg.Text(text="", size=(40, 1), key="UserError")],
]
## Layout of row 1 column 2 for creating new users
menulayout = [
["Options", ["Clear Database", "Delete Saved Password"]],
["Help", ["About...", "Help"]],
]
leftColumn = [
[sg.Text(text="Find Users Here")],
[
sg.Text(text="Search User By"),
sg.InputOptionMenu(
values=["UserID", "Name", "Address", "Phone", "CovidStatus"], key="option"
),
],
[
sg.Text(text="Enter the query"),
sg.In(key="squery"),
sg.Button(button_text="Search", key="search"),
],
[
sg.Table(
headings=["UserID", "Name", "Phone", "Address", "CovidStatus"],
values=[
("UID", " SAMPLE ", "1234567890", "VWXYZ", "-ve"),
],
enable_events=True,
key="list",
size=(300, 10),
pad=(70, 10),
)
],
]
## Layout of row 1 column 1 for searching existing users
DisabledLeftColumn = [
[
sg.Text(text="Update"),
sg.InputOptionMenu(
values=["---", "Name", "Phone", "Address", "CovidStatus"],
key="l3option",
default_value="---",
),
],
[sg.Text("Enter UserID"), sg.In(key="UQuery")],
[sg.Text("Enter New Value"), sg.In(key="NValue")],
[
sg.Button("Update", key="update"),
sg.Button(button_text="Back to Create Users", key="return", visible=False),
],
]
## Layout of row 1 column 2 (not visible untill update button is pressed) for updating info of existing users
LeftColumn1 = [
[sg.Text(text="Log Meetings Here", pad=(10, 0))],
[
sg.Text(text="Enter UserIDs"),
sg.In(default_text="1,2,4", text_color="black", key="UIs"),
],
[
sg.Text(text="Enter Date "),
sg.In(default_text="yyyy-mm-dd", text_color="black", key="Date"),
],
[
sg.Text(text="Enter Purpose"),
sg.InputOptionMenu(
values=["Friend/Family", "Business", "Service and Repair", "Other"],
key="purpose",
),
],
[sg.Button(button_text="Submit", key="Submit")],
[sg.Text(text="", key="MeetError", size=(40, 1))],
]
## Layout of row 2 column 1 for logging meetings of users
RightColumn1 = [
[sg.Button("COVID test centre near me", k="hospitallist", pad=(20, 10))],
[sg.Button("View Graphs", k="graph", pad=(20, 10))],
]
layout2 = [
[sg.Menu(menulayout)],
[
sg.Column(leftColumn),
sg.VSeperator(color="lightblue", pad=(0, 0)),
sg.Column(RightColumn, key="CreateUser"),
sg.Column(DisabledLeftColumn, visible=False, key="UpdateUser"),
],
[sg.HorizontalSeparator(color="lightblue", pad=(0, 10))],
[
sg.Column(LeftColumn1),
sg.VSeperator(color="lightblue", pad=(0, 0)),
sg.Column(RightColumn1),
],
]