Skip to content
Snippets Groups Projects
Commit 7d25724d authored by Colton A Busch's avatar Colton A Busch
Browse files

I have figured out the design and layout of my app, yet I have a bug trying to...

I have figured out the design and layout of my app, yet I have a bug trying to get the extra charge of bacon to the final price. I think it needs me to call the function for the checkbox for bacon, but I am not positive.
parent 1f0ddda5
Branches master
No related tags found
No related merge requests found
from kivy.app import App from kivy.app import App
from kivy.modules import inspector # For inspection. from kivy.modules import inspector # For inspection.
from kivy.core.window import Window # For inspection. from kivy.core.window import Window # For inspection.
from kivy.properties import BooleanProperty, NumericProperty
__app_package__ = 'edu.unl.cse.soft161.order' __app_package__ = 'edu.unl.cse.soft161.order'
__app__ = 'Order Meal' __app__ = 'Order Meal'
...@@ -9,8 +10,19 @@ __flags__ = ['--bootstrap=sdl2', '--requirements=python2,kivy', '--orientation=l ...@@ -9,8 +10,19 @@ __flags__ = ['--bootstrap=sdl2', '--requirements=python2,kivy', '--orientation=l
class OrderApp(App): class OrderApp(App):
original_price = NumericProperty(12.99)
bacon = BooleanProperty(False)
extra = NumericProperty(2.99)
total = NumericProperty(12.99)
def build(self): def build(self):
inspector.create_inspector(Window, self) # For inspection (press control-e to toggle). inspector.create_inspector(Window, self) # For inspection (press control-e to toggle).
def update_total_charge(self):
if self.root.id.bacon(False):
self.total = self.original_price
elif self.root.id.bacon(True):
self.total = self.original_price + self.self.extra
if __name__ == '__main__': if __name__ == '__main__':
......
BoxLayout: BoxLayout:
orientation: 'vertical' orientation: 'vertical'
Label: Label:
text: '[Your meal-ordering GUI here]' text: 'Steak-Stop'
font_size: '40sp'
size_hint: (1,.1)
BoxLayout:
orientation: 'vertical'
BoxLayout:
size_hint: (1,.3)
Label:
text: 'Menu'
BoxLayout:
orientation: 'vertical'
Button:
text: 'Rib-eye'
size_hint: (1,.1)
Button:
text: 'T-Bone'
size_hint: (1,.1)
Button:
text: 'Fillet'
size_hint: (1,.1)
Button:
text: 'Prime rump'
size_hint: (1,.1)
Button:
text: 'flat-iron'
size_hint: (1,.1)
BoxLayout:
orientation: 'horizontal'
Label:
text: 'rare'
font_size: '32sp'
Slider:
id: cook_time
range:(0,100)
value: 50
Label:
text: 'Well-done'
font_size: '32sp'
BoxLayout:
orientation: 'horizontal'
CheckBox:
font_size: '25sp'
CheckBox:
id: bacon
font_size: '25sp'
CheckBox:
font_size: '25sp'
CheckBox:
font_size: '25sp'
BoxLayout:
orientation: 'horizontal'
Label:
text: 'steak sauce'
font_size: '15sp'
Label:
text: 'Bacon strip around steak'
font_size: '15sp'
Label:
text: 'Barbeque sauce'
font_size: '15sp'
Label:
text: 'peppercorn sauce'
font_size: '15sp'
BoxLayout:
orientation: 'vertical'
CheckBox:
text: 'idk'
font_size: '25sp'
Label:
text: 'Steak price' + str(app.total)
size_hint: (.25,1)
font_size: '20sp'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment