This repository has been archived by the owner on Dec 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain_deprecated.py
322 lines (290 loc) · 8.47 KB
/
Main_deprecated.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
import kivy
import os.path
from kivy.uix.label import Label
from kivy.uix.gridlayout import GridLayout
from kivy.uix.textinput import TextInput
from kivy.uix.button import Button
from kivy.uix.screenmanager import ScreenManager, Screen, RiseInTransition, \
FallOutTransition, NoTransition
from kivy.uix.boxlayout import BoxLayout
from pathlib import Path
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.popup import Popup
from kivy.core.window import Window
Window.clearcolor = (1, 1, 1, 1)
# kv = Builder.load_file(os.path.join(dirname(__file__), '../uofthacks2020/my.kv'))
Builder.load_string("""
<MainScreen>:
GridLayout:
cols: 2
GridLayout:
rows: 5
Label:
text: "CS:GO Market Place"
color: 0,0,0,1
size_hint_x: None
width: 200
Button:
text: "Items"
background_color: 1, .3, .4, .85
size_hint_x: None
width: 200
on_press:
app.items_event()
Button:
text: "Transactions"
size_hint_x: None
width: 200
on_press:
app.transactions_event()
Button:
text: "Users"
size_hint_x: None
width: 200
on_press:
app.users_event()
Button:
text: "My vault"
size_hint_x: None
width: 200
on_press:
app.vault_event()
Label:
button: "Right"
background_color: 1, .3, .4, .85
<TransactionsScreen>:
GridLayout:
cols: 2
GridLayout:
rows: 5
Label:
text: "CS:GO Market Place"
color: 0,0,0,1
size_hint_x: None
width: 200
Button:
text: "Items"
size_hint_x: None
width: 200
on_press:
app.items_event()
Button:
text: "Transactions"
background_color: 1, .3, .4, .85
size_hint_x: None
width: 200
on_press:
app.transactions_event()
Button:
text: "Users"
size_hint_x: None
width: 200
on_press:
app.users_event()
Button:
text: "My vault"
size_hint_x: None
width: 200
on_press:
app.vault_event()
Label:
button: "Right"
background_color: 1, .3, .4, .85
<UsersScreen>:
GridLayout:
cols: 2
GridLayout:
rows: 5
Label:
text: "CS:GO Market Place"
color: 0,0,0,1
size_hint_x: None
width: 200
Button:
text: "Items"
size_hint_x: None
width: 200
on_press:
app.items_event()
Button:
text: "Transactions"
size_hint_x: None
width: 200
on_press:
app.transactions_event()
Button:
text: "Users"
background_color: 1, .3, .4, .85
size_hint_x: None
width: 200
on_press:
app.users_event()
Button:
text: "My vault"
size_hint_x: None
width: 200
on_press:
app.vault_event()
Label:
button: "Right"
background_color: 1, .3, .4, .85
<VaultScreen>:
GridLayout:
cols: 2
GridLayout:
rows: 5
Label:
text: "CS:GO Market Place"
color: 0,0,0,1
size_hint_x: None
width: 200
Button:
text: "Items"
size_hint_x: None
width: 200
on_press:
app.items_event()
Button:
text: "Transactions"
size_hint_x: None
width: 200
on_press:
app.transactions_event()
Button:
text: "Users"
size_hint_x: None
width: 200
on_press:
app.users_event()
Button:
text: "My vault"
background_color: 1, .3, .4, .85
size_hint_x: None
width: 200
on_press:
app.vault_event()
Label:
button: "Right"
background_color: 1, .3, .4, .85
<LoginScreen>:
GridLayout:
cols: 1
GridLayout:
cols: 2
Label:
text: "Username"
TextInput:
id: username
GridLayout:
cols: 2
Label:
text: "Password"
TextInput:
id: password
Button:
text:"Login"
on_press:
app.login_event()
<LoginFailPopup>
BoxLayout:
height: "40dp"
# size_hint_y: None
Label:
text: "Username"
size_hint_x: 20
TextInput:
size_hint_x: 20
Button:
text: "Check Answer"
size_hint_x: 25
# TextInput:
# id: username
# Label:
# text: "Credential does not match"
# size_hint: 0.6, 0.2
# pos_hint: {"x":0.2,"top":0.1}
# Button:
# text: "Create New Account"
# size_hint: 0.8, 0.2
# pos_hint: {"x":0.1, "y":0.1}
# on_press:
# app.create_new_account()
""")
# class LoginScreen(Screen):
# pass
# # def __init__(self, **kwargs):
# # super(LoginScreen, self).__init__(**kwargs)
# # self.inside = GridLayout()
# # self.inside.cols = 2
# # self.cols = 1
# #
# # self.inside.add_widget(Label(text='User Name'))
# # self.username = TextInput(multiline=False)
# # self.inside.add_widget(self.username)
# # self.inside.add_widget(Label(text='password'))
# # self.password = TextInput(password=True, multiline=False)
# # self.inside.add_widget(self.password)
# # self.add_widget(self.inside)
# #
# # self.login = Button(text="Login", font_size=40)
# # self.add_widget(self.login)
# # self.login.bind(on_press=self.login_pressed)
# #
# # def login_pressed(self, instance):
# # username = self.username.text
# # password = self.password.text
# # # get data from toda and compare
class MainScreen(Screen):
pass
class TransactionsScreen(Screen):
pass
class UsersScreen(Screen):
pass
class VaultScreen(Screen):
pass
# class LoginFailPopup(Screen):
# pass
#
#
# class CreateNewAccountPopup(Screen):
# pass
wm = ScreenManager(transition=NoTransition())
wm.add_widget(MainScreen(name='items'))
wm.add_widget(TransactionsScreen(name='transactions'))
wm.add_widget(UsersScreen(name='users'))
wm.add_widget(VaultScreen(name='vault'))
# wm.add_widget(LoginScreen(name='second'))
# wm.add_widget(LoginFailPopup(name='fail_login'))
class Main(App):
def build(self):
return wm
# def login_event(self):
# # CHECK LOGIN CREDENTIAL
# # if PASS
# self.root.current = "items"
# # if FAIL
# self.show_pop_up()
def items_event(self):
self.root.current = "items"
def transactions_event(self):
self.root.current = "transactions"
def users_event(self):
self.root.current = "users"
def vault_event(self):
self.root.current = "vault"
# def show_pop_up(self):
# show = LoginFailPopup()
# popupWindow = Popup(title="Login", content=show,
# size_hint=(None, None), size=(400, 400))
# popupWindow.open()
# def create_new_account(self):
# pass
#
# def open_crate(self):
# pass
#
# def start_trade(self):
# pass
if __name__ == '__main__':
Main().run()