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
Benjamin Lee Jahnke
meal-ordering-app
Commits
e6f7038d
Commit
e6f7038d
authored
8 years ago
by
Benjamin Lee Jahnke
Browse files
Options
Downloads
Patches
Plain Diff
Finished Ice Cream Ordering App.
parent
1f0ddda5
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.py
+32
-1
32 additions, 1 deletion
main.py
order.kv
+61
-2
61 additions, 2 deletions
order.kv
with
93 additions
and
3 deletions
main.py
+
32
−
1
View file @
e6f7038d
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
BooleanProperty
,
NumericProperty
__app_package__
=
'
edu.unl.cse.soft161.order
'
__app_package__
=
'
edu.unl.cse.soft161.order
'
__app__
=
'
Order Meal
'
__app__
=
'
Order Meal
'
...
@@ -9,9 +10,39 @@ __flags__ = ['--bootstrap=sdl2', '--requirements=python2,kivy', '--orientation=l
...
@@ -9,9 +10,39 @@ __flags__ = ['--bootstrap=sdl2', '--requirements=python2,kivy', '--orientation=l
class
OrderApp
(
App
):
class
OrderApp
(
App
):
vanilla
=
NumericProperty
(
0.50
)
cherry
=
NumericProperty
(
1.50
)
chocolate
=
NumericProperty
(
1.00
)
strawberry
=
NumericProperty
(
1.00
)
oreo
=
NumericProperty
(
1.50
)
cookie_dough
=
NumericProperty
(
1.50
)
rocky_road
=
NumericProperty
(
1.50
)
marshmallow
=
NumericProperty
(
1.50
)
mint_chip
=
NumericProperty
(
1.50
)
subtotal
=
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
addvanilla
(
self
):
self
.
subtotal
+=
self
.
vanilla
def
addcherry
(
self
):
self
.
subtotal
+=
self
.
cherry
def
addchocolate
(
self
):
self
.
subtotal
+=
self
.
chocolate
def
addstrawberry
(
self
):
self
.
subtotal
+=
self
.
strawberry
def
addoreo
(
self
):
self
.
subtotal
+=
self
.
oreo
def
addcookie_dough
(
self
):
self
.
subtotal
+=
self
.
cookie_dough
def
addmarshmallow
(
self
):
self
.
subtotal
+=
self
.
marshmallow
def
addrocky_road
(
self
):
self
.
subtotal
+=
self
.
rocky_road
def
addmint_chip
(
self
):
self
.
subtotal
+=
self
.
mint_chip
def
new_order
(
self
):
self
.
subtotal
=
0
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
app
=
OrderApp
()
app
=
OrderApp
()
...
...
This diff is collapsed.
Click to expand it.
order.kv
+
61
−
2
View file @
e6f7038d
BoxLayout:
BoxLayout:
orientation: 'vertical'
orientation: 'vertical'
BoxLayout:
orientation: 'horizontal'
BoxLayout:
orientation: 'vertical'
Label:
text: "Welcome to Benny's Ice Cream"
font_size: '50sp'
Label:
text: 'Order Personalized Scooped Cones Here'
font_size: '25sp'
BoxLayout:
orientation: 'horizontal'
BoxLayout:
orientation: 'vertical'
Button:
text: 'one scoop of vanilla'
on_press: app.addvanilla()
Button:
text: 'one scoop of cherry'
on_press: app.addcherry()
Button:
text: 'one scoop of chocolate'
on_press: app.addchocolate()
BoxLayout:
orientation: 'vertical'
Button:
text: 'one scoop of strawberry'
on_press: app.addstrawberry()
Button:
text: 'one scoop of cookie dough'
on_press: app.addcookie_dough()
Button:
text: 'one scoop of oreo'
on_press: app.addoreo()
BoxLayout:
orientation: 'vertical'
Button:
text: 'one scoop of marshmallow'
on_press: app.addmarshmallow()
Button:
text: 'one scoop of rocky road'
on_press: app.addrocky_road()
Button:
text: 'one scoop of mint chip'
on_press: app.addmint_chip()
BoxLayout:
orientation: 'horizontal'
Label:
Label:
text: '[Your meal-ordering GUI here]'
id: subtotal
font_size: '40sp'
text: 'Subtotal is: $' + format((app.subtotal), '.2f')
BoxLayout:
orientation: 'horizontal'
Button:
id: new_order
size_hint: (.25, 1)
font_size: '20sp'
text: 'New Order'
on_press: app.new_order()
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