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
Carsten James Scholle
meal-ordering-app
Commits
5bfc4404
Commit
5bfc4404
authored
8 years ago
by
Carsten James Scholle
Browse files
Options
Downloads
Patches
Plain Diff
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
+122
-1
122 additions, 1 deletion
order.kv
with
138 additions
and
1 deletion
main.py
+
16
−
0
View file @
5bfc4404
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
__app_package__
=
'
edu.unl.cse.soft161.order
'
__app_package__
=
'
edu.unl.cse.soft161.order
'
__app__
=
'
Order Meal
'
__app__
=
'
Order Meal
'
...
@@ -8,10 +10,24 @@ __version__ = '0.1'
...
@@ -8,10 +10,24 @@ __version__ = '0.1'
__flags__
=
[
'
--bootstrap=sdl2
'
,
'
--requirements=python2,kivy
'
,
'
--orientation=landscape
'
]
__flags__
=
[
'
--bootstrap=sdl2
'
,
'
--requirements=python2,kivy
'
,
'
--orientation=landscape
'
]
class
OrderApp
(
App
):
class
OrderApp
(
App
):
price
=
NumericProperty
(
0
)
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
pizza_size
(
self
):
if
self
.
roots
.
ids
.
small
.
state
==
'
down
'
:
self
.
price
=
9
if
self
.
roots
.
ids
.
medium
.
state
==
'
down
'
:
self
.
price
=
11
if
self
.
roots
.
ids
.
large
.
state
==
'
down
'
:
self
.
price
=
13
if
self
.
roots
.
ids
.
extra_large
.
state
==
'
down
'
:
self
.
price
=
15
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
app
=
OrderApp
()
app
=
OrderApp
()
...
...
This diff is collapsed.
Click to expand it.
order.kv
+
122
−
1
View file @
5bfc4404
BoxLayout:
BoxLayout:
orientation: 'vertical'
orientation: 'vertical'
Label:
Label:
text: '[Your meal-ordering GUI here]'
text: 'Papa Johns'
BoxLayout:
orientation: 'horizontal'
Label:
text: 'Choose your size'
font_size: '18sp'
ToggleButton:
id: 'small'
text: 'small'
size_hint: (.25,.5)
group: 'size'
font_size: '18sp'
ToggleButton:
id: 'medium'
text: 'medium'
size_hint: (.25,.5)
group: 'size'
font_size: '18sp'
ToggleButton:
id: 'large'
text: 'large'
size_hint: (.25,.5)
group: 'size'
font_size: '18sp'
ToggleButton:
id: 'extra_large'
text: 'extra large'
size_hint: (.25,.5)
group: 'size'
font_size: '18sp'
BoxLayout:
orientation: 'horizontal'
Label:
text: 'Choose your crust'
font_size: '20sp'
ToggleButton:
text: 'thin'
size_hint: (.33,.5)
group: 'crust'
font_size: '20sp'
ToggleButton:
text: 'regular'
size_hint: (.33,.5)
group: 'crust'
font_size: '20sp'
ToggleButton:
text: 'thick'
size_hint: (.33,.5)
group: 'crust'
font_size: '20sp'
BoxLayout:
orientation: 'horizontal'
Label:
text: 'How much sauce?'
font_size: '20sp'
ToggleButton:
text: 'normal'
size_hint: (.25,.5)
group: 'sauce'
font_size: '20sp'
ToggleButton:
text: 'light'
size_hint: (.25,.5)
group: 'sauce'
font_size: '20sp'
ToggleButton:
text: 'extra'
size_hint: (.25,.5)
group: 'sauce'
font_size: '20sp'
ToggleButton:
text: 'no sauce'
size_hint: (.25,.5)
group: 'sauce'
font_size: '20sp'
BoxLayout:
orientation: 'horizontal'
Label:
text: 'How much cheese?'
font_size: '20sp'
ToggleButton:
text: 'normal'
size_hint: (.33,.5)
group: 'cheese'
font_size: '20sp'
ToggleButton:
text: 'light'
size_hint: (.33,.5)
group: 'cheese'
font_size: '20sp'
ToggleButton:
text: 'no cheese'
size_hint: (.33,.5)
group: 'cheese'
font_size: '20sp'
BoxLayout:
orientation: 'horizontal'
Label:
text: 'Choose your toppings'
font_size: '20sp'
ToggleButton:
text: 'sausage'
size_hint: (.33,.5)
font_size: '20sp'
group: 'toppings'
ToggleButton:
text: 'pepperoni'
size_hint: (.33,.5)
font_size: '20sp'
group: 'toppings'
ToggleButton:
text: 'veggies'
size_hint: (.33,.5)
font_size: '20sp'
group: 'toppings'
Label:
text: 'Total:'
font_size: '20sp'
Label:
id: 'total'
text: '$' + str(app.price())
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