Commit f0201add authored by Cameron Irwin's avatar Cameron Irwin
Browse files

Finished App

parent 1f0ddda5
from kivy.app import App
from kivy.modules import inspector # For inspection.
from kivy.core.window import Window # For inspection.
from kivy.properties import NumericProperty
__app_package__ = 'edu.unl.cse.soft161.order'
__app__ = 'Order Meal'
__version__ = '0.1'
......@@ -12,7 +12,30 @@ class OrderApp(App):
def build(self):
inspector.create_inspector(Window, self) # For inspection (press control-e to toggle).
total = NumericProperty(0)
def addDoubleDoubleToOrder(self):
if self.root.ids.doubleDouble.active:
self.total += 6.50
print(self.total)
if not self.root.ids.doubleDouble.active:
self.total -= 6.50
print(self.total)
def addCheeseburgerToOrder(self):
if self.root.ids.cheeseburger.active:
self.total += 5
print(self.total)
if not self.root.ids.cheeseburger.active:
self.total -= 5
print(self.total)
def addHamburgerToOrder(self):
if self.root.ids.hamburger.active:
self.total += 5
print(self.total)
if not self.root.ids.hamburger.active:
self.total -= 5
print(self.total)
if __name__ == '__main__':
app = OrderApp()
app.run()
BoxLayout:
orientation: 'vertical'
Label:
text: '[Your meal-ordering GUI here]'
BoxLayout:
orientation: 'horizontal'
Label:
text: 'In-N -Out Burger'
font_size: 30
color: (0.8,0,0,1)
BoxLayout:
orientation: 'horizontal'
CheckBox:
id: doubleDouble
on_active: app.addDoubleDoubleToOrder()
Label:
text:'Double-Double'
font_size: 24
color: (0.8,0,0,1)
BoxLayout:
orientation:'horizontal'
CheckBox:
id: hamburger
on_active: app.addHamburgerToOrder()
Label:
text:'Hamburger'
font_size: 24
color: (0.8,0,0,1)
BoxLayout:
orientation: 'horizontal'
CheckBox:
id: cheeseburger
on_active: app.addCheeseburgerToOrder()
Label:
text:'Cheeseburger'
font_size: 24
color: (0.8,0,0,1)
BoxLayout:
orientation: 'horizontal'
Label:
text:'Total: $' + str(app.total)
font_size: 24
color: (0.8,0,0,1)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment