Rename present_* to focus_*.

This commit is contained in:
Nolan Darilek 2018-07-03 17:01:00 +00:00
parent 8e06663529
commit 2c5babe103

View File

@ -8,7 +8,7 @@ func item_or_items(count):
else: else:
return "items" return "items"
func present_button(): func focus_button():
var text = "Unlabelled" var text = "Unlabelled"
if node.text: if node.text:
text = node.text text = node.text
@ -16,6 +16,22 @@ func present_button():
var list_pos = 0 var list_pos = 0
func focus_item_list():
var count = node.get_item_count()
var selected = node.get_selected_items()
print("list, %s %s" % [count, item_or_items(count)])
print(selected)
func handle_item_list_item_selected(index):
print("Selected")
func handle_item_list_multi_selected(index, selected):
print("Multiselect")
func handle_item_list_nothing_selected():
print("Nothing selected")
func input_item_list(event): func input_item_list(event):
var old_list_pos = list_pos var old_list_pos = list_pos
if event.echo or not event.pressed: if event.echo or not event.pressed:
@ -36,26 +52,10 @@ func input_item_list(event):
var text = node.get_item_text(list_pos) var text = node.get_item_text(list_pos)
print("%s: %s of %s" % [text, list_pos+1, node.get_item_count()]) print("%s: %s of %s" % [text, list_pos+1, node.get_item_count()])
func handle_item_list_item_selected(index):
print("Selected")
func handle_item_list_multi_selected(index, selected):
print("Multiselect")
func handle_item_list_nothing_selected():
print("Nothing selected")
func present_item_list():
var count = node.get_item_count()
var selected = node.get_selected_items()
print("list, %s %s" % [count, item_or_items(count)])
print(selected)
func unfocus_item_list(): func unfocus_item_list():
list_pos = 0 list_pos = 0
func present_line_edit(): func focus_line_edit():
var text = "blank" var text = "blank"
if node.secret: if node.secret:
text = "password" text = "password"
@ -86,20 +86,20 @@ func check_caret_moved():
print(text[pos]) print(text[pos])
old_pos = pos old_pos = pos
func present_tree(): func focus_tree():
var root = node.get_root() var root = node.get_root()
var count = 0 var count = 0
print("tree: %s %s" % [count, item_or_items(count)]) print("tree: %s %s" % [count, item_or_items(count)])
func focused(): func focused():
if node is Button: if node is Button:
present_button() focus_button()
elif node is ItemList: elif node is ItemList:
present_item_list() focus_item_list()
elif node is LineEdit: elif node is LineEdit:
present_line_edit() focus_line_edit()
elif node is Tree: elif node is Tree:
present_tree() focus_tree()
else: else:
print("Focus entered.", node) print("Focus entered.", node)