Index: code/branches/presentation2/data/gui/layouts/GraphicsMenu.layout
===================================================================
--- code/branches/presentation2/data/gui/layouts/GraphicsMenu.layout	(revision 6261)
+++ code/branches/presentation2/data/gui/layouts/GraphicsMenu.layout	(revision 6262)
@@ -15,5 +15,5 @@
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
             <Property Name="VertFormatting" Value="TopAligned" />
-            <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.325,0},{0.75,0},{0.6,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.25,0},{0.75,0},{0.6,0}}" />
             <Window Type="TaharezLook/StaticText" Name="orxonox/Resolution" >
                 <Property Name="Text" Value="Resolution" />
@@ -22,18 +22,9 @@
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                 <Property Name="VertFormatting" Value="TopAligned" />
-                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.2,0},{0.475,0},{0.9,0}}" />
-                <Window Type="TaharezLook/Combobox" Name="orxonox/ResolutionCombobox" >
-                    <Property Name="ReadOnly" Value="True" />
-                    <Property Name="AlwaysOnTop" Value="True" />
+                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.475,0},{0.92,0}}" />
+                <Window Type="TaharezLook/Listbox" Name="orxonox/ResolutionListbox" >
                     <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.21,0},{0.95,0},{0.9,0}}" />
-                    <Property Name="MaxEditTextLength" Value="1073741823" />
-                    <Event Name="ListSelectionAccepted" Function="GraphicsMenu.GraphicsResolutionCombobox_changed"/>
-                </Window>
-                <Window Type="TaharezLook/Checkbox" Name="orxonox/FullscreenCheckbox" >
-                    <Property Name="Text" Value="Fullscreen" />
-                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                    <Property Name="UnifiedAreaRect" Value="{{0.275,0},{0.725,0},{0.725,0},{0.85,0}}" />
-                    <Event Name="CheckStateChanged" Function="GraphicsMenu.GraphicsFullscreenCheckbox_clicked"/>
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.92,0}}" />
+                    <Event Name="ItemSelectionChanged" Function="GraphicsMenu.GraphicsResolutionListbox_changed"/>
                 </Window>
             </Window>
@@ -44,6 +35,7 @@
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                 <Property Name="VertFormatting" Value="TopAligned" />
-                <Property Name="UnifiedAreaRect" Value="{{0.525,0},{0.2,0},{0.95,0},{0.45,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.525,0},{0.15,0},{0.95,0},{0.35,0}}" />
                 <Window Type="TaharezLook/HorizontalScrollbar" Name="orxonox/BrightnessScrollbar" >
+                    <Property Name="Disabled" Value="true" />
                     <Property Name="PageSize" Value="0" />
                     <Property Name="StepSize" Value="0.1" />
@@ -58,6 +50,13 @@
                 </Window>
             </Window>
+            <Window Type="TaharezLook/Checkbox" Name="orxonox/FullscreenCheckbox" >
+                <Property Name="Text" Value="Fullscreen" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.525,0},{0.4,0},{0.95,0},{0.475,0}}" />
+                <Event Name="CheckStateChanged" Function="GraphicsMenu.GraphicsFullscreenCheckbox_clicked"/>
+            </Window>
             <Window Type="TaharezLook/StaticText" Name="orxonox/GraphicsInfo" >
-                <Property Name="Text" >Changes in graphics
+                <Property Name="Text" >
+Changes in graphics
 settings require
 a game restart.</Property>
@@ -67,5 +66,5 @@
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                 <Property Name="VertFormatting" Value="TopAligned" />
-                <Property Name="UnifiedAreaRect" Value="{{0.525,0},{0.55,0},{0.95,0},{0.9,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.525,0},{0.525,0},{0.95,0},{0.92,0}}" />
             </Window>
         </Window>
@@ -77,5 +76,5 @@
         </Window>
         <Window Type="TaharezLook/StaticText" Name="orxonox/GraphicsAvailable" >
-            <Property Name="Text" Value="All the graphics functions are not yet available." />
+            <Property Name="Text" Value="The brightness scrollbar is not yet available." />
             <Property Name="TextColours" Value="FFFF0000" />
             <Property Name="InheritsAlpha" Value="False" />
