|
|
@ -69,22 +69,26 @@ function MessageBox:onInput(keys)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function showMessage(title, text, tcolor, on_close)
|
|
|
|
function showMessage(title, text, tcolor, on_close)
|
|
|
|
MessageBox{
|
|
|
|
local mb = MessageBox{
|
|
|
|
frame_title = title,
|
|
|
|
frame_title = title,
|
|
|
|
text = text,
|
|
|
|
text = text,
|
|
|
|
text_pen = tcolor,
|
|
|
|
text_pen = tcolor,
|
|
|
|
on_close = on_close
|
|
|
|
on_close = on_close
|
|
|
|
}:show()
|
|
|
|
}
|
|
|
|
|
|
|
|
mb:show()
|
|
|
|
|
|
|
|
return mb
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function showYesNoPrompt(title, text, tcolor, on_accept, on_cancel)
|
|
|
|
function showYesNoPrompt(title, text, tcolor, on_accept, on_cancel)
|
|
|
|
MessageBox{
|
|
|
|
local mb = MessageBox{
|
|
|
|
frame_title = title,
|
|
|
|
frame_title = title,
|
|
|
|
text = text,
|
|
|
|
text = text,
|
|
|
|
text_pen = tcolor,
|
|
|
|
text_pen = tcolor,
|
|
|
|
on_accept = on_accept,
|
|
|
|
on_accept = on_accept,
|
|
|
|
on_cancel = on_cancel,
|
|
|
|
on_cancel = on_cancel,
|
|
|
|
}:show()
|
|
|
|
}
|
|
|
|
|
|
|
|
mb:show()
|
|
|
|
|
|
|
|
return mb
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
InputBox = defclass(InputBox, MessageBox)
|
|
|
|
InputBox = defclass(InputBox, MessageBox)
|
|
|
@ -133,7 +137,7 @@ function InputBox:onInput(keys)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function showInputPrompt(title, text, tcolor, input, on_input, on_cancel, min_width)
|
|
|
|
function showInputPrompt(title, text, tcolor, input, on_input, on_cancel, min_width)
|
|
|
|
InputBox{
|
|
|
|
local ib = InputBox{
|
|
|
|
frame_title = title,
|
|
|
|
frame_title = title,
|
|
|
|
text = text,
|
|
|
|
text = text,
|
|
|
|
text_pen = tcolor,
|
|
|
|
text_pen = tcolor,
|
|
|
@ -141,7 +145,9 @@ function showInputPrompt(title, text, tcolor, input, on_input, on_cancel, min_wi
|
|
|
|
on_input = on_input,
|
|
|
|
on_input = on_input,
|
|
|
|
on_cancel = on_cancel,
|
|
|
|
on_cancel = on_cancel,
|
|
|
|
frame_width = min_width,
|
|
|
|
frame_width = min_width,
|
|
|
|
}:show()
|
|
|
|
}
|
|
|
|
|
|
|
|
ib:show()
|
|
|
|
|
|
|
|
return ib
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
ListBox = defclass(ListBox, MessageBox)
|
|
|
|
ListBox = defclass(ListBox, MessageBox)
|
|
|
@ -201,7 +207,7 @@ function ListBox:init(info)
|
|
|
|
on_submit2 = on_submit2,
|
|
|
|
on_submit2 = on_submit2,
|
|
|
|
frame = { l = 0, r = 0},
|
|
|
|
frame = { l = 0, r = 0},
|
|
|
|
frame_inset = self.list_frame_inset,
|
|
|
|
frame_inset = self.list_frame_inset,
|
|
|
|
row_height = info.row_height,
|
|
|
|
row_height = self.row_height,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -232,7 +238,7 @@ function ListBox:onInput(keys)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function showListPrompt(title, text, tcolor, choices, on_select, on_cancel, min_width, filter)
|
|
|
|
function showListPrompt(title, text, tcolor, choices, on_select, on_cancel, min_width, filter)
|
|
|
|
ListBox{
|
|
|
|
local lb = ListBox{
|
|
|
|
frame_title = title,
|
|
|
|
frame_title = title,
|
|
|
|
text = text,
|
|
|
|
text = text,
|
|
|
|
text_pen = tcolor,
|
|
|
|
text_pen = tcolor,
|
|
|
@ -241,7 +247,9 @@ function showListPrompt(title, text, tcolor, choices, on_select, on_cancel, min_
|
|
|
|
on_cancel = on_cancel,
|
|
|
|
on_cancel = on_cancel,
|
|
|
|
frame_width = min_width,
|
|
|
|
frame_width = min_width,
|
|
|
|
with_filter = filter,
|
|
|
|
with_filter = filter,
|
|
|
|
}:show()
|
|
|
|
}
|
|
|
|
|
|
|
|
lb:show()
|
|
|
|
|
|
|
|
return lb
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return _ENV
|
|
|
|
return _ENV
|
|
|
|