Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 10, 2010, 7:50:06 PM (14 years ago)
Author:
dafrick
Message:

Done some selective testing and it finally seems to work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/notifications/data/gui/scripts/NotificationLayer.lua

    r7395 r7398  
    4040        winMgr:destroyWindow(queue.window)
    4141    end
    42     queue = nil
     42    P.queueList[name] = nil
    4343end
    4444
     
    194194    window = winMgr:createWindow("MenuWidgets/FrameWindow", "orxonox/NotificationLayer/Root/EditMode/" .. name)
    195195    local frame = tolua.cast(window, "CEGUI::FrameWindow")
    196     frame:setCloseButtonEnabled(false)
     196    frame:setCloseButtonEnabled(true)
     197    orxonox.GUIManager:subscribeEventHelper(frame, "CloseClicked", P.name .. ".closeQueue_clicked")
    197198    frame:setText("NotificationQueue \"" .. name .. "\"")
    198199    root:addChildWindow(window)
     
    221222    targets:setSize(CEGUI.UVector2(CEGUI.UDim(0, size[2]*2+20), CEGUI.UDim(0, textHeight)))
    222223    targets:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horzOffset), CEGUI.UDim(0, vertOffset)))
    223     cout(0, horzOffset .. "|" .. targets:getXPosition():asAbsolute(1) .. "|" .. size[2]*2+20)
    224224    horzOffset = horzOffset + size[2]*2+20 + 5
    225225    pane:addChildWindow(targets)
     
    231231    save:setSize(CEGUI.UVector2(CEGUI.UDim(0, saveTextWidth), CEGUI.UDim(0, textHeight)))
    232232    save:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horzOffset), CEGUI.UDim(0, vertOffset)))
    233     cout(0, horzOffset .. "|" .. save:getXPosition():asAbsolute(1))
    234233    orxonox.GUIManager:subscribeEventHelper(save, "Clicked", P.name .. ".saveTargets_clicked")
    235234    pane:addChildWindow(save)
     
    335334    local window = winMgr:getWindow("orxonox/NotificationLayer/Root/EditMode/" .. queueName .. "/Targets")
    336335    local save = winMgr:getWindow("orxonox/NotificationLayer/Root/EditMode/" .. queueName .. "/Targets/Save")
    337     local width = window:getXPosition():asAbsolute(1)
     336    local width = window:getWidth():asAbsolute(1)
    338337
    339338    local queue = orxonox.NotificationManager:getInstance():getQueue(queueName)
     
    345344    local size = getMinTextSize(P.sampleWindow)
    346345    window:setWidth(CEGUI.UDim(0, size[2]*2+20))
    347     cout(0, width .. "|" .. size[2]*2+20 .. "|" .. window:getWidth():asAbsolute(1) .. "|" .. save:getXPosition():asAbsolute(1))
    348346    save:setXPosition(CEGUI.UDim(0, save:getXPosition():asAbsolute(1)-width+window:getWidth():asAbsolute(1)))
    349347end
     
    359357    local window = winMgr:getWindow("orxonox/NotificationLayer/Root/EditMode/" .. queueName .. "/Size")
    360358    local save = winMgr:getWindow("orxonox/NotificationLayer/Root/EditMode/" .. queueName .. "/Size/Save")
    361     local width = window:getXPosition():asAbsolute(1)
     359    local width = window:getWidth():asAbsolute(1)
    362360
    363361    local queue = orxonox.NotificationManager:getInstance():getQueue(queueName)
     
    382380    local window = winMgr:getWindow("orxonox/NotificationLayer/Root/EditMode/" .. queueName .. "/DisplayTime")
    383381    local save = winMgr:getWindow("orxonox/NotificationLayer/Root/EditMode/" .. queueName .. "/DisplayTime/Save")
    384     local width = window:getXPosition():asAbsolute(1)
     382    local width = window:getWidth():asAbsolute(1)
    385383
    386384    local queue = orxonox.NotificationManager:getInstance():getQueue(queueName)
     
    417415function P.leaveEditMode_clicked(e)
    418416    hideMenuSheet(P.name)
     417end
     418
     419function P.closeQueue_clicked(e)
     420    local we = CEGUI.toWindowEventArgs(e)
     421    local name = we.window:getName()
     422
     423    local match = string.gmatch(name, "EditMode/.*")
     424    local nameStr = match()
     425    local queueName = string.sub(nameStr, 10, string.len(nameStr))
     426
     427    winMgr:destroyWindow(P.queueList[queueName].edit)
     428    P.queueList[queueName].edit = nil
     429    orxonox.NotificationManager:getInstance():getQueue(queueName):destroy()
    419430end
    420431
Note: See TracChangeset for help on using the changeset viewer.