enable enter/escape actions for windows

This commit is contained in:
Eduardo Bart
2011-08-28 23:03:31 -03:00
parent d3cd4feee5
commit f54fd34cb3
8 changed files with 33 additions and 13 deletions

View File

@@ -33,6 +33,8 @@ function MessageBox.create(title, text, flags)
box.onOk()
box:destroy()
end
window.onEnter = buttonRight.onClick
window.onEscape = buttonRight.onClick
elseif flags == MessageBoxCancel then
buttonRight:setText("Cancel")
box.onCancel = EmptyFunction
@@ -40,6 +42,8 @@ function MessageBox.create(title, text, flags)
box.onCancel()
box:destroy()
end
window.onEnter = buttonRight.onClick
window.onEscape = buttonRight.onClick
end
box.window = window

View File

@@ -16,6 +16,8 @@ MainWindow
id: charactersWindow
title: Charlist
size: 250 250
onEnter: EnterGame_characterWindow_okClicked()
onEscape: function(self) self:destroy() end
TextList
id: charactersList
@@ -63,7 +65,4 @@ MainWindow
anchors.bottom: parent.bottom
margin.bottom: 16
margin.right: 16
onClick: |
function(self)
self:getParent():destroy()
end
onClick: function(self) self:getParent():destroy() end

View File

@@ -2,6 +2,8 @@ MainWindow
id: enterGameWindow
title: Enter Game
size: 236 160
onEnter: EnterGame_connectToLoginServer()
onEscape: function(self) self:destroy() end
LargerLabel
text: Account name