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
Nathan Robert Carlson
meal-ordering-app
Commits
f23cee32
Commit
f23cee32
authored
8 years ago
by
Nathan Robert Carlson
Browse files
Options
Downloads
Patches
Plain Diff
finished app version 1.00
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
+64
-1
64 additions, 1 deletion
main.py
order.kv
+54
-2
54 additions, 2 deletions
order.kv
with
118 additions
and
3 deletions
main.py
+
64
−
1
View file @
f23cee32
from
kivy.app
import
App
from
kivy.modules
import
inspector
# For inspection.
from
kivy.properties
import
BooleanProperty
,
ListProperty
,
NumericProperty
,
StringProperty
from
kivy.core.window
import
Window
# For inspection.
from
kivy.uix.behaviors
import
ToggleButtonBehavior
from
kivy.uix.screenmanager
import
ScreenManager
,
Screen
__app_package__
=
'
edu.unl.cse.soft161.order
'
__app__
=
'
Order Meal
'
__version__
=
'
0.1
'
__flags__
=
[
'
--bootstrap=sdl2
'
,
'
--requirements=python2,kivy
'
,
'
--orientation=landscape
'
]
class
OrderApp
(
App
):
pepperoni
=
BooleanProperty
(
False
)
sausage
=
BooleanProperty
(
False
)
hamburger
=
BooleanProperty
(
False
)
bacon
=
BooleanProperty
(
False
)
onions
=
BooleanProperty
(
False
)
black_olives
=
BooleanProperty
(
False
)
mushrooms
=
BooleanProperty
(
False
)
green_peppers
=
BooleanProperty
(
False
)
printStatement
=
StringProperty
(
""
)
def
pepperoniSwitch
(
self
):
self
.
pepperoni
=
not
self
.
pepperoni
def
sausageSwitch
(
self
):
self
.
sausage
=
not
self
.
sausage
def
hamburgerSwitch
(
self
):
self
.
hamburger
=
not
self
.
hamburger
def
baconSwitch
(
self
):
self
.
bacon
=
not
self
.
bacon
def
onionSwitch
(
self
):
self
.
onions
=
not
self
.
onions
def
oliveSwitch
(
self
):
self
.
black_olives
=
not
self
.
black_olives
def
mushroomSwitch
(
self
):
self
.
mushrooms
=
not
self
.
mushrooms
def
pepperSwitch
(
self
):
self
.
green_peppers
=
not
self
.
green_peppers
def
build
(
self
):
inspector
.
create_inspector
(
Window
,
self
)
# For inspection (press control-e to toggle).
def
clickPepperonis
(
self
):
if
self
.
pepperoni
==
False
:
self
.
pepperoni
=
True
else
:
self
.
pepperoni
=
True
def
printOrder
(
self
):
pepperoni
=
""
sausage
=
""
hamburger
=
""
bacon
=
""
onions
=
""
olives
=
""
mushrooms
=
""
peppers
=
""
if
self
.
pepperoni
==
True
:
pepperoni
=
"
pepperoni
"
if
self
.
sausage
==
True
:
sausage
=
"
sausage
"
if
self
.
hamburger
==
True
:
hamburger
=
"
hamburger
"
if
self
.
bacon
==
True
:
bacon
=
"
bacon
"
if
self
.
onions
==
True
:
onions
=
"
onion
"
if
self
.
black_olives
==
True
:
olives
=
"
olive
"
if
self
.
mushrooms
==
True
:
mushrooms
=
"
mushroom
"
if
self
.
green_peppers
==
True
:
peppers
=
"
green pepper
"
self
.
printStatement
=
"
Your order for a
"
+
pepperoni
+
sausage
+
hamburger
+
bacon
+
onions
+
olives
+
mushrooms
+
peppers
+
"
cheese pizza has been processed.
"
if
__name__
==
'
__main__
'
:
app
=
OrderApp
()
...
...
This diff is collapsed.
Click to expand it.
order.kv
+
54
−
2
View file @
f23cee32
BoxLayout:
orientation: 'vertical'
BoxLayout:
orientation: 'vertical'
Label:
font_size: '85sp'
text: 'Pizza Place'
BoxLayout:
orientation: 'horizontal'
Label:
font_size: '30sp'
color: [100, 0, 0, 1]
text: 'Meats'
ToggleButton:
text: 'Pepperoni'
on_press: app.pepperoniSwitch()
ToggleButton:
text: 'Sausage'
on_press: app.sausageSwitch()
ToggleButton:
text: 'Hamburger'
on_press: app.hamburgerSwitch()
ToggleButton:
text: 'Bacon'
on_press: app.baconSwitch()
BoxLayout:
orientation: 'horizontal'
Label:
font_size: '25sp'
color: [0, 100, 0, 1]
text: 'Vegetables'
ToggleButton:
text: 'Onions'
on_press: app.onionSwitch()
ToggleButton:
text: 'Black olives'
on_press: app.oliveSwitch()
ToggleButton:
text: 'Mushrooms'
on_press: app.mushroomSwitch()
ToggleButton:
text: 'Green peppers'
on_press: app.pepperSwitch()
BoxLayout:
orientation: 'horizontal'
Button:
bold: True
font_size: '40sp'
on_press: app.printOrder()
text: 'Submit order'
BoxLayout:
orientation: 'horizontal'
Label:
text: '[Your meal-ordering GUI here]'
font_size: '14sp'
color: [0, 100, 0, 1]
text: str(app.printStatement)
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