Index: code/branches/cegui0.8_ogre1.9/data/gui/scripts/GraphicsMenu.lua
===================================================================
--- code/branches/cegui0.8_ogre1.9/data/gui/scripts/GraphicsMenu.lua	(revision 11795)
+++ code/branches/cegui0.8_ogre1.9/data/gui/scripts/GraphicsMenu.lua	(revision 11800)
@@ -14,10 +14,10 @@
 
     P:setButton(1, 1, {
-            ["button"] = winMgr:getWindow("orxonox/GraphicsOkButton"),
+            ["button"] = P.window:getChild("GraphicsOkButton"),
             ["callback"]  = P.callback_Ok_Clicked
     })
 
     P:setButton(1, 2, {
-            ["button"] = winMgr:getWindow("orxonox/GraphicsCancelButton"),
+            ["button"] = P.window:getChild("GraphicsCancelButton"),
             ["callback"]  = P.callback_Cancel_Clicked
     })
@@ -25,5 +25,5 @@
     -- place apply button at the bottom in the matrix, even though it's in fact at the top, to make the OK button highlighted by default
     P:setButton(2, 1, {
-            ["button"] = winMgr:getWindow("orxonox/Display/Resolution/Apply"),
+            ["button"] = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Apply"),
             ["callback"]  = P.callback_Apply_Clicked
     })
@@ -34,5 +34,5 @@
 
     -- resolution combobox
-    local resolutionCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Display/Resolution/Combobox"))
+    local resolutionCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Combobox"))
     resolutionCombobox:setReadOnly(true)
 
@@ -44,5 +44,5 @@
 
     -- themes combobox
-    local themeCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Display/Theme/Combobox"))
+    local themeCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Theme/Combobox"))
     themeCombobox:setReadOnly(true)
 
@@ -54,5 +54,5 @@
 
     -- fsaa combobox
-    local fsaaCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Display/More/FSAA"))
+    local fsaaCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/FSAA"))
     fsaaCombobox:setReadOnly(true)
 
@@ -64,5 +64,5 @@
 
     -- particle lod combobox
-    local particleLodCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Settings/ParticleLodCombobox"))
+    local particleLodCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/ParticleLodCombobox"))
     particleLodCombobox:setReadOnly(true)
 
@@ -86,10 +86,10 @@
 
     -- aspect ratio editbox
-    local aspectRatioEditbox = winMgr:getWindow("orxonox/Display/Resolution/AspectRatio")
+    local aspectRatioEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/AspectRatio")
     local currentAspectRatio = orxonox.CommandExecutor:query("getConfig Camera aspectRatio_")
     aspectRatioEditbox:setText(currentAspectRatio)
 
     -- themes combobox
-    local themeCombobox =  CEGUI.toCombobox(winMgr:getWindow("orxonox/Display/Theme/Combobox"))
+    local themeCombobox =  CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Theme/Combobox"))
     local currentTheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_")
 
@@ -100,10 +100,10 @@
 
     -- vsync checkbox
-    local vsyncCheckbox = winMgr:getWindow("orxonox/Display/More/VSync")
+    local vsyncCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/VSync")
     local hasVSync = orxonox.GraphicsManager:getInstance():hasVSyncEnabled()
     CEGUI.toCheckbox(vsyncCheckbox):setSelected(hasVSync)
 
     -- fsaa combobox
-    local fsaaCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Display/More/FSAA"))
+    local fsaaCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/FSAA"))
     local currentFSAAMode = orxonox.GraphicsManager:getInstance():getFSAAMode()
 
@@ -121,15 +121,15 @@
 
     -- fov editbox
-    local fovEditbox = winMgr:getWindow("orxonox/Settings/Fov")
+    local fovEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/Fov")
     local currentFov = orxonox.CommandExecutor:query("getConfig Camera fov_")
     fovEditbox:setText(currentFov)
 
     -- fps limit editbox
-    local fpsEditbox = winMgr:getWindow("orxonox/Settings/FpsLimit")
+    local fpsEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/FpsLimit")
     local currentFpsLimit = orxonox.CommandExecutor:query("getConfig GraphicsSettings fpsLimit")
     fpsEditbox:setText(currentFpsLimit)
 
     -- particle lod combobox
-    local particleLodCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Settings/ParticleLodCombobox"))
+    local particleLodCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/ParticleLodCombobox"))
     local currentParticleLod = orxonox.CommandExecutor:query("getConfig GraphicsSettings particlesDetailLevel")
 
@@ -146,5 +146,5 @@
 
     -- mesh lod checkbox
-    local meshLodCheckbox = winMgr:getWindow("orxonox/Settings/MeshLodCheckbox")
+    local meshLodCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/MeshLodCheckbox")
     local hasMeshLod = orxonox.CommandExecutor:query("getConfig GraphicsSettings enableMeshLoD")
     if hasMeshLod == "true" then
