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
Adrian Reza Ariffin
meal-ordering-app
Commits
6d6149f8
Commit
6d6149f8
authored
8 years ago
by
Adrian Reza Ariffin
Browse files
Options
Downloads
Patches
Plain Diff
Program completed
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
-1
22 additions, 1 deletion
main.py
order.kv
+54
-1
54 additions, 1 deletion
order.kv
with
76 additions
and
2 deletions
main.py
+
22
−
1
View file @
6d6149f8
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
'
__version__
=
'
0.1
'
__version__
=
'
0.1
'
...
@@ -12,6 +12,27 @@ class OrderApp(App):
...
@@ -12,6 +12,27 @@ 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).
money
=
NumericProperty
(
10
)
total_price
=
NumericProperty
(
0
)
chicken_price
=
4
ham_price
=
4
def
chicken_buy
(
self
):
self
.
total_price
+=
4
def
beef_buy
(
self
):
self
.
total_price
+=
4
def
ham_buy
(
self
):
self
.
total_price
+=
4
def
checkout
(
self
):
self
.
money
=
self
.
money
-
self
.
total_price
self
.
total_price
=
0
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
app
=
OrderApp
()
app
=
OrderApp
()
...
...
This diff is collapsed.
Click to expand it.
order.kv
+
54
−
1
View file @
6d6149f8
BoxLayout:
BoxLayout:
orientation: 'vertical'
orientation: 'vertical'
Label:
Label:
text: '[Your meal-ordering GUI here]'
text: 'UNL Sandwich Shop'
BoxLayout:
Label:
size_hint: (1, 0.25)
text: 'Chicken'
Button:
id: chicken_purchase_button
size_hint: (1, 0.25)
text: 'Purchase'
on_press: app.chicken_buy()
BoxLayout:
Label:
size_hint: (1, 0.25)
text: 'Beef'
Button:
id: beef_purchase_button
size_hint: (1, 0.25)
text: 'Purchase'
on_press: app.beef_buy()
BoxLayout:
Label:
size_hint: (1, 0.25)
text: 'Ham'
Button:
id: ham_purchase_button
size_hint: (1, 0.25)
text: 'Purchase'
on_press: app.ham_buy()
BoxLayout:
Label:
font_size:'24sp'
text: 'Money'
Label:
text: '$'+str(app.money)
BoxLayout:
Label:
font_size:'24sp'
text: 'Total Price'
Label:
text: '$'+str(app.total_price)
BoxLayout:
Button:
text: 'Checkout'
on_press: app.checkout()
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