Index: code/branches/presentation2/data/gui/scripts/GraphicsMenu.lua
===================================================================
--- code/branches/presentation2/data/gui/scripts/GraphicsMenu.lua	(revision 6261)
+++ code/branches/presentation2/data/gui/scripts/GraphicsMenu.lua	(revision 6262)
@@ -13,6 +13,6 @@
 
 function P:init()
+    block = true
     file = orxonox.PathConfig:getConfigPathString() .. orxonox.getConfig("GraphicsManager", "ogreConfigFile_")
-    --file = "C:\\Games\\Orxonox\\menu\\build\\config\\Debug\\" .. orxonox.getConfig("GraphicsManager", "ogreConfigFile_")
     search_mode = 0
     f = io.open(file, "r")
@@ -32,4 +32,11 @@
                     fullscreen = false
                 end
+            end
+            if string.sub(line, 1, 10) == "Video Mode" then
+                if string.match(line, "@") == "@" then
+                    resolution = string.sub(line, 12, string.find(line, "@")-2)
+                else
+                    resolution = string.sub(line, 12)
+                end
                 break
             end
@@ -39,45 +46,78 @@
     local fullscreenwindow = tolua.cast(winMgr:getWindow("orxonox/FullscreenCheckbox"),"CEGUI::Checkbox")
     fullscreenwindow:setSelected(fullscreen)
-    dropdown = winMgr:getWindow("orxonox/ResolutionCombobox")
+    listboxwindow = winMgr:getWindow("orxonox/ResolutionListbox")
     local resolutionList = {}
-    table.insert(resolutionList, "800 x 600  (4:3)")
-    table.insert(resolutionList, "1024 x 640  (16:10)")
-    table.insert(resolutionList, "1024 x 768  (4:3)")
-    table.insert(resolutionList, "1280 x 800  (16:10)")
-    table.insert(resolutionList, "1280 x 960  (4:3)")
-    table.insert(resolutionList, "1440 x 900  (16:10)")
-    table.insert(resolutionList, "1600 x 1200  (4:3)")
-    table.insert(resolutionList, "1680 x 1050  (16:10)")
+    table.insert(resolutionList, "640 x 480")
+    table.insert(resolutionList, "720 x 480")
+    table.insert(resolutionList, "720 x 576")
+    table.insert(resolutionList, "800 x 480")
+    table.insert(resolutionList, "800 x 600")
+    table.insert(resolutionList, "1024 x 480")
+    table.insert(resolutionList, "1024 x 600")
+    table.insert(resolutionList, "1024 x 768")
+    table.insert(resolutionList, "1152 x 864")
+    table.insert(resolutionList, "1280 x 720")
+    table.insert(resolutionList, "1280 x 768")
+    table.insert(resolutionList, "1440 x 900")
     for k,v in pairs(resolutionList) do
         item = CEGUI.createListboxTextItem(v)        
         item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
-        CEGUI.toCombobox(dropdown):addItem(item)
-    end
-    local scrollbar_active = false
-end
-
-function P.GraphicsResolutionCombobox_changed(e)
-    -- resolution
-    debug("event: resolution")
-end
-
-function P.GraphicsBrightnessScrollbar_changed(e)
-    if scrollbar_active == false then
-        -- brightness
-        debug("event: brightness")
-    end
-end
-
-function P.GraphicsBrightnessScrollbar_started(e)
-    scrollbar_active = true
-end
-
-function P.GraphicsBrightnessScrollbar_ended(e)
-    -- brightness
-    debug("event: brightness")
+        CEGUI.toListbox(listboxwindow):addItem(item)
+    end
+    if resolution == "640 x 480" then
+        listboxwindow:setItemSelectState(0,true)
+    elseif resolution == "720 x 480" then
+        listboxwindow:setItemSelectState(1,true)
+    elseif resolution == "720 x 576" then
+        listboxwindow:setItemSelectState(2,true)
+    elseif resolution == "800 x 480" then
+        listboxwindow:setItemSelectState(3,true)
+    elseif resolution == "800 x 600" then
+        listboxwindow:setItemSelectState(4,true)
+    elseif resolution == "1024 x 480" then
+        listboxwindow:setItemSelectState(5,true)
+    elseif resolution == "1024 x 600" then
+        listboxwindow:setItemSelectState(6,true)
+    elseif resolution == "1024 x 768" then
+        listboxwindow:setItemSelectState(7,true)
+    elseif resolution == "1152 x 864" then
+        listboxwindow:setItemSelectState(8,true)
+    elseif resolution == "1280 x 720" then
+        listboxwindow:setItemSelectState(9,true)
+    elseif resolution == "1280 x 768" then
+        listboxwindow:setItemSelectState(10,true)
+    elseif resolution == "1440 x 900" then
+        listboxwindow:setItemSelectState(11,true)
+    end
     scrollbar_active = false