@@ -156,5 +156,5 @@
 
     -- motion blur checkbox
-    local motionBlurCheckbox = winMgr:getWindow("orxonox/Settings/MotionBlurCheckbox")
+    local motionBlurCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/MotionBlurCheckbox")
     local hasMotionBlur = orxonox.CommandExecutor:query("getConfig GraphicsSettings enableMotionBlur")
     if hasMotionBlur == "true" then
@@ -168,10 +168,10 @@
 function P:onWindowResized()
     -- fullscreen checkbox
-    local fullscreenCheckbox = winMgr:getWindow("orxonox/Display/Resolution/Fullscreen")
+    local fullscreenCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Fullscreen")
     local isFullscreen = orxonox.GraphicsManager:getInstance():isFullScreen()
     CEGUI.toCheckbox(fullscreenCheckbox):setSelected(isFullscreen)
 
     -- resolution combobox
-    local resolutionCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Display/Resolution/Combobox"))
+    local resolutionCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Combobox"))
 
     local currentWidth = orxonox.GraphicsManager:getInstance():getWindowWidth()
@@ -202,5 +202,5 @@
 function P.updateResolutionEditboxes()
     -- resolution combobox
-    local resolutionCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Display/Resolution/Combobox"))
+    local resolutionCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Combobox"))
 
     local currentWidth = orxonox.GraphicsManager:getInstance():getWindowWidth()
@@ -208,6 +208,6 @@
 
     -- resolution editboxes
-    local widthEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxWidth")
-    local heightEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxHeight")
+    local widthEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/EditboxWidth")
+    local heightEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/EditboxHeight")
     widthEditbox:disable()
     heightEditbox:disable()
@@ -233,11 +233,11 @@
 function P.updateApplyButton()
     -- fullscreen checkbox
-    local fullscreenCheckbox = winMgr:getWindow("orxonox/Display/Resolution/Fullscreen")
+    local fullscreenCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Fullscreen")
     local isFullscreen = orxonox.GraphicsManager:getInstance():isFullScreen()
     local fullscreenChanged = (isFullscreen ~= CEGUI.toCheckbox(fullscreenCheckbox):isSelected())
 
     -- resolution editboxes
-    local widthEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxWidth")
-    local heightEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxHeight")
+    local widthEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/EditboxWidth")
+    local heightEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/EditboxHeight")
     local currentWidth = tostring(orxonox.GraphicsManager:getInstance():getWindowWidth())
     local currentHeight = tostring(orxonox.GraphicsManager:getInstance():getWindowHeight())
@@ -247,5 +247,5 @@
 
     -- apply button
-    local applyButton = winMgr:getWindow("orxonox/Display/Resolution/Apply")
+    local applyButton = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Apply")
 
     if fullscreenChanged or widthChanged or heightChanged or resolutionEditboxesEnabled then
@@ -258,15 +258,15 @@
 function P.updateRedLabel()
     -- theme
-    local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox")
+    local themeCombobox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Theme/Combobox")
     local currentTheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_")
     local themeChanged = (currentTheme ~= themeCombobox:getText())
 
     -- vsync
-    local vsyncCheckbox = winMgr:getWindow("orxonox/Display/More/VSync")
+    local vsyncCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/VSync")
     local hasVSync = orxonox.GraphicsManager:getInstance():hasVSyncEnabled()
     local vsyncChanged = (hasVSync ~= CEGUI.toCheckbox(vsyncCheckbox):isSelected())
 
     -- fsaa
-    local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA")
+    local fsaaCombobox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/FSAA")
     local currentFSAAMode = orxonox.GraphicsManager:getInstance():getFSAAMode()
     local fsaaChanged = (currentFSAAMode ~= fsaaCombobox:getText())
@@ -274,7 +274,7 @@
     local needRestart = themeChanged or vsyncChanged or fsaaChanged
 
-    local notice = winMgr:getWindow("orxonox/Display/Notice")
+    local notice = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Notice")
     notice:setVisible(not needRestart)
-    local noticeRed = winMgr:getWindow("orxonox/Display/NoticeRed")
+    local noticeRed = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/NoticeRed")
     noticeRed:setVisible(needRestart)
 end
@@ -286,5 +286,5 @@
 -- resolution
 
-function P.callback_FullscreenCheckbox_CheckStateChanged(e)
+function P.callback_FullscreenCheckbox_SelectStateChanged(e)
     P.updateApplyButton()
 end
@@ -310,5 +310,5 @@
 -- vsync
 
-function P.callback_VSyncCheckbox_CheckStateChanged(e)
+function P.callback_VSyncCheckbox_SelectStateChanged(e)
     P.updateRedLabel()
 end
