Swapped button A for Menu in some for consistancy

tildatorch
Alistair MacDonald 2018-08-29 09:39:26 +01:00 committed by GitHub
parent 6cd5d3e16b
commit 1d02747ec9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 8 deletions

View File

@ -75,12 +75,9 @@ def prompt_text(description, init_text = "", true_text="OK", false_text="Back",
window = ugfx.Container(0, 0, ugfx.width(), ugfx.height())
if false_text:
true_text = "M: " + true_text
true_text = "A: " + true_text
false_text = "B: " + false_text
if buttons.has_interrupt("BTN_MENU"):
buttons.disable_interrupt("BTN_MENU")
ugfx.set_default_font(FONT_MEDIUM_BOLD)
kb = ugfx.Keyboard(0, ugfx.height()//2, ugfx.width(), ugfx.height()//2, parent=window)
edit = ugfx.Textbox(2, ugfx.height()//2-60, ugfx.width()-7, 25, text = init_text, parent=window)
@ -91,15 +88,12 @@ def prompt_text(description, init_text = "", true_text="OK", false_text="Back",
label = ugfx.Label(ugfx.width()//10, ugfx.height()//10, ugfx.width()*4//5, ugfx.height()*2//5-90, description, parent=window)
try:
#button_yes.attach_input(ugfx.BTN_MENU,0) # todo: re-enable this
#if button_no: button_no.attach_input(ugfx.BTN_B,0)
window.show()
# edit.set_focus() todo: do we need this?
while True:
sleep.wfi()
ugfx.poll()
#if buttons.is_triggered(buttons.Buttons.BTN_A): return edit.text()
if buttons.is_triggered(buttons.Buttons.BTN_A): return edit.text()
if buttons.is_triggered(buttons.Buttons.BTN_B): return None
if buttons.is_triggered(buttons.Buttons.BTN_Menu): return edit.text()