-end
-
-function P.GraphicsFullscreenCheckbox_clicked(e)
+    block = false
+end
+
+function P.GraphicsResolutionListbox_changed(e)
+    if listboxwindow:isItemSelected(0) then
+        resolution = "640 x 480"
+    elseif listboxwindow:isItemSelected(1) then
+        resolution = "720 x 480"
+    elseif listboxwindow:isItemSelected(2) then
+        resolution = "720 x 576"
+    elseif listboxwindow:isItemSelected(3) then
+        resolution = "800 x 480"
+    elseif listboxwindow:isItemSelected(4) then
+        resolution = "800 x 600"
+    elseif listboxwindow:isItemSelected(5) then
+        resolution = "1024 x 480"
+    elseif listboxwindow:isItemSelected(6) then
+        resolution = "1024 x 600"
+    elseif listboxwindow:isItemSelected(7) then
+        resolution = "1024 x 768"
+    elseif listboxwindow:isItemSelected(8) then
+        resolution = "1152 x 864"
+    elseif listboxwindow:isItemSelected(9) then
+        resolution = "1280 x 720"
+    elseif listboxwindow:isItemSelected(10) then
+        resolution = "1280 x 768"
+    elseif listboxwindow:isItemSelected(11) then
+        resolution = "1440 x 900"
+    end
     search_mode = 0
     f = io.open(file, "r")
@@ -92,13 +132,10 @@
         end
         if search_mode == 1 then
-            if string.sub(line, 1, 11) == "Full Screen" then
-                if fullscreen == true then
-                    line = "Full Screen=No"
-                    fullscreen = false
+            if string.sub(line, 1, 10) == "Video Mode" then
+                if string.match(line, "@") == "@" then
+                    line = "Video Mode=" .. resolution .. string.sub(line, string.find(line, "@")-1)
                 else
-                    line = "Full Screen=Yes"
-                    fullscreen = true
-                end
-                debug(line)
+                    line = "Video Mode=" .. resolution
+                end
                 search_mode = 2
             end
@@ -112,4 +149,55 @@
 end
 
+function P.GraphicsBrightnessScrollbar_changed(e)
+    if scrollbar_active == false then
+        -- brightness
+        debug("event: brightness")
+    end
+end
+
+function P.GraphicsBrightnessScrollbar_started(e)
+    scrollbar_active = true
+end
+
+function P.GraphicsBrightnessScrollbar_ended(e)
+    -- brightness
+    debug("event: brightness")
+    scrollbar_active = false
+end
+
+function P.GraphicsFullscreenCheckbox_clicked(e)
+    if block == false then
+        search_mode = 0
+        f = io.open(file, "r")
+        firstline = f:read("*line")
+        text = firstline .. "\n"
+        rendersystem = string.sub(firstline, 15)
+        for line in f:lines() do
+            if search_mode == 0 then
+                if string.find(line, rendersystem) ~= nil then
+                    search_mode = 1
+                end
+            end
+            if search_mode == 1 then
+                if string.sub(line, 1, 11) == "Full Screen" then
+                    if fullscreen == true then
+                        line = "Full Screen=No"
+                        fullscreen = false
+                    else
+                        line = "Full Screen=Yes"
+                        fullscreen = true
+                    end
+                    search_mode = 2
+                end
+            end
+            text = text .. line .. "\n"
+        end
+        f:close()
+        f = io.open(file, "w")
+        f:write(text)
+        f:close()
+    end
+end
+
 function P.GraphicsBackButton_clicked(e)
     hideGUI(P.filename)
