Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
meal_ordering_app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Brady James Garvin
meal_ordering_app
Merge requests
!1
Testing branch
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Closed
Testing branch
kameronh7/meal-ordering-app:testing_branch
into
master
Overview
1
Commits
3
Changes
2
Closed
Testing branch
Kameron James Heyen
requested to merge
kameronh7/meal-ordering-app:testing_branch
into
master
Jul 14, 2017
Overview
1
Commits
3
Changes
2
Merge to main branch
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
2498d1e2
3 commits,
Jul 14, 2017
2 files
+
69
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
main.py
+
29
−
1
View file @ 2498d1e2
Edit in single-file editor
Open in Web IDE
Show full file
from kivy.app import App
from kivy.modules import inspector # For inspection.
from kivy.core.window import Window # For inspection.
from kivy.uix.behaviors import ToggleButtonBehavior
__app_package__ = 'edu.unl.cse.soft161.order'
__app__ = 'Order Meal'
@@ -8,11 +9,38 @@ __version__ = '0.1'
__flags__ = ['--bootstrap=sdl2', '--requirements=python2,kivy', '--orientation=landscape']
class
OrderApp
(
App
):
class OrderApp(App, ToggleButtonBehavior):
order_total = 0.00
combo_order = False
def build(self):
inspector.create_inspector(Window, self) # For inspection (press control-e to toggle).
def entree_button(self, widget, state):
if widget == 'five_piece' and state == 'down':
self.order_total = 5.0
elif widget == 'sandwich' and state == 'down':
self.order_total = 5.0
elif widget == 'four_piece' and state == 'down':
self.order_total = 4.0
elif state == 'normal':
self.order_total = 0.0
if self.combo_order and state != 'normal':
self.order_total += 3.0
def combo_button(self, state):
if state == 'down':
if self.order_total == 0.0:
self.combo_order = True
else:
self.order_total += 3.0
self.combo_order = True
if state == 'normal' and self.combo_order:
self.order_total -= 3.0
self.combo_order = False
def update_total(self):
self.root.ids.total.text = 'Total: $%.2f' % self.order_total
if __name__ == '__main__':
app = OrderApp()
app.run()
Loading