diff --git a/main.py b/main.py index da72251b42c107f3a6068a25195221c752d0d2cc..c2549f0b8fdbf9ddada291a5b4bf9465aad6a010 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,7 @@ 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' @@ -9,6 +10,51 @@ __flags__ = ['--bootstrap=sdl2', '--requirements=python2,kivy', '--orientation=l class OrderApp(App): + + subtotal = NumericProperty(0.00) + tax = NumericProperty(0.00) + total = NumericProperty(0.00) + def buttonOne(self): + self.subtotal += 5.99 + self.tax += (self.subtotal * .07) + self.total = (self.subtotal + self.tax) + def buttonTwo(self): + self.subtotal += 7.99 + self.tax += (self.subtotal * .07) + self.total = (self.subtotal + self.tax) + def buttonThree(self): + self.subtotal += 8.99 + self.tax += (self.subtotal * .07) + self.total = (self.subtotal + self.tax) + def buttonFour(self): + self.subtotal += 6.99 + self.tax += (self.subtotal * .07) + self.total = (self.subtotal + self.tax) + def buttonFive(self): + self.subtotal += 6.99 + self.tax += (self.subtotal * .07) + self.total = (self.subtotal + self.tax) + def buttonSix(self): + self.subtotal += 2.99 + self.tax += (self.subtotal * .07) + self.total = (self.subtotal + self.tax) + def buttonSeven(self): + self.subtotal += 1.99 + self.tax += (self.subtotal * .07) + self.total = (self.subtotal + self.tax) + def buttonEight(self): + self.subtotal += 2.99 + self.tax += (self.subtotal * .07) + self.total = (self.subtotal + self.tax) + def buttonNine(self): + self.subtotal += 1.99 + self.tax += (self.subtotal * .07) + self.total = (self.subtotal + self.tax) + def buttonTen(self): + self.subtotal += 0.99 + self.tax += (self.subtotal * .07) + self.total = (self.subtotal + self.tax) + def build(self): inspector.create_inspector(Window, self) # For inspection (press control-e to toggle). diff --git a/order.kv b/order.kv index d23f9746383fbed94ff3e43c6245d396bfd765a5..cf894058aea69c704bcdf8b8d2f0db2341ec8e9f 100644 --- a/order.kv +++ b/order.kv @@ -1,4 +1,97 @@ BoxLayout: orientation: 'vertical' Label: - text: '[Your meal-ordering GUI here]' + text: 'welcome to restaurant' + size_hint: 1,0.20 + BoxLayout: + orientation: 'horizontal' + BoxLayout: + orientation: 'vertical' + Label: + text: '1' + Label: + text: 'Order Chicken Tenders ' + Button: + on_press: app.buttonOne() + BoxLayout: + orientation: 'vertical' + Label: + text: '2' + Label: + text: 'Order Hamburger' + Button: + on_press:app.buttonTwo() + BoxLayout: + orientation: 'vertical' + Label: + text: '3' + Label: + text: 'Order Cheeseburger' + Button: + on_press:app.buttonThree() + BoxLayout: + orientation: 'vertical' + Label: + text: '4' + Label: + text: 'Order Chicken Sandwich' + Button: + on_press:app.buttonFour() + BoxLayout: + orientation: 'vertical' + Label: + text: '5' + Label: + text: 'Order Fish Sandwich' + Button: + on_press:app.buttonFive() + BoxLayout: + BoxLayout: + orientation: 'vertical' + Label: + text: '6' + Label: + text: 'Order French Fries' + Button: + on_press:app.buttonSix() + BoxLayout: + orientation: 'vertical' + Label: + text: '7' + Label: + text: 'Order Small Pop' + Button: + on_press:app.buttonSeven() + BoxLayout: + orientation: 'vertical' + Label: + text: '8' + Label: + text: 'Order Large Pop' + Button: + on_press:app.buttonEight() + BoxLayout: + orientation: 'vertical' + Label: + text: '9' + Label: + text: 'Order Ice Cream' + Button: + on_press:app.buttonNine() + BoxLayout: + orientation: 'vertical' + Label: + text: '10' + Label: + text: 'Order Pie' + Button: + on_press:app.buttonTen() + BoxLayout: + size_hint: 1,0.20 + orientation: 'horizontal' + Label: + text: 'Subtotal: ' + str(app.subtotal) + Label: + text: 'Tax: ' + str(app.tax) + Label: + text: 'Total: ' + str(app.total)