@@ -324,9 +324,9 @@
 function P.callback_Apply_Clicked(e)
     -- resolution
-    local fullscreenCheckbox = winMgr:getWindow("orxonox/Display/Resolution/Fullscreen")
+    local fullscreenCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Fullscreen")
     local checkedFullscreen = tostring(CEGUI.toCheckbox(fullscreenCheckbox):isSelected())
 
-    local widthEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxWidth")
-    local heightEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxHeight")
+    local widthEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/EditboxWidth")
+    local heightEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/EditboxHeight")
 
     P.newWidth = widthEditbox:getText()
@@ -339,5 +339,5 @@
     P.oldFullscreen = orxonox.GraphicsManager:getInstance():isFullScreen()
 
-    P.revertTimerHandle = orxonox.CommandExecutor:query("delayreal 10 {hideGUI DecisionPopup; GraphicsManager setScreenResolution " .. P.oldWidth .. " " .. P.oldHeight .. " " .. tostring(P.oldFullscreen) .. "; config Core lastLevelTimestamp_ [expr [getConfig Core ogreConfigTimestamp_] + 1]}")
+    P.revertTimerHandle = orxonox.CommandExecutor:query("delayreal 10 {hideGUI DecisionPopup; GraphicsManager setScreenResolution " .. P.oldWidth .. " " .. P.oldHeight .. " " .. tostring(P.oldFullscreen) .. "; config CoreConfig lastLevelTimestamp_ [expr [getConfig CoreConfig ogreConfigTimestamp_] + 1]}")
 
     -- change settings
@@ -362,18 +362,18 @@
 
     -- update timestamp to avoid showing the ogre config dialog again after the user accepted or reverted the resolution
-    orxonox.CommandExecutor:execute("config Core lastLevelTimestamp_ [expr [getConfig Core ogreConfigTimestamp_] + 1]")
+    orxonox.CommandExecutor:execute("config CoreConfig lastLevelTimestamp_ [expr [getConfig CoreConfig ogreConfigTimestamp_] + 1]")
 end
 
 function P.callback_Ok_Clicked(e)
     -- aspect ratio
-    local aspectRatioEditbox = winMgr:getWindow("orxonox/Display/Resolution/AspectRatio")
+    local aspectRatioEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/AspectRatio")
     orxonox.CommandExecutor:execute("config Camera aspectRatio_ " .. aspectRatioEditbox:getText())
 
     -- theme
-    local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox")
+    local themeCombobox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Theme/Combobox")
     orxonox.CommandExecutor:execute("config GUIManager guiScheme_ " .. themeCombobox:getText())
 
     -- vsync
-    local vsyncCheckbox = winMgr:getWindow("orxonox/Display/More/VSync")
+    local vsyncCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/VSync")
     local hasVSync = orxonox.GraphicsManager:getInstance():hasVSyncEnabled()
     if hasVSync ~= CEGUI.toCheckbox(vsyncCheckbox):isSelected() then
@@ -382,5 +382,5 @@
 
     -- fsaa
-    local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA")
+    local fsaaCombobox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/FSAA")
     local currentFSAAMode = orxonox.GraphicsManager:getInstance():getFSAAMode()
     if currentFSAAMode ~= fsaaCombobox:getText() then
@@ -389,13 +389,13 @@
 
     -- fov
-    local fovEditbox = winMgr:getWindow("orxonox/Settings/Fov")
+    local fovEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/Fov")
     orxonox.CommandExecutor:execute("config Camera fov_ " .. fovEditbox:getText())
 
     -- fps limit
-    local fpsEditbox = winMgr:getWindow("orxonox/Settings/FpsLimit")
+    local fpsEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/FpsLimit")
     orxonox.CommandExecutor:execute("config GraphicsSettings fpsLimit " .. fpsEditbox:getText())
 
     -- particle lod
-    local particleLodCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Settings/ParticleLodCombobox"))
+    local particleLodCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/ParticleLodCombobox"))
     local item = particleLodCombobox:getSelectedItem()
     if item then
@@ -404,9 +404,9 @@
 
     -- mesh lod
-    local meshLodCheckbox = winMgr:getWindow("orxonox/Settings/MeshLodCheckbox")
+    local meshLodCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/MeshLodCheckbox")
     orxonox.CommandExecutor:execute("config GraphicsSettings enableMeshLoD " .. tostring(CEGUI.toCheckbox(meshLodCheckbox):isSelected()))
 
     -- motion blur
-    local motionBlurCheckbox = winMgr:getWindow("orxonox/Settings/MotionBlurCheckbox")
+    local motionBlurCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/MotionBlurCheckbox")
     orxonox.CommandExecutor:execute("config GraphicsSettings enableMotionBlur " .. tostring(CEGUI.toCheckbox(motionBlurCheckbox):isSelected()))
 
