18 lines
461 B
Lua
18 lines
461 B
Lua
|
UIWindow = extends(UIWidget)
|
||
|
|
||
|
function UIWindow.create()
|
||
|
local window = UIWindow.internalCreate()
|
||
|
window:setTextAlign(AlignTopCenter)
|
||
|
return window
|
||
|
end
|
||
|
|
||
|
function UIWindow:onKeyPress(keyCode, keyText, keyboardModifiers)
|
||
|
if keyboardModifiers == KeyboardNoModifier then
|
||
|
if keyCode == KeyReturn or keyCode == KeyEnter then
|
||
|
signalcall(self.onEnter, self)
|
||
|
elseif keyCode == KeyEscape then
|
||
|
signalcall(self.onEscape, self)
|
||
|
end
|
||
|
end
|
||
|
end
|