Commit 4dd48502 authored by Mark Tearle's avatar Mark Tearle

Add initial widgets for buttons

parent 8caba669
...@@ -11,10 +11,13 @@ RESET ...@@ -11,10 +11,13 @@ RESET
0 0
9 9
2 2
0.05 0.05
0.10 0.10
0.25 0.25
$1 $1
MODE MODE
DIP1 DIP1
DIP2 DIP2
...@@ -24,4 +27,5 @@ DIP5 ...@@ -24,4 +27,5 @@ DIP5
DIP6 DIP6
DIP7 DIP7
DIP8 DIP8
DOOR DOOR
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
import npyscreen import npyscreen
from datetime import datetime from datetime import datetime
class ContainedMultiSelect(npyscreen.BoxTitle):
_contained_widget = npyscreen.TitleMultiSelect
class VirtualSnack(npyscreen.Form): class VirtualSnack(npyscreen.Form):
def while_waiting(self): def while_waiting(self):
...@@ -22,6 +25,21 @@ class VirtualSnack(npyscreen.Form): ...@@ -22,6 +25,21 @@ class VirtualSnack(npyscreen.Form):
self.date_widget.value = "Hello" self.date_widget.value = "Hello"
self.add_handlers({"^T": self.exit_application}) self.add_handlers({"^T": self.exit_application})
self.dip = self.add(npyscreen.MultiSelect, name = "DIP Switch", max_width = 45, relx = 2, max_height=10, value = [], values = ["DIP1", "DIP2", "DIP3","DIP4","DIP5","DIP6","DIP7","DIP8"], scroll_exit=True)
self.dip = self.add(npyscreen.MultiSelect, name = "Door", max_width=15, relx = 2, max_height=4, value = [], values = ["DOOR"], scroll_exit=True)
self.nickel= self.add(npyscreen.MiniButton,name="0.05")
self.dime= self.add(npyscreen.MiniButton,name="0.10")
self.quarter= self.add(npyscreen.MiniButton,name="0.25")
self.dollar= self.add(npyscreen.MiniButton,name="1.00")
self.mode= self.add(npyscreen.MiniButton,name="MODE")
self.reset= self.add(npyscreen.MiniButton,name="RESET")
self.kpbuttons = []
for keypad in range(0,10):
self.kpbuttons.append(self.add(npyscreen.MiniButton,name="%d"%keypad))
def exit_application(self,name): def exit_application(self,name):
self.parentApp.setNextForm(None) self.parentApp.setNextForm(None)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment