-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
56 lines (42 loc) · 1.6 KB
/
main.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
from kivy.app import App
from kivymd.theming import ThemeManager
from kivymd.app import MDApp
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.properties import ObjectProperty
from kivy.uix.popup import Popup
from kivy.uix.label import Label
from kivy.config import Config
Config.set('graphics', 'resizable', True)
class WindowManager(ScreenManager):
class MainWindow(Screen):
def test(self):
if float(self.ids.R.text) * float(self.ids.s.text) <= 0:
invalidData()
else:
pass
class WindowV(Screen):
def change_place(self):
screen2 = self.manager.get_screen('main')
if float(self.ids.m.text):
if float(screen2.ids._result.text) > 0:
math = str(float(self.ids.m.text) / float(screen2.ids._result.text))
return math
invalidData()
class WindowX(Screen):
def change_place2(self):
screen2 = self.manager.get_screen('main')
if float(self.ids.V.text):
if screen2.ids._result.text:
if self.ids.m2.text > 0:
math = str(float(self.ids.V.text) * float(screen2.ids._result.text) / float(self.ids.m2.text) * 100)
return math
invalidData()
def invalidData():
pop = Popup(title='Źle wpisane dane', content=Label(text='Źle wpisano dane.'),
size_hint=(None, None),
size=(400, 400))
pop.open()
class MyApp(MDApp):
def build(self):
self.theme_cls.primary_palette = 'LightGreen'
MyApp().run()