Index: code/branches/cegui0.8_ogre1.9/data/gui/scripts/KeyBindMenu.lua
===================================================================
--- code/branches/cegui0.8_ogre1.9/data/gui/scripts/KeyBindMenu.lua	(revision 11787)
+++ code/branches/cegui0.8_ogre1.9/data/gui/scripts/KeyBindMenu.lua	(revision 11800)
@@ -79,5 +79,5 @@
 
     --Calculate design parameters:
-    sampleWindow = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/KeyBindPane/SampleWindow")
+    sampleWindow = winMgr:createWindow("MenuWidgets/StaticText", "KeyBindPane/SampleWindow")
     sampleWindow:setText("SampleText")
 
@@ -112,5 +112,5 @@
 
     P:setButton(1, 1, {
-            ["button"] = winMgr:getWindow("orxonox/KeyBindBackButton"),
+            ["button"] = P.window:getChild("KeyBindBackButton"),
             ["callback"]  = P.KeyBindBackButton_clicked
     })
@@ -137,26 +137,26 @@
 function P.createLine(k)
     local offset = 0
-    local line = winMgr:createWindow("DefaultWindow", "orxonox/KeyBindPane/Binding" .. k)
+    local line = winMgr:createWindow("DefaultWindow", "Binding" .. k)
     line:setHeight(CEGUI.UDim(0, lineHeight))
     line:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, lineHeight*(k-1))))
 
-    local command = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/KeyBindPane/Binding" .. k .. "/Command")
+    local command = winMgr:createWindow("MenuWidgets/StaticText", "Command")
     command:setText(nameList[k])
-    command:setSize(CEGUI.UVector2(CEGUI.UDim(0, commandWidth), CEGUI.UDim(1, 0)))
+    command:setSize(CEGUI.USize(CEGUI.UDim(0, commandWidth), CEGUI.UDim(1, 0)))
     command:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0, 0)))
-    line:addChildWindow(command)
+    line:addChild(command)
     offset = offset + commandWidth + spaceWidth
 
-    local plus = winMgr:createWindow("MenuWidgets/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Plus")
-    plus:setSize(CEGUI.UVector2(CEGUI.UDim(0, addWidth), CEGUI.UDim(0.7, 0)))
+    local plus = winMgr:createWindow("MenuWidgets/TabButton", "Plus")
+    plus:setSize(CEGUI.USize(CEGUI.UDim(0, addWidth), CEGUI.UDim(0.7, 0)))
     plus:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.15, 0)))
     plus:setText("add")
     orxonox.GUIManager:subscribeEventHelper(plus, "Clicked", P.name .. ".KeyBindPlus_clicked")
-    line:addChildWindow(plus)
+    line:addChild(plus)
     offset = offset + addWidth + spaceWidth
 
     local numButtons = orxonox.KeyBinderManager:getInstance():getCurrent():getNumberOfBindings(commandList[k]);
     for i=0,(numButtons-1) do
-        local button = winMgr:createWindow("MenuWidgets/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Button" .. i)
+        local button = winMgr:createWindow("MenuWidgets/TabButton", "Button" .. i)
         local name = orxonox.KeyBinderManager:getInstance():getCurrent():getBinding(commandList[k],i)
         name = P.KeyNameNiceifier(name)
@@ -165,17 +165,17 @@
         local size = getMinTextSize(sampleWindow)
         local buttonWidth = size[2]
-        button:setSize(CEGUI.UVector2(CEGUI.UDim(0, buttonWidth), CEGUI.UDim(0.7, 0)))
+        button:setSize(CEGUI.USize(CEGUI.UDim(0, buttonWidth), CEGUI.UDim(0.7, 0)))
         button:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.15, 0)))
         orxonox.GUIManager:subscribeEventHelper(button, "Clicked", P.name .. ".KeyBindButton_clicked")
         --button:subscribeScriptedEvent("EventClicked", P.name .. ".KeyBindButton_clicked")
-        line:addChildWindow(button)
+        line:addChild(button)
         offset = offset + buttonWidth
 
-        local clear = winMgr:createWindow("MenuWidgets/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Clear" .. i)
-        clear:setSize(CEGUI.UVector2(CEGUI.UDim(0, clearWidth), CEGUI.UDim(0.7, 0)))
+        local clear = winMgr:createWindow("MenuWidgets/TabButton", "Clear" .. i)
+        clear:setSize(CEGUI.USize(CEGUI.UDim(0, clearWidth), CEGUI.UDim(0.7, 0)))
         clear:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.15, 0)))
         clear:setText("X")
         orxonox.GUIManager:subscribeEventHelper(clear, "Clicked", P.name .. ".KeyBindClear_clicked")
-        line:addChildWindow(clear)
+        line:addChild(clear)
         offset = offset + clearWidth + spaceWidth
     end
@@ -187,10 +187,10 @@
 
 function P.createLines()
-    local window = winMgr:getWindow("orxonox/KeyBindPane")
+    local window = P.window:getChild("KeyBindWindow/KeyBindWrapper/KeyBindPane")
 
     for k,v in pairs(commandList) do
         local line = P.createLine(k)
         table.insert(linesList, line)
-        window:addChildWindow(line)
+        window:addChild(line)
     end
 
@@ -201,5 +201,5 @@
 function P.KeyBindButton_clicked(e)
     local we = CEGUI.toWindowEventArgs(e)
-    local name = we.window:getName()
+    local name = we.window:getNamePath()
 
     local match = string.gmatch(name, "%d+")
@@ -215,5 +215,5 @@
 function P.KeyBindPlus_clicked(e)
     local we = CEGUI.toWindowEventArgs(e)
-    local name = we.window:getName()
+    local name = we.window:getNamePath()
 
     local match = string.gmatch(name, "%d+")
@@ -227,5 +227,5 @@
 function P.KeyBindClear_clicked(e)
     local we = CEGUI.toWindowEventArgs(e)
-    local name = we.window:getName()
+    local name = we.window:getNamePath()
 
     local match = string.gmatch(name, "%d+")
@@ -251,9 +251,9 @@
 
 function P.callback()
-    local pane = tolua.cast(winMgr:getWindow("orxonox/KeyBindPane"), "CEGUI::ScrollablePane")
+    local pane = tolua.cast(P.window:getChild("KeyBindWindow/KeyBindWrapper/KeyBindPane"), "CEGUI::ScrollablePane")
     local position = pane:getVerticalScrollPosition()
     while table.getn(linesList) ~= 0 do
         if linesList[1] ~= nil then
-            winMgr:destroyWindow(linesList[1]:getName())
+            winMgr:destroyWindow(pane:getChild(linesList[1]:getName()))
         end
         table.remove(linesList, 1)
