rework on UILineEdit

* allow multiline text editing
* rename UILineEdit to UITextEdit
This commit is contained in:
Eduardo Bart
2012-03-31 10:43:01 -03:00
parent 595cdc1bb4
commit 0ddaa234af
21 changed files with 711 additions and 83 deletions

View File

@@ -10,9 +10,9 @@ local enterGameButton
-- private functions
local function clearAccountFields()
enterGame:getChildById('accountNameLineEdit'):clearText()
enterGame:getChildById('accountPasswordLineEdit'):clearText()
enterGame:getChildById('accountNameLineEdit'):focus()
enterGame:getChildById('accountNameTextEdit'):clearText()
enterGame:getChildById('accountPasswordTextEdit'):clearText()
enterGame:getChildById('accountNameTextEdit'):focus()
Settings.remove('account')
Settings.remove('password')
end
@@ -71,13 +71,13 @@ function EnterGame.init()
local port = Settings.get('port')
local autologin = Settings.getBoolean('autologin')
enterGame:getChildById('accountNameLineEdit'):setText(account)
enterGame:getChildById('accountPasswordLineEdit'):setText(password)
enterGame:getChildById('serverHostLineEdit'):setText(host)
enterGame:getChildById('serverPortLineEdit'):setText(port)
enterGame:getChildById('accountNameTextEdit'):setText(account)
enterGame:getChildById('accountPasswordTextEdit'):setText(password)
enterGame:getChildById('serverHostTextEdit'):setText(host)
enterGame:getChildById('serverPortTextEdit'):setText(port)
enterGame:getChildById('autoLoginBox'):setChecked(autologin)
enterGame:getChildById('rememberPasswordBox'):setChecked(#account > 0)
enterGame:getChildById('accountNameLineEdit'):focus()
enterGame:getChildById('accountNameTextEdit'):focus()
-- only open entergame when app starts
enterGame:hide()
@@ -120,10 +120,10 @@ function EnterGame.openWindow()
end
function EnterGame.doLogin()
EnterGame.account = enterGame:getChildById('accountNameLineEdit'):getText()
EnterGame.password = enterGame:getChildById('accountPasswordLineEdit'):getText()
EnterGame.host = enterGame:getChildById('serverHostLineEdit'):getText()
EnterGame.port = tonumber(enterGame:getChildById('serverPortLineEdit'):getText())
EnterGame.account = enterGame:getChildById('accountNameTextEdit'):getText()
EnterGame.password = enterGame:getChildById('accountPasswordTextEdit'):getText()
EnterGame.host = enterGame:getChildById('serverHostTextEdit'):getText()
EnterGame.port = tonumber(enterGame:getChildById('serverPortTextEdit'):getText())
EnterGame.hide()
Settings.set('host', EnterGame.host)

View File

@@ -10,8 +10,8 @@ MainWindow
anchors.left: parent.left
anchors.top: parent.top
LineEdit
id: accountNameLineEdit
TextEdit
id: accountNameTextEdit
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
@@ -23,8 +23,8 @@ MainWindow
anchors.top: prev.bottom
margin-top: 8
PasswordLineEdit
id: accountPasswordLineEdit
PasswordTextEdit
id: accountPasswordTextEdit
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
@@ -38,8 +38,8 @@ MainWindow
anchors.top: prev.bottom
margin-top: 8
LineEdit
id: serverHostLineEdit
TextEdit
id: serverHostTextEdit
tooltip: |-
Make sure that your client uses
the correct game protocol version
@@ -56,8 +56,8 @@ MainWindow
anchors.top: serverLabel.top
margin-left: 10
LineEdit
id: serverPortLineEdit
TextEdit
id: serverPortTextEdit
text: 7171
anchors.left: portLabel.left
anchors.right: portLabel.right