Index: trunk/src/lib/graphics/light.cc
===================================================================
--- trunk/src/lib/graphics/light.cc	(revision 8740)
+++ trunk/src/lib/graphics/light.cc	(revision 8742)
@@ -27,20 +27,18 @@
 #include "debug.h"
 
-using namespace std;
-
 CREATE_FACTORY(Light, CL_LIGHT);
 
 //! Definition of the Lights and their Names
 int lightsV[] =
-{
-                  GL_LIGHT0,
-                  GL_LIGHT1,
-                  GL_LIGHT2,
-                  GL_LIGHT3,
-                  GL_LIGHT4,
-                  GL_LIGHT5,
-                  GL_LIGHT6,
-                  GL_LIGHT7
-};
+  {
+    GL_LIGHT0,
+    GL_LIGHT1,
+    GL_LIGHT2,
+    GL_LIGHT3,
+    GL_LIGHT4,
+    GL_LIGHT5,
+    GL_LIGHT6,
+    GL_LIGHT7
+  };
 
 /**
@@ -49,5 +47,5 @@
   @todo what to do, if no Light-Slots are open anymore ???
  */
- Light::Light(const TiXmlElement* root)
+Light::Light(const TiXmlElement* root)
 {
   PRINTF(4)("initializing Light number %d.\n", this->lightNumber);
@@ -89,17 +87,17 @@
 
   LoadParam(root, "diffuse-color", this, Light, setDiffuseColor)
-      .describe("sets the diffuse color of the Light (red [0-1], green [0-1], blue [0-1])");
+  .describe("sets the diffuse color of the Light (red [0-1], green [0-1], blue [0-1])");
 
   LoadParam(root, "specular-color", this, Light, setSpecularColor)
-      .describe("sets the specular color of the Light (red [0-1], green [0-1], blue [0-1])");
+  .describe("sets the specular color of the Light (red [0-1], green [0-1], blue [0-1])");
 
   LoadParam(root, "attenuation", this, Light, setAttenuation)
-      .describe("sets the Attenuation of the LightSource (constant Factor, linear Factor, quadratic Factor).");
+  .describe("sets the Attenuation of the LightSource (constant Factor, linear Factor, quadratic Factor).");
 
   LoadParam(root, "spot-direction", this, Light, setSpotDirection)
-      .describe("sets the Direction of the Spot");
+  .describe("sets the Direction of the Spot");
 
   LoadParam(root, "spot-cutoff", this, Light, setSpotCutoff)
-      .describe("the cuttoff of the Spotlight");
+  .describe("the cuttoff of the Spotlight");
 }
 
@@ -263,8 +261,8 @@
 {
   LoadParamXML(root, "Lights", this, LightManager, loadLights)
-      .describe("an XML-Element to load lights from.");
+  .describe("an XML-Element to load lights from.");
 
   LoadParam(root, "ambient-color", this, LightManager, setAmbientColor)
-      .describe("sets the ambient Color of the Environmental Light");
+  .describe("sets the ambient Color of the Environmental Light");
 }
 
@@ -310,8 +308,8 @@
   for (int i = 0; i < NUMBEROFLIGHTS; i++)
     if (!this->lights[i])
-  {
-    this->lights[i]=light;
-    return i;
-  }
+    {
+      this->lights[i]=light;
+      return i;
+    }
   PRINTF(1)("no more light slots availiable. All %d already taken\n", NUMBEROFLIGHTS);
   return -1;
@@ -351,5 +349,5 @@
 void LightManager::draw() const
 {
- PRINTF(4)("Drawing the Lights\n");
+  PRINTF(4)("Drawing the Lights\n");
   for (int i = 0; i < NUMBEROFLIGHTS; i++)
     if (this->lights[i] != NULL)
@@ -372,7 +370,7 @@
   for (int i = 0; i < NUMBEROFLIGHTS; i++)
     if (this->lights[i])
-      {
-        this->lights[i]->debug();
-      }
+    {
+      this->lights[i]->debug();
+    }
   PRINT(0)("-----------------------------LM-\n");
 }
Index: trunk/src/lib/gui/gl/glgui_handler.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_handler.cc	(revision 8740)
+++ trunk/src/lib/gui/gl/glgui_handler.cc	(revision 8742)
@@ -135,5 +135,5 @@
         }
 
-        if (dynamic_cast<GLGuiWidget*>(*it)->selectable())
+        if (dynamic_cast<GLGuiWidget*>(*it)->selectable() && dynamic_cast<GLGuiWidget*>(*it)->isVisible())
         {
           dynamic_cast<GLGuiWidget*>(*it)->select();
@@ -183,5 +183,5 @@
         }
 
-        if (dynamic_cast<GLGuiWidget*>(*it)->selectable())
+        if (dynamic_cast<GLGuiWidget*>(*it)->selectable() && dynamic_cast<GLGuiWidget*>(*it)->isVisible())
         {
           dynamic_cast<GLGuiWidget*>(*it)->select();
