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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joshua Jacob Martin
meal-ordering-app
Commits
e1748b8c
Commit
e1748b8c
authored
8 years ago
by
joshmartin0212@gmail.com
Browse files
Options
Downloads
Patches
Plain Diff
Added code for an interactive meal ordering app.
parent
1f0ddda5
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.py
+22
-0
22 additions, 0 deletions
main.py
order.kv
+30
-1
30 additions, 1 deletion
order.kv
with
52 additions
and
1 deletion
main.py
+
22
−
0
View file @
e1748b8c
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
NumericProperty
from
kivy.uix
import
button
__app_package__
=
'
edu.unl.cse.soft161.order
'
__app_package__
=
'
edu.unl.cse.soft161.order
'
__app__
=
'
Order Meal
'
__app__
=
'
Order Meal
'
...
@@ -9,9 +12,28 @@ __flags__ = ['--bootstrap=sdl2', '--requirements=python2,kivy', '--orientation=l
...
@@ -9,9 +12,28 @@ __flags__ = ['--bootstrap=sdl2', '--requirements=python2,kivy', '--orientation=l
class
OrderApp
(
App
):
class
OrderApp
(
App
):
charge_total
=
NumericProperty
(
0.00
)
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_bite_charge
(
self
):
app
.
charge_total
+=
1.5
def
update_mega_charge
(
self
):
app
.
charge_total
+=
3
def
update_giga_charge
(
self
):
app
.
charge_total
+=
8.75
def
update_tera_charge
(
self
):
app
.
charge_total
+=
25
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
app
=
OrderApp
()
app
=
OrderApp
()
...
...
This diff is collapsed.
Click to expand it.
order.kv
+
30
−
1
View file @
e1748b8c
BoxLayout:
BoxLayout:
orientation: 'vertical'
orientation: 'vertical'
Label:
Label:
text: '[Your meal-ordering GUI here]'
text: 'Bits and Bites'
font_size: 45
bold: True
Label:
text: 'By: Josh Martin'
font_size: 20
Label:
text: 'Subtotal: $'+ str(app.charge_total)
Button:
text: 'Restart Order'
on_press: app.charge_total=0.0
Button:
id: bite
text: 'Add to order: One Bite - $1.50'
on_press: app.update_bite_charge()
Button:
id: mega
text: 'Add to order: One Megabite - $3.00'
on_press: app.update_mega_charge()
Button:
id: giga
text: 'Add to order: One Gigabite - $8.75'
on_press: app.update_giga_charge()
Button:
id: tera
text: 'Add to order: One Terabite - $25.00'
on_press: app.update_tera_charge()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment