Index: code/branches/cegui0.8_ogre1.9/data/gui/scripts/QuestGUI.lua
===================================================================
--- code/branches/cegui0.8_ogre1.9/data/gui/scripts/QuestGUI.lua	(revision 11795)
+++ code/branches/cegui0.8_ogre1.9/data/gui/scripts/QuestGUI.lua	(revision 11806)
@@ -40,5 +40,5 @@
 -- selectQuest is a pointer to a quest that should be selected, if it is nil the first quest is selected.
 function P.loadQuestsList(selectQuest)
-    local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/QuestsList"))
+    local list = CEGUI.toListbox(P.window:getChild("MainWindow/LeftPanel/QuestsList"))
     P.clearQuestList()
 
@@ -124,9 +124,9 @@
         -- Load title and description
         local description = P.questManager:getDescription(quest)
-        local titleWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Title")
+        local titleWindow = P.window:getChild("MainWindow/Title")
         titleWindow:setText(description:getTitle())
-        local descriptionWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Description")
+        local descriptionWindow = P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/Description")
         descriptionWindow:setText(description:getDescription())
-        descriptionWindow:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(1, 0)))
+        descriptionWindow:setSize(CEGUI.USize(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(1, 0)))
         descriptionWindow:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderSize), CEGUI.UDim(0, P.borderSize)))
         local height = getStaticTextWindowHeight(descriptionWindow)
@@ -135,5 +135,5 @@
 
         -- Load subquests
-        local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/Quest/SubquestsList"))
+        local list = CEGUI.toListbox(P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/SubquestsList"))
         local numQuests = P.questManager:getNumSubQuests(quest, P.player)
         local i = 0
@@ -150,12 +150,12 @@
             height = height+P.frameHeigth
         end
-        list:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(0, height)))
+        list:setSize(CEGUI.USize(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(0, height)))
         list:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderSize), CEGUI.UDim(0, offset)))
         offset = offset + height + P.borderSize
 
         -- Load hints
-        local hintsWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Hints")
+        local hintsWindow = P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/Hints")
         hintsWindow:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderSize), CEGUI.UDim(0, offset)))
-        hintsWindow:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(0, 0)))
+        hintsWindow:setSize(CEGUI.USize(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(0, 0)))
         height = P.titleHeight
         local numHints = P.questManager:getNumHints(quest, P.player)
@@ -173,6 +173,6 @@
 
         -- Set the size of the wrapper
-        local window = winMgr:getWindow("orxonox/QuestGUI/Quest/Wrapper")
-        window:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize-P.scrollbarWidth), CEGUI.UDim(0,offset+P.borderSize)))
+        local window = P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper")
+        window:setSize(CEGUI.USize(CEGUI.UDim(1, -P.borderSize-P.scrollbarWidth), CEGUI.UDim(0,offset+P.borderSize)))
     end
 end
@@ -181,13 +181,13 @@
 function P.clearQuest()
     -- clear title
-    local titleWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Title")
+    local titleWindow = P.window:getChild("MainWindow/Title")
     titleWindow:setText("no Quests")
 
     -- clear description
-    local descriptionWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Description")
+    local descriptionWindow = P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/Description")
     descriptionWindow:setText("There is currently no quest that can be displayed.")
 
     -- clear list fo subquests
-    local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/Quest/SubquestsList"))
+    local list = CEGUI.toListbox(P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/SubquestsList"))
     list:resetList()
     list:setHeight(CEGUI.UDim(0, 0))
@@ -195,21 +195,21 @@
 
     -- clear hints
-    local hints = winMgr:getWindow("orxonox/QuestGUI/Quest/Hints")
+    local hints = P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/Hints")
     local numChildren = hints:getChildCount()-2 -- TODO: HACK
     local i = 0
     while i < numChildren do
-        local hint = hints:getChild("orxonox/QuestGUI/Quest/Hints/" .. i)
+        local hint = hints:getChild("" .. i)
         if hint ~= nil then
-            hints:removeChildWindow(hint)
+            hints:removeChild(hint)
             winMgr:destroyWindow(hint)
         end
         i = i+1
     end
-    hints:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.scrollbarWidth-P.borderSize), CEGUI.UDim(0, 0)))
+    hints:setSize(CEGUI.USize(CEGUI.UDim(1, -P.scrollbarWidth-P.borderSize), CEGUI.UDim(0, 0)))
 end
 
 -- Clear the quests list
 function P.clearQuestList()
-    local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/QuestsList"))
+    local list = CEGUI.toListbox(P.window:getChild("MainWindow/LeftPanel/QuestsList"))
     list:resetList()
     P.quests = {}
@@ -253,13 +253,13 @@
 function P.insertHint(hintsWindow, hint, index, offset)
     -- Create the window for the hint.
-    local window = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/QuestGUI/Quest/Hints/" .. index)
+    local window = winMgr:createWindow("MenuWidgets/StaticText", "" .. index)
     window:setProperty("HorzFormatting", "WordWrapLeftAligned")
     window:setProperty("VertFormatting", "TopAligned")
     window:setProperty("FrameEnabled", "false")
     window:setID(index)
-    hintsWindow:addChildWindow(window)
+    hintsWindow:addChild(window)
     local description = P.questManager:getDescription(hint)
     window:setText(description:getDescription())
-    window:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(1, 0)))
+    window:setSize(CEGUI.USize(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(1, 0)))
     local height = getStaticTextWindowHeight(window)
     window:setHeight(CEGUI.UDim(0, height))
@@ -286,5 +286,5 @@
 -- Change to a new quest.
 function P.changeQuest_clicked(e)
-    local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/QuestsList"))
+    local list = CEGUI.toListbox(P.window:getChild("MainWindow/LeftPanel/QuestsList"))
     local choice = list:getFirstSelectedItem()
     if choice ~= nil then
@@ -299,6 +299,6 @@
 -- Change to a new subquest.
 function P.changeToSubquest_clicked(e)
-    local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/Quest/SubquestsList"))
-    local questsList = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/QuestsList"))
+    local list = CEGUI.toListbox(P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/SubquestsList"))
+    local questsList = CEGUI.toListbox(P.window:getChild("MainWindow/LeftPanel/QuestsList"))
     local choice = list:getFirstSelectedItem()
     if choice ~= nil then
@@ -328,5 +328,5 @@
 
     local questWindow = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/QuestGUI/Quests")
-    questWindow:setSize(CEGUI.UVector2(CEGUI.UDim(1, 0),CEGUI.UDim(1, 0)))
+    questWindow:setSize(CEGUI.USize(CEGUI.UDim(1, 0),CEGUI.UDim(1, 0)))
 
     -- Iterate through all root-quests.
@@ -348,7 +348,7 @@
     node:setText(orxonox.QuestManager:getInstance():getDescription(parent):getTitle())
     node:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.indentWidth*depth), CEGUI.UDim(0, P.buttonHeight*index)))
-    node:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.indentWidth*depth-P.scrollbarWidth), CEGUI.UDim(0, P.buttonHeight)))
+    node:setSize(CEGUI.USize(CEGUI.UDim(1, -P.indentWidth*depth-P.scrollbarWidth), CEGUI.UDim(0, P.buttonHeight)))
     orxonox.GUIManager:subscribeEventHelper(node, "Clicked", P.name .. ".openDetails_clicked")
-    root:addChildWindow(node)
+    root:addChild(node)
     
     table.insert(P.quests, parent)
@@ -389,5 +389,5 @@
     --Get some numbers from the window
     local we = CEGUI.toWindowEventArgs(e)
-    local name = we.window:getName()
+    local name = we.window:getNamePath()
     local match = string.gmatch(name, "%d+")
     local questNr = tonumber(match())
@@ -397,5 +397,5 @@
 
     local details = winMgr:createWindow("MenuWidgets/FrameWindow", name)
-    details:setSize(CEGUI.UVector2(CEGUI.UDim(0.7, 0), CEGUI.UDim(0.7, 0)))
+    details:setSize(CEGUI.USize(CEGUI.UDim(0.7, 0), CEGUI.UDim(0.7, 0)))
     details:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0), CEGUI.UDim(0.1, 0)))
     details:setText(orxonox.QuestManager:getInstance():getDescription(quest):getTitle())
@@ -408,12 +408,12 @@
     name = name .. "/Scrollable"
     local window = winMgr:createWindow("MenuWidgets/ScrollablePane", name)
-    window:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -2*P.borderWidth),CEGUI.UDim(1.0, -P.titleHeight)))
+    window:setSize(CEGUI.USize(CEGUI.UDim(1.0, -2*P.borderWidth),CEGUI.UDim(1.0, -P.titleHeight)))
     window:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderWidth), CEGUI.UDim(0, P.titleHeight)))
-    details:addChildWindow(window)
+    details:addChild(window)
 
     local offset = 0
 
     local status = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Status")
-    window:addChildWindow(status)
+    window:addChild(status)
     status:setProperty("HorzFormatting", "WordWrapLeftAligned")
     status:setProperty("VertFormatting", "TopAligned")
@@ -426,5 +426,5 @@
     end
     status:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
-    status:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
+    status:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     local height = getStaticTextWindowHeight(status)
     status:setHeight(CEGUI.UDim(0, height))
@@ -432,10 +432,10 @@
 
     local descriptionTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description/Title")
-    window:addChildWindow(descriptionTitle)
-    descriptionTitle:setProperty("HorzFormatting", "HorzCentred")
+    window:addChild(descriptionTitle)
+    descriptionTitle:setProperty("HorzFormatting", "CentreAligned")
     descriptionTitle:setProperty("VertFormatting", "TopAligned")
     descriptionTitle:setText("Description:")
     descriptionTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
-    descriptionTitle:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
+    descriptionTitle:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     height = getStaticTextWindowHeight(descriptionTitle)
     descriptionTitle:setHeight(CEGUI.UDim(0, height))
@@ -443,10 +443,10 @@
 
     local description = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description")
-    window:addChildWindow(description)
+    window:addChild(description)
     description:setProperty("HorzFormatting", "WordWrapLeftAligned")
     description:setProperty("VertFormatting", "TopAligned")
     description:setText(orxonox.QuestManager:getInstance():getDescription(quest):getDescription())
     description:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
-    description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
+    description:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     height = getStaticTextWindowHeight(description)
     description:setHeight(CEGUI.UDim(0, height))
@@ -457,10 +457,10 @@
     if numHints > 0 then
         local hintsTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Hints/Title")
-        window:addChildWindow(hintsTitle)
-        hintsTitle:setProperty("HorzFormatting", "HorzCentred")
+        window:addChild(hintsTitle)
+        hintsTitle:setProperty("HorzFormatting", "CentreAligned")
         hintsTitle:setProperty("VertFormatting", "TopAligned")
         hintsTitle:setText("Hints:")
         hintsTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
-        hintsTitle:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
+        hintsTitle:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
         height = getStaticTextWindowHeight(hintsTitle)
         hintsTitle:setHeight(CEGUI.UDim(0, height))
@@ -475,6 +475,6 @@
         node:setText(orxonox.QuestManager:getInstance():getDescription(hint):getTitle())
         node:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
-        node:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.scrollbarWidth), CEGUI.UDim(0, P.buttonHeight)))
-        window:addChildWindow(node)
+        node:setSize(CEGUI.USize(CEGUI.UDim(1, -P.scrollbarWidth), CEGUI.UDim(0, P.buttonHeight)))
+        window:addChild(node)
         offset = offset + P.buttonHeight
 
@@ -483,6 +483,6 @@
     end
 
-    local window = winMgr:getWindow("orxonox/QuestGUI/Background")
-    window:addChildWindow(details)
+    local window = P.window:getChild("orxonox/QuestGUI/Background")
+    window:addChild(details)
 end
 
@@ -499,5 +499,5 @@
 function P.closeDetails_clicked(e)
     local we = CEGUI.toWindowEventArgs(e)
-    local name = we.window:getName()
+    local name = we.window:getNamePath()
     local match = string.gmatch(name, "%d+")
     match()
@@ -511,5 +511,5 @@
     --Get some numbers from the window
     local we = CEGUI.toWindowEventArgs(e)
-    local name = we.window:getName()
+    local name = we.window:getNamePath()
     local match = string.gmatch(name, "%d+")
     match()
@@ -521,5 +521,5 @@
 
     local details = winMgr:createWindow("MenuWidgets/FrameWindow", name)
-    details:setSize(CEGUI.UVector2(CEGUI.UDim(0.7, 0), CEGUI.UDim(0.7, 0)))
+    details:setSize(CEGUI.USize(CEGUI.UDim(0.7, 0), CEGUI.UDim(0.7, 0)))
     details:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0), CEGUI.UDim(0.1, 0)))
     details:setText(orxonox.QuestManager:getInstance():getDescription(hint):getTitle())
@@ -532,17 +532,17 @@
     name = name .. "/Scrollable"
     local window = winMgr:createWindow("MenuWidgets/ScrollablePane", name)
-    window:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -2*P.borderWidth),CEGUI.UDim(1.0, -P.titleHeight)))
+    window:setSize(CEGUI.USize(CEGUI.UDim(1.0, -2*P.borderWidth),CEGUI.UDim(1.0, -P.titleHeight)))
     window:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderWidth), CEGUI.UDim(0, P.titleHeight)))
-    details:addChildWindow(window)
+    details:addChild(window)
 
     local offset = 0
     
     local descriptionTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description/Title")
-    window:addChildWindow(descriptionTitle)
-    descriptionTitle:setProperty("HorzFormatting", "HorzCentred")
+    window:addChild(descriptionTitle)
+    descriptionTitle:setProperty("HorzFormatting", "CentreAligned")
     descriptionTitle:setProperty("VertFormatting", "TopAligned")
     descriptionTitle:setText("Description:")
     descriptionTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
-    descriptionTitle:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
+    descriptionTitle:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     height = getStaticTextWindowHeight(descriptionTitle)
     descriptionTitle:setHeight(CEGUI.UDim(0, height))
@@ -550,20 +550,20 @@
 
     local description = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description")
-    window:addChildWindow(description)
+    window:addChild(description)
     description:setProperty("HorzFormatting", "WordWrapLeftAligned")
     description:setProperty("VertFormatting", "TopAligned")
     description:setText(orxonox.QuestManager:getInstance():getDescription(hint):getDescription())
     description:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
-    description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
+    description:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     height = getStaticTextWindowHeight(description)
     description:setHeight(CEGUI.UDim(0, height))
 
-    local window = winMgr:getWindow("orxonox/QuestGUI/Background")
-    window:addChildWindow(details)
+    local window = P.window:getChild("orxonox/QuestGUI/Background")
+    window:addChild(details)
 end
 
 function P.closeHintDetails_clicked(e)
     local we = CEGUI.toWindowEventArgs(e)
-    local name = we.window:getName()
+    local name = we.window:getNamePath()
     local match = string.gmatch(name, "%d+")
     match()
