from kivy.app import App
from kivy.modules import inspector # For inspection.
from kivy.core.window import Window # For inspection.
from kivy.properties import BooleanProperty, NumericProperty


__app_package__ = 'edu.unl.cse.soft161.order'
__app__ = 'Order Meal'
__version__ = '0.1'
__flags__ = ['--bootstrap=sdl2', '--requirements=python2,kivy', '--orientation=landscape']


class OrderApp(App):
    total = NumericProperty(0.00)
    price_2_strips = NumericProperty(4.99)
    price_3_strips = NumericProperty(6.50)
    price_4_strips = NumericProperty(7.99)
    price_6_strips = NumericProperty(10.99)
    price_sandwitch = NumericProperty(7.99)
    price_25_strips = NumericProperty(19.99)
    price_50_strips = NumericProperty(38.99)
    price_75_strips = NumericProperty(56.99)
    price_100_strips = NumericProperty(69.99)
    price_jug_of_lemonade = NumericProperty(2.99)
    price_jug_of_icedtea = NumericProperty(2.99)
    price_extra_sauce = NumericProperty(.99)
    price_extra_drink = NumericProperty(2.39)
    price_extra_fries = NumericProperty(2.99)

    toast_no_slaw_disabled = BooleanProperty(False)
    slaw_no_toast_disabled = BooleanProperty(False)
    msg = 'Place Order \n Total: $'

    def build(self):
        inspector.create_inspector(Window, self) # For inspection (press control-e to toggle).

    def two_strips(self):
        self.total += self.price_2_strips

    def three_strips(self):
        self.total += self.price_3_strips

    def four_strips(self):
        self.total += self.price_4_strips

    def six_strips(self):
        self.total += self.price_6_strips

    def sandwitch(self):
        self.total += self.price_sandwitch

    def twenty5_strips(self):
        self.total += self.price_25_strips

    def fifty_strips(self):
        self.total += self.price_50_strips

    def seventy5_strips(self):
        self.total += self.price_75_strips

    def hundred_strips(self):
        self.total += self.price_100_strips

    def lemonade(self):
        self.total += self.price_jug_of_lemonade

    def icedtea(self):
        self.total += self.price_jug_of_icedtea

    def sauce(self):
        self.total += self.price_extra_sauce

    def drink(self):
        self.total += self.price_extra_drink

    def fries(self):
        self.total += self.price_extra_fries

    def extra_toast(self):
        self.slaw_no_toast_disabled = BooleanProperty(True)

    def extra_slaw(self):
        self.toast_no_slaw_disabled = BooleanProperty(True)

    def reset(self):
        self.total = 0.00
        self.toast_no_slaw_disabled = False
        self.slaw_no_toast_disabled = False

    def placed_order(self):
        pass  #would actually place an order if this were a real thing

if __name__ == '__main__':
    app = OrderApp()
    app.run()