messagebox (not working yet)

This commit is contained in:
Eduardo Bart
2011-04-23 17:04:49 -03:00
parent a98f1d67db
commit 3960240b8e
9 changed files with 61 additions and 94 deletions

View File

@@ -15,14 +15,14 @@ window#infoWindow:
margin.left: 18
label#infoLabel:
size: [208, 84]
align: center
text: |-
OTClient
Version 0.2.0
Created by edubart
anchors.left: parent.left
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
margin.top: 20
lineDecoration#bottomSeparator:
size: [190,2]

View File

@@ -28,6 +28,7 @@ panel#background:
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
margin.top: 46
onClick: messageBox("Error", "Not implemented yet")
button#optionsButton:
text: Options

View File

@@ -0,0 +1,12 @@
function messageBox(title, text)
local messageBoxWindow = loadUI("modules/messagebox/messagebox.yml")
local messageBoxLabel = messageBoxWindow:getChildByID("messageBoxLabel")
local messageBoxOkButton = messageBoxWindow:getChildByID("messageBoxOkButton")
local uiRoot = messageBoxWindow:getParent()
uiRoot:lock(messageBox)
messageBoxWindow:setTitle(text)
messageBoxLabel:setText(text)
messageBoxWindow:setSize(messageBoxLabel:getSize() + Size{20, 20})
messageBox:setOnDestroy(function() uiRoot:unlock() end)
messageBoxOkButton:setOnClick(function() messageBoxWindow:destroy() end)
end

View File

@@ -0,0 +1,18 @@
window#messageBoxWindow:
size: [236, 78]
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
label#messageBoxLabel:
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
margin.top: 27
button#messageBoxOkButton:
text: Ok
size: [43, 20]
anchors.right: parent.right
anchors.bottom: parent.bottom
margin.bottom: 10
margin.right: 10