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
Jacob Ryan Petersen
meal-ordering-app
Commits
f93d5476
Commit
f93d5476
authored
8 years ago
by
Jacob Ryan Petersen
Browse files
Options
Downloads
Patches
Plain Diff
Updated meal order app
parent
1f0ddda5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.py
+16
-0
16 additions, 0 deletions
main.py
order.kv
+82
-1
82 additions, 1 deletion
order.kv
with
98 additions
and
1 deletion
main.py
+
16
−
0
View file @
f93d5476
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
'
...
@@ -12,6 +13,21 @@ class OrderApp(App):
...
@@ -12,6 +13,21 @@ class OrderApp(App):
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).
price
=
NumericProperty
(
11.00
)
cheese_price
=
NumericProperty
(
0.00
)
def
meat_topping
(
self
):
self
.
price
+=
1.75
def
topping
(
self
):
self
.
price
+=
1.25
def
update_cheese
(
self
):
if
self
.
root
.
ids
.
cheese_slider
.
value
>
50
:
self
.
cheese_price
=
1.50
else
:
self
.
cheese_price
=
0.00
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
app
=
OrderApp
()
app
=
OrderApp
()
...
...
This diff is collapsed.
Click to expand it.
order.kv
+
82
−
1
View file @
f93d5476
BoxLayout:
BoxLayout:
orientation: 'vertical'
orientation: 'vertical'
Label:
Label:
text: '[Your meal-ordering GUI here]'
text: 'Online Pizza Order'
size_hint: (1, 0.25)
color: (1, 0, 0, 1)
font_size: '32sp'
BoxLayout:
orientation: 'vertical'
Label:
text: 'Cheese'
BoxLayout:
orientation: 'horizontal'
Label:
text: 'Less'
Slider:
range: (0, 100)
value: 50
id: cheese_slider
on_value_pos: app.update_cheese()
Label:
text: 'More'
Label:
id: cheese_label
text: str(int(cheese_slider.value)) + '%'
BoxLayout:
orientation: 'vertical'
size_hint: (1, 0.3)
Label:
text: 'Sauce'
font_size: '24sp'
BoxLayout:
orientation: 'vertical'
BoxLayout:
orientation: 'horizontal'
CheckBox:
group: 'sauce'
Label:
text: 'Marinara'
BoxLayout:
orientation: 'horizontal'
CheckBox:
group: 'sauce'
Label:
text: 'Barbecue'
BoxLayout:
orientation: 'vertical'
Label:
text: 'Toppings'
font_size: '24sp'
BoxLayout:
orientation: 'horizontal'
Button:
on_press: app.meat_topping()
text: 'Pepperoni'
BoxLayout:
orientation: 'horizontal'
Button:
on_press: app.topping()
text: 'Pineapple'
BoxLayout:
orientation: 'horizontal'
Button:
on_press: app.topping()
text: 'Mushrooms'
BoxLayout:
orientation: 'horizontal'
Button:
on_press: app.topping()
text: 'Olives'
BoxLayout:
orientation: 'horizontal'
Button:
on_press: app.meat_topping()
text: 'Bacon'
BoxLayout:
orientation: 'horizontal'
size_hint: (1, 0.25)
BoxLayout:
Label:
text: '$' + str(app.price + app.cheese_price)
Button:
text: 'Order Now'
font_size: '18sp'
color: (0.25, 0.5, 1, 1)
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