Index: trunk/src/lib/gui/gl/Makefile.am
===================================================================
--- trunk/src/lib/gui/gl/Makefile.am	(revision 8518)
+++ trunk/src/lib/gui/gl/Makefile.am	(revision 8619)
@@ -12,5 +12,4 @@
 		glmenu/glmenu_imagescreen.cc \
 		\
-		glgui_style.cc \
 		glgui_handler.cc \
 		signal_connector.cc \
@@ -27,4 +26,5 @@
 		glgui_inputline.cc \
 		glgui_textfield.cc \
+		glgui_table.cc \
 		glgui_image.cc \
 		glgui_window.cc \
@@ -37,5 +37,4 @@
 		glmenu/glmenu_imagescreen.h \
 		\
-		glgui_style.h \
 		signal_connector.h \
 		glgui.h \
@@ -54,4 +53,5 @@
 		glgui_inputline.h \
 		glgui_textfield.h \
+		glgui_table.h \
 		glgui_image.h \
 		glgui_window.h \
Index: trunk/src/lib/gui/gl/glgui.h
===================================================================
--- trunk/src/lib/gui/gl/glgui.h	(revision 8518)
+++ trunk/src/lib/gui/gl/glgui.h	(revision 8619)
@@ -16,5 +16,4 @@
 #include "glgui_button.h"
 #include "glgui_checkbutton.h"
-//#include "glgui_colorselector.h"
 #include "glgui_pushbutton.h"
 #include "glgui_slider.h"
@@ -22,4 +21,5 @@
 #include "glgui_inputline.h"
 #include "glgui_textfield.h"
+#include "glgui_table.h"
 #include "glgui_image.h"
 
Index: trunk/src/lib/gui/gl/glgui_box.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_box.cc	(revision 8518)
+++ trunk/src/lib/gui/gl/glgui_box.cc	(revision 8619)
@@ -110,5 +110,5 @@
     if (orientation() == OrxGui::Vertical)
     {
-      float height = this->borderTop();
+      float height = borderTop();
       float width = 0.0f;
       std::vector<GLGuiWidget*>::iterator widget;
@@ -117,11 +117,11 @@
       for (widget = this->children.begin(); widget != this->children.end(); ++widget)
       {
-        (*widget)->setRelCoor2D(this->borderLeft(), height);
+        (*widget)->setRelCoor2D(borderLeft(), height);
         height += (*widget)->getSizeY2D();
         width = fmax(width, (*widget)->getSizeX2D());
       }
 
-      width += this->borderLeft() + this->borderRight();
-      height += this->borderBottom(); /* *2 done further up */
+      width += borderLeft() + borderRight();
+      height += borderBottom(); /* *2 done further up */
 
       printf("%f %f\n", width, height);
@@ -130,6 +130,6 @@
     else
     {
-      float height = this->borderTop();
-      float width = this->borderLeft();
+      float height = borderTop();
+      float width = borderLeft();
       std::vector<GLGuiWidget*>::iterator widget;
 
@@ -137,11 +137,11 @@
       for (widget = this->children.begin(); widget != this->children.end(); ++widget)
       {
-        (*widget)->setRelCoor2D(width, this->borderTop());
+        (*widget)->setRelCoor2D(width, borderTop());
         height = fmax(height, (*widget)->getSizeY2D());
         width += (*widget)->getSizeX2D();
       }
 
-      width += this->borderRight() ;
-      height += this->borderBottom(); /* *2 done further up */
+      width += borderRight() ;
+      height += borderBottom(); /* *2 done further up */
 
       printf("%f %f\n", width, height);
Index: trunk/src/lib/gui/gl/glgui_button.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_button.cc	(revision 8518)
+++ trunk/src/lib/gui/gl/glgui_button.cc	(revision 8619)
@@ -55,5 +55,5 @@
 
     this->_label.setFont("fonts/final_frontier.ttf", 20);
-    this->_label.setColor(this->frontColor());
+    this->_label.setColor(this->foregroundColor() );
 
     this->_label.setParent2D(this);
@@ -71,5 +71,5 @@
   void GLGuiButton::updateFrontColor()
   {
-    this->_label.setColor(this->frontColor());
+    this->_label.setColor(this->foregroundColor());
   }
 
Index: trunk/src/lib/gui/gl/glgui_button.h
===================================================================
--- trunk/src/lib/gui/gl/glgui_button.h	(revision 8518)
+++ trunk/src/lib/gui/gl/glgui_button.h	(revision 8619)
@@ -36,5 +36,5 @@
       virtual ~GLGuiButton();
 
-      const std::string& label() const { return this->_label.getText(); };
+      const std::string& label() const { return this->_label.text(); };
       void setLabel(const std::string& label);
 
Index: trunk/src/lib/gui/gl/glgui_checkbutton.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_checkbutton.cc	(revision 8518)
+++ trunk/src/lib/gui/gl/glgui_checkbutton.cc	(revision 8619)
@@ -96,8 +96,7 @@
 //     this->frontMaterial().select();
 //     this->drawRect(this->frontRect());
-
     if (this->bActive)
     {
-      glColor3fv( &this->frontColor()[0]);
+      glColor3fv( &this->foregroundColor()[0]);
       this->drawRect(this->_checkBox);
 
@@ -124,5 +123,5 @@
     else
     {
-      glColor3fv( &this->frontColor()[0]);
+      glColor3fv( &this->foregroundColor()[0]);
       this->drawRect(this->_checkBox);
     }
Index: trunk/src/lib/gui/gl/glgui_container.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_container.cc	(revision 8518)
+++ trunk/src/lib/gui/gl/glgui_container.cc	(revision 8619)
@@ -43,4 +43,6 @@
     this->setClassID(CL_GLGUI_CONTAINER, "GLGuiContainer");
 
+    this->setBackgroundTexture("gui_container_background.png");
+
   }
 
Index: trunk/src/lib/gui/gl/glgui_cursor.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_cursor.cc	(revision 8518)
+++ trunk/src/lib/gui/gl/glgui_cursor.cc	(revision 8619)
@@ -57,11 +57,11 @@
     this->setClassID(CL_GLGUI_CURSOR, "GLGuiCursor");
 
-    this->backMaterial().setDiffuse(1.0,0.0,0.0);
-    this->backMaterial().setDiffuseMap("cursor.png");
-    this->backMaterial().setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    this->setBackgroundColor(Color(1.0, 1.0, 1.0, 1.0));
+    this->setBackgroundTexture("cursor.png");
     this->setSize2D(50, 50);
     this->setAbsCoor2D(100, 100);
     this->setLayer(E2D_LAYER_ABOVE_ALL);
     this->color = 0.0f;
+    this->frameNumber = 0.0f;
 
     this->resize();
@@ -79,5 +79,5 @@
   bool GLGuiCursor::loadTextureSequence(const std::string& imageNameSubstitue, unsigned int from, unsigned int to)
   {
-    this->backMaterial().setDiffuse(1.0, 1.0, 1.0);
+    //this->background().setDiffuse(1.0, 1.0, 1.0);
     return this->seq.loadImageSeries(imageNameSubstitue, from, to);
   }
@@ -97,5 +97,7 @@
         this->color -= 360.0;
       Vector color =  Color::HSVtoRGB(Vector(this->color, 1.0, 1.0));
-      this->backMaterial().setDiffuse(color.x, color.y, color.z);
+      //this->setBackgroundColor(color.x, color.y, color.z);
+      /// FIXME
+
     }
     //if (this->movement != Vector2D())
@@ -125,5 +127,5 @@
     this->beginDraw();
 
-    this->backMaterial().select();
+    this->background().select();
     if (!this->seq.empty())
       glBindTexture(GL_TEXTURE_2D, this->seq.getFrameTexture((int)frameNumber));
Index: trunk/src/lib/gui/gl/glgui_defs.h
===================================================================
--- trunk/src/lib/gui/gl/glgui_defs.h	(revision 8518)
+++ trunk/src/lib/gui/gl/glgui_defs.h	(revision 8619)
@@ -22,4 +22,5 @@
   } Orientation;
 
+  //! Names of Orientations
   const std::string OrientationString[] = {
     "Horizontal",
@@ -30,5 +31,5 @@
   typedef enum {
     Normal,           //!< Normal state of the GUI's Widgets.
-    Active,           //!< If the widget is Active.
+    Focused,           //!< If the widget is Active.
     Selected,         //!< If the Widget is Selected.
     Insensitive       //!< If the Widget is insensitive.
@@ -38,8 +39,9 @@
 #define GLGUI_DEFAULT_STYLE OrxGui::Normal
 
+//! names of the States.
   const std::string StateString[] =
     {
       "Normal",
-      "Active",
+      "Focused",
       "Selected",
       "Insensitive"
@@ -54,4 +56,5 @@
     } FeaturePosition;
 
+    //! Names of Feature-Positions
     const std::string FeaturePositionString[] =
     {
Index: trunk/src/lib/gui/gl/glgui_image.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_image.cc	(revision 8518)
+++ trunk/src/lib/gui/gl/glgui_image.cc	(revision 8619)
@@ -47,4 +47,5 @@
     this->setClassID(CL_GLGUI_IMAGE, "GLGuiImage");
 
+    this->setForegroundColor(Color(1,1,1,1));
     this->_imageMaterial.setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 
@@ -76,10 +77,10 @@
   void GLGuiImage::updateFrontColor()
   {
-    this->_imageMaterial.setDiffuseColor(this->frontColor());
+    this->_imageMaterial.setDiffuseColor(foregroundColor());
   }
 
   void GLGuiImage::resize()
   {
-    this->_imagePlane.setTopLeft(this->borderLeft(), this->borderTop());
+    this->_imagePlane.setTopLeft(borderLeft(), borderTop());
     this->_imagePlane.setSize(this->getSizeX2D() - (borderLeft() + borderRight()), this->getSizeY2D() - (borderTop() + borderBottom()) );
     GLGuiWidget::resize();
Index: trunk/src/lib/gui/gl/glgui_inputline.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_inputline.cc	(revision 8518)
+++ trunk/src/lib/gui/gl/glgui_inputline.cc	(revision 8619)
@@ -52,7 +52,13 @@
     this->_text.setRelCoor2D(4,4);
     this->_text.setFont("fonts/final_frontier.ttf", 20);
-    this->_text.setColor(this->frontColor());
+    this->_text.setLineWidth(400);
+    this->_text.setDotsPosition(LimitedWidthText::Begin);
+    this->_text.setColor(foregroundColor());
     this->_text.setVisibility(false);
     this->resize();
+
+    this->delayNext = 0.0;
+    this->pressedKey = SDLK_FIRST;
+    this->pressedKeyName = SDLK_FIRST;
 
   }
@@ -116,6 +122,5 @@
     this->resize();
     this->setFrontColor(Color(1,1,1,1), true);
-    this->setFrontColor(Color(0,1,0,1));
-    emit(this->textChanged(this->_text.getText()));
+    emit(this->textChanged(this->_text.text()));
   }
 
@@ -139,5 +144,5 @@
   void GLGuiInputLine::pushEnter()
   {
-    emit(this->enterPushed(this->_text.getText()));
+    emit(this->enterPushed(this->_text.text()));
     if (this->_clearOnEnter)
       this->clear();
@@ -197,14 +202,14 @@
   void GLGuiInputLine::resize()
   {
-    this->_text.setRelCoor2D(this->borderLeft(), this->borderTop());
+    this->_text.setRelCoor2D(borderLeft(), borderTop());
     this->setSize2D( this->_text.getSize2D() + Vector2D(borderLeft() + borderRight(), borderTop() + borderBottom()));
     GLGuiWidget::resize();
-/*    this->frontRect().setTopLeft(borderLeft(), borderTop());
-    this->frontRect().setSize(this->getSize2D() - Vector2D(borderLeft() + borderRight(), borderTop() + borderBottom()));*/
+    /*    this->frontRect().setTopLeft(borderLeft(), borderTop());
+        this->frontRect().setSize(this->getSize2D() - Vector2D(borderLeft() + borderRight(), borderTop() + borderBottom()));*/
   }
 
   void GLGuiInputLine::updateFrontColor()
   {
-    this->_text.setColor(this->frontColor());
+    this->_text.setColor(foregroundColor());
   }
 
@@ -228,5 +233,5 @@
     if (this->delayNext > 0.0)
       this->delayNext -= dt;
-        else if (this->pressedKey != SDLK_FIRST )
+    else if (this->pressedKey != SDLK_FIRST )
     {
       this->delayNext = GLGuiInputLine::repeatRate;
@@ -237,8 +242,8 @@
           break;
         default:
-        {
-          if (likely(this->pressedKey < 127))
-            this->appendCharacter(this->pressedKeyName);
-        }
+          {
+            if (likely(this->pressedKey < 127))
+              this->appendCharacter(this->pressedKeyName);
+          }
       }
     }
@@ -255,6 +260,6 @@
     GLGuiWidget::draw();
 
-//     this->frontMaterial().select();
-//     GLGuiWidget::drawRect(this->frontRect());
+    //     this->frontMaterial().select();
+    //     GLGuiWidget::drawRect(this->frontRect());
 
     this->endDraw();
Index: trunk/src/lib/gui/gl/glgui_inputline.h
===================================================================
--- trunk/src/lib/gui/gl/glgui_inputline.h	(revision 8518)
+++ trunk/src/lib/gui/gl/glgui_inputline.h	(revision 8619)
@@ -9,5 +9,5 @@
 
 #include "glgui_widget.h"
-#include "text.h"
+#include "limited_width_text.h"
 #include "event.h"
 
@@ -32,5 +32,5 @@
 
     /** @returns the text of the inputLine */
-    const std::string& _getText() const { return this->_text.getText(); };
+    const std::string& _getText() const { return this->_text.text(); };
 
     void setText(const std::string& text);
@@ -66,5 +66,5 @@
 
   private:
-    Text                    _text;            //!< The Text to display inside of the InputLine.
+    LimitedWidthText        _text;            //!< The Text to display inside of the InputLine.
     bool                    _clearOnEnter;    //!< Clear on Enter
 
Index: trunk/src/lib/gui/gl/glgui_slider.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_slider.cc	(revision 8518)
+++ trunk/src/lib/gui/gl/glgui_slider.cc	(revision 8619)
@@ -74,5 +74,5 @@
     else
       this->_value = value;
-    this->_handle.setCenter(this->sliderPosition(), this->borderTop() + (this->getSizeY2D() - this->borderTop() - borderBottom()) / 2.0);
+    this->_handle.setCenter(this->sliderPosition(), borderTop() + (this->getSizeY2D() - borderTop() - borderBottom()) / 2.0);
 
     emit(valueChanged(this->_value));
@@ -165,5 +165,5 @@
 //    this->frontRect().setTopLeft(this->borderLeft(), this->getSizeY2D()/2.0 - 2.0);
 //    this->frontRect().setSize(this->getSizeX2D() - borderLeft() - borderRight(), 4.0);
-    this->_slider.setTopLeft(this->borderLeft(), this->getSizeY2D() / 2.0 -2.0);
+    this->_slider.setTopLeft(borderLeft(), this->getSizeY2D() / 2.0 -2.0);
     this->_slider.setSize(this->getSizeX2D() - borderLeft() - borderRight(), 4.0);
     this->_handle.setSize(this->_sliderWidth, this->getSizeY2D() - borderTop() - borderBottom());
@@ -211,6 +211,6 @@
   {
     return (this->_value - this->_minValue)/( this->_maxValue - this->_minValue) *
-           (this->getSizeX2D() - (borderLeft() + borderRight() + 2.0*_sliderWidth)) +
-           (borderLeft() +_sliderWidth);
+        (this->getSizeX2D() - (borderLeft() + borderRight() + 2.0*_sliderWidth)) +
+        (borderLeft() +_sliderWidth);
   }
 
@@ -239,5 +239,5 @@
     GLGuiWidget::draw();
 
-    glColor4fv(&this->frontColor()[0]);
+    glColor4fv(&this->foregroundColor()[0]);
     this->drawRect(this->_slider);
     this->drawRect(this->_handle);
Index: trunk/src/lib/gui/gl/glgui_style.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_style.cc	(revision 8518)
+++ 	(revision )
@@ -1,222 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: ...
-   co-programmer: ...
-*/
-
-//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
-
-#include "glgui_style.h"
-
-#include "loading/load_param.h"
-
-namespace OrxGui
-{
-
-
-  /**
-   * @brief standard constructor
-  */
-  GLGuiStyle::GLGuiStyle (const TiXmlElement* root)
-  {
-    _font = NULL;
-    this->reset();
-
-
-    if (root != NULL)
-      this->loadParams(root);
-
-  }
-
-
-  /**
-   * @brief standard deconstructor
-   */
-  GLGuiStyle::~GLGuiStyle ()
-  {
-    // delete what has to be deleted here
-  }
-
-  void GLGuiStyle::reset()
-  {
-    this->setBorderLeft(1.0);
-    this->setBorderRight(1.0);
-    this->setBorderTop(1.0);
-    this->setBorderBottom(1.0);
-
-    this->setTextSize(20.0);
-    this->setBackgroundColor(1.0);
-    this->setForegroundColor(1.0);
-
-    this->setFeaturePosition(FeatureLeft);
-    this->setFont(NULL);
-
-    this->setAnimated(true);
-    this->setAnimatedStateChanges(true);
-  }
-
-  void GLGuiStyle::loadParams(const TiXmlElement* root)
-  {}
-
-  void GLGuiStyle::setBorderLeft(float value)
-  {
-    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
-      setBorderLeft(value, (OrxGui::State)i);
-  }
-
-  void GLGuiStyle::setBorderLeft(float value, OrxGui::State state)
-  {
-    _style[state]._borderLeft = value;
-  }
-
-  void GLGuiStyle::setBorderLeftS(float value, const std::string& state)
-  {
-  }
-
-
-  void GLGuiStyle::setBorderRight(float value)
-  {
-    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
-      setBorderRight(value, (OrxGui::State)i);
-  }
-
-  void GLGuiStyle::setBorderRight(float value, OrxGui::State state)
-  {
-    _style[state]._borderRight = value;
-  }
-
-  void GLGuiStyle::setBorderRightS(float value, const std::string& state)
-  {}
-
-
-  void GLGuiStyle::setBorderTop(float value)
-  {
-    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
-      setBorderTop(value, (OrxGui::State)i);
-  }
-
-  void GLGuiStyle::setBorderTop(float value, OrxGui::State state)
-  {
-    _style[state]._borderTop = value;
-  }
-
-  void GLGuiStyle::setBorderTopS(float value, const std::string& state)
-  {}
-
-
-  void GLGuiStyle::setBorderBottom(float value)
-  {
-    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
-      setBorderBottom(value, (OrxGui::State)i);
-  }
-
-  void GLGuiStyle::setBorderBottom(float value, OrxGui::State state)
-  {
-    _style[state]._borderBottom = value;
-  }
-
-  void GLGuiStyle::setBorderBottomS(float value, const std::string& state)
-  {}
-
-
-  void GLGuiStyle::setTextSize(float value)
-  {
-    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
-      setTextSize(value, (OrxGui::State)i);
-  }
-
-  void GLGuiStyle::setTextSize(float value, OrxGui::State state)
-  {
-    _style[state]._textSize = value;
-  }
-
-  void GLGuiStyle::setTextSizeS(float value, const std::string& state)
-  {}
-
-
-  void GLGuiStyle::setBackgroundColor(const Color& color)
-  {
-    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
-      setBackgroundColor(color, (OrxGui::State)i);
-  }
-
-  void GLGuiStyle::setBackgroundColor(const Color& color, OrxGui::State state)
-  {
-    _style[state]._backgroundColor = color;
-  }
-
-  void GLGuiStyle::setBackgroundColorS(float r, float g, float b, float a, const std::string& state)
-  {}
-
-
-  void GLGuiStyle::setBackgroundTexture(const Texture& texture)
-  {
-    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
-      setBackgroundTexture(texture, (OrxGui::State)i);
-  }
-
-  void GLGuiStyle::setBackgroundTexture(const Texture& texture, OrxGui::State state)
-  {
-    _style[state]._backgroundTexture = texture;
-  }
-
-  void GLGuiStyle::setBackgroundTexture(const std::string& textureName, const std::string& state)
-  {}
-
-
-  void GLGuiStyle::setForegroundColor(const Color& color)
-  {
-    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
-      setForegroundColor(color, (OrxGui::State)i);
-  }
-
-  void GLGuiStyle::setForegroundColor(const Color& color, OrxGui::State state)
-  {
-    _style[state]._foregroundColor = color;
-  }
-
-  void GLGuiStyle::setForegroundColorS(float r, float g, float b, float a, const std::string& state)
-  {}
-
-
-
-  void GLGuiStyle::setFeaturePosition(FeaturePosition featurePosition)
-  {
-    this->_featurePosition = featurePosition;
-  }
-
-  void GLGuiStyle::setFeaturePosition(const std::string& featurePosition)
-  {}
-
-
-  void GLGuiStyle::setFont(Font* font)
-  {
-    this->_font = font;
-  }
-
-  void GLGuiStyle::setFont(const std::string& fontName)
-  {
-    //this->font = new Font(fontName);
-  }
-
-
-  void GLGuiStyle::setAnimated(bool animated)
-  {
-    this->_animated = animated;
-  }
-
-  void GLGuiStyle::setAnimatedStateChanges(bool animated)
-  {
-    this->_animatedStateChanges = animated;
-  }
-
-}
Index: trunk/src/lib/gui/gl/glgui_style.h
===================================================================
--- trunk/src/lib/gui/gl/glgui_style.h	(revision 8518)
+++ 	(revision )
@@ -1,118 +1,0 @@
-/*!
- * @file glgui_style.h
- * @brief Definition of the OpenGL-GUI Style of a Class.
-*/
-
-#ifndef _GLGUI_STYLE_H
-#define _GLGUI_STYLE_H
-
-#include "glgui_defs.h"
-
-#include "font.h"
-#include "texture.h"
-#include "color.h"
-
-class TiXmlElement;
-
-namespace OrxGui
-{
-  //! A class for Defining Styles to the opengl-gui.
-  class GLGuiStyle
-  {
-  public:
-    GLGuiStyle(const TiXmlElement* root = NULL);
-    virtual ~GLGuiStyle();
-
-
-    /// Retrieve
-    inline float borderLeft(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._borderLeft; }
-    inline float borderRight(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._borderRight; }
-    inline float borderTop(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._borderTop; }
-    inline float borderBottom(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._borderBottom; }
-    inline float textSize(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._textSize; }
-    inline const Color& backgroundColor(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._backgroundColor; }
-    inline const Texture& backgrorundTexture(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._backgroundTexture; }
-    inline const Color& foregroundColor(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._foregroundColor; }
-
-    inline FeaturePosition featurePosition() const { return _featurePosition; }
-    inline const Font* const font() const { return _font; }
-    inline bool animated() const { return _animated; }
-    inline bool animatedStateChanges() const { return _animatedStateChanges; }
-
-
-
-    /// SETUP
-    void reset();
-    void loadParams(const TiXmlElement* root);
-
-    void setBorderLeft(float value);
-    void setBorderLeft(float value, OrxGui::State state);
-    void setBorderLeftS(float value, const std::string& state);
-
-    void setBorderRight(float value);
-    void setBorderRight(float value, OrxGui::State state);
-    void setBorderRightS(float value, const std::string& state);
-
-    void setBorderTop(float value);
-    void setBorderTop(float value, OrxGui::State state);
-    void setBorderTopS(float value, const std::string& state);
-
-    void setBorderBottom(float value);
-    void setBorderBottom(float value, OrxGui::State state);
-    void setBorderBottomS(float value, const std::string& state);
-
-    void setTextSize(float value);
-    void setTextSize(float value, OrxGui::State state);
-    void setTextSizeS(float value, const std::string& state);
-
-    void setBackgroundColor(const Color& color);
-    void setBackgroundColor(const Color& color, OrxGui::State state);
-    void setBackgroundColorS(float r, float g, float b, float a, const std::string& state);
-
-    void setBackgroundTexture(const Texture& texture);
-    void setBackgroundTexture(const Texture& texture, OrxGui::State state);
-    void setBackgroundTexture(const std::string& textureName, const std::string& state);
-
-    void setForegroundColor(const Color& color);
-    void setForegroundColor(const Color& color, OrxGui::State state);
-    void setForegroundColorS(float r, float g, float b, float a, const std::string& state);
-
-
-    void setFeaturePosition(FeaturePosition featurePosition);
-    void setFeaturePosition(const std::string& featurePosition);
-
-    void setFont(Font* font);
-    void setFont(const std::string& fontName);
-
-    void setAnimated(bool animated);
-    void setAnimatedStateChanges(bool animated);
-
-  private:
-    typedef struct
-    {
-      float             _borderLeft;           //!< The Distance to the left Border of the widget, before any internal Element starts.
-      float             _borderRight;          //!< The Distance to the right Border of the widget, before any internal Element starts.
-      float             _borderTop;            //!< The Distance to the top Border of the widget, before any internal Element starts
-      float             _borderBottom;         //!< The Distance to the bottom Border of the widget, before any internal Element starts
-
-      float             _textSize;             //!< The TextSize of the Widget.
-
-      Color             _backgroundColor;      //!< The BackgroundColor of the Widget.
-      Texture           _backgroundTexture;    //!< The BackgroundTexture of the Widget.
-
-      Color             _foregroundColor;      //!< The foregroundColor of the Widget.
-    }
-    StatedStyle;
-
-
-    StatedStyle         _style[GLGUI_STATE_COUNT];
-
-    FeaturePosition     _featurePosition;      //!< The Position a Feature will be layed at (checkbox(box), slider(text),...)
-    Font*               _font;                 //!< The Font used in the current Widget.
-
-
-    bool                _animated;             //!< If the Widget is animated (Texture might be an AnimatedTexture.)
-    bool                _animatedStateChanges; //!< If the Transitions between States are Animated automatically.
-  };
-}
-#endif /* _GLGUI_STYLE_H */
Index: trunk/src/lib/gui/gl/glgui_table.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_table.cc	(revision 8619)
+++ trunk/src/lib/gui/gl/glgui_table.cc	(revision 8619)
@@ -0,0 +1,266 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GUI
+
+#include "glgui_table.h"
+#include "debug.h"
+
+namespace OrxGui
+{
+  /**
+   * @brief standard constructor
+   */
+  GLGuiTable::GLGuiTable (unsigned int rows, unsigned int columns)
+  {
+    this->init();
+    this->setRowCount(rows);
+    this->setColumnCount(columns);
+  }
+
+
+  /**
+   * @brief standard deconstructor
+   */
+  GLGuiTable::~GLGuiTable()
+  {}
+
+  /**
+   * @brief initializes the GUI-element
+   */
+  void GLGuiTable::init()
+  {
+    this->setClassID(CL_GLGUI_TABLE, "GLGuiTable");
+
+    this->setFocusable(true);
+    this->setClickable(true);
+
+    this->resize();
+  }
+
+
+  void GLGuiTable::setRowCount(unsigned int rowCount)
+  {
+
+    unsigned int currentRowCount = this->rowCount();
+    this->_entries.resize(rowCount);
+    for (unsigned int i = currentRowCount; i < this->rowCount(); ++i)
+    {
+      this->_entries[i].resize(columnCount(), LimitedWidthText("fonts/final_frontier.ttf", 20));
+      for (unsigned int j = 0; j < columnCount(); ++j)
+        this->applyTextSettings(i, j, &this->_entries[i][j]);
+    }
+
+    assert(this->checkIntegrity());
+    this->debug();
+
+    if (!this->isVisible())
+      this->hiding();
+  }
+
+  void GLGuiTable::setColumnCount(unsigned int columnCount)
+  {
+    unsigned int i;
+    unsigned int currentColumnCount = this->columnCount();
+
+    // setup Headers.
+    this->_headers.resize(columnCount, LimitedWidthText("fonts/final_frontier.ttf", 20));
+    for (i = currentColumnCount; i < columnCount; ++i)
+      this->applyTextSettings(0, i, &this->_headers[i]);
+
+    for (i = 0; i < rowCount(); i++)
+    {
+      this->_entries[i].resize(columnCount, LimitedWidthText("fonts/final_frontier.ttf", 20));
+      for (unsigned int j = currentColumnCount; j < columnCount; ++j)
+        this->applyTextSettings(i, j, &this->_entries[i][j]);
+
+    }
+    assert(this->checkIntegrity());
+    this->debug();
+
+    if (!this->isVisible())
+      this->hiding();
+  }
+
+
+
+
+  void GLGuiTable::setHeader(unsigned int number, const std::string& headerName)
+  {
+    if (number >= this->columnCount())
+      this->setColumnCount(number + 1);
+    this->_headers[number].setText(headerName);
+  }
+
+  void GLGuiTable::setHeader(const std::vector<std::string>& headerNames)
+  {
+    for (unsigned int i = 0; i < headerNames.size(); ++i)
+      this->setHeader(i, headerNames[i]);
+  }
+
+  void GLGuiTable::setEntry(unsigned int column, unsigned int row, const std::string& name)
+  {
+    if (column >= this->columnCount() )
+      this->setColumnCount(column + 1);
+    if (row >= this->rowCount() )
+      this->setRowCount(row + 1);
+    this->_entries[row][column].setText(name);
+  }
+
+  void GLGuiTable::setColumnWidth(unsigned int column, float size)
+  {
+    this->_headers[column].setLineWidth(size);
+    for (unsigned int i = 0; i < this->rowCount(); ++i)
+      this->_entries[i][column].setLineWidth(size);
+
+  }
+
+  /// TODO.
+  void GLGuiTable::setRowHeight(unsigned int row, unsigned int size)
+{}
+
+
+
+
+  /**
+   * removes the focus from this Widget.
+   */
+  void GLGuiTable::removedFocus()
+  {
+    GLGuiWidget::removedFocus();
+  }
+
+
+
+  /**
+   * @brief Processes an Event.
+   * @param event The event to be processed
+   * @return true if the event was catched.
+   */
+  bool GLGuiTable::processEvent(const Event& event)
+  {
+    return false;
+  }
+
+
+  /**
+   * @brief Resizes the Widget to the new Size-constraints.
+   */
+  void GLGuiTable::resize()
+  {
+    GLGuiWidget::resize();
+  }
+
+  void GLGuiTable::updateFrontColor()
+  {
+    for (unsigned int i = 0; i < this->columnCount(); ++i)
+    {
+      this->_headers[i].setColor(this->foregroundColor());
+      for (unsigned int j = 0; j < this->rowCount(); ++j)
+        this->_entries[j][i].setColor(this->foregroundColor());
+    }
+  }
+
+  void GLGuiTable::hiding()
+  {
+    for (unsigned int i = 0; i < this->columnCount(); ++i)
+    {
+      this->_headers[i].setVisibility(false);
+      for (unsigned int j = 0; j < this->rowCount(); ++j)
+        this->_entries[j][i].setVisibility(false);
+    }
+  }
+
+  void GLGuiTable::showing()
+  {
+    for (unsigned int i = 0; i < this->columnCount(); ++i)
+    {
+      this->_headers[i].setVisibility(true);
+      for (unsigned int j = 0; j < this->rowCount(); ++j)
+        this->_entries[j][i].setVisibility(true);
+    }
+  }
+
+
+  /**
+   * @brief ticks the Table
+   * @param dt the time passed.
+   */
+  void GLGuiTable::tick(float dt)
+{}
+
+  /**
+   * @brief draws the GLGuiTable
+   */
+  void GLGuiTable::draw() const
+  {
+    this->beginDraw();
+    GLGuiWidget::draw();
+
+    //     this->frontMaterial().select();
+    //     GLGuiWidget::drawRect(this->frontRect());
+
+    this->endDraw();
+  }
+
+
+  /**
+   * @brief applies the GLGuiNotifiers Settings to a single Text of the GLGuiNotifier.
+   * @param text the Text to apply the settings to.
+   */
+  void GLGuiTable::applyTextSettings(unsigned int row, unsigned int column, LimitedWidthText* text)
+  {
+    text->setSize(this->textSize());
+    //text->setLineWidth(  );
+    text->setFont("fonts/final_frontier.ttf", (int)this->textSize());
+
+    text->setColor(this->foregroundColor());
+    if (text->getParent2D() != this)
+      text->setParent2D(this);
+  }
+
+
+  void GLGuiTable::debug() const
+  {
+    PRINT(0)("Table: Size = %dx%d\n", this->rowCount(), this->columnCount());
+
+    for (unsigned int i = 0; i < this->rowCount(); ++i)
+      PRINT(0)("line %d: columns %d\n", i, this->_entries[i].size());
+  }
+
+
+  bool GLGuiTable::checkIntegrity() const
+  {
+    bool retVal = true;
+    if (rowCount() != this->_entries.size())
+    {
+      PRINTF(1)("ROW COUNT WRONG (is %d should be %d)\n", rowCount(), this->_entries.size());
+      retVal = false;
+    }
+    if (columnCount() != this->_headers.size())
+    {
+      PRINTF(1)("COLUMN COUNT WRONG (is %d should be %d)\n", columnCount(), this->_headers.size());
+      retVal = false;
+    }
+    for (unsigned int i = 0; i < this->rowCount(); ++i)
+      if (this->_entries[i].size() != this->columnCount())
+    {
+      PRINTF(1)("COLUMN-COUNT OF ROW %d WRONG (is %d should be %d)\n", i, this->_entries[i].size(), this->columnCount());
+      retVal = false;
+    }
+    return retVal;
+  }
+
+}
Index: trunk/src/lib/gui/gl/glgui_table.h
===================================================================
--- trunk/src/lib/gui/gl/glgui_table.h	(revision 8619)
+++ trunk/src/lib/gui/gl/glgui_table.h	(revision 8619)
@@ -0,0 +1,78 @@
+/*!
+ * @file glgui_table.h
+ * The gl_TABLE widget of th openglGUI
+ *
+ */
+
+#ifndef _GLGUI_TABLE_H
+#define _GLGUI_TABLE_H
+
+#include "glgui_widget.h"
+#include "limited_width_text.h"
+#include "event.h"
+
+// FORWARD DECLARATION
+namespace OrxGui
+{
+
+  //! This is Table part of the openglGUI class
+  /**
+   * The Table is a Widget, that displays a Line, that can be manipulated through
+   * Writing Text on it.
+   *
+   * Whenever the Text is changed the textChanged signal is emitted.
+   */
+  class GLGuiTable : public OrxGui::GLGuiWidget
+  {
+
+  public:
+    GLGuiTable(unsigned int rows, unsigned int columns);
+    virtual ~GLGuiTable();
+
+    unsigned int rowCount() const { return this->_entries.size(); };
+    unsigned int columnCount() const { return this->_headers.size(); };
+
+    void setRowCount(unsigned int rowCount);
+    void setColumnCount(unsigned int columnCount);
+
+    void setHeader(unsigned int number, const std::string& headerName);
+    void setHeader(const std::vector<std::string>& headerNames);
+
+    void setEntry(unsigned int column, unsigned int row, const std::string& name);
+
+    void setColumnWidth(unsigned int column, float size);
+    void setRowHeight(unsigned int row, unsigned int size);
+
+    virtual void tick(float dt);
+    virtual void draw() const;
+
+
+    void debug() const;
+
+  protected:
+    virtual void removedFocus();
+
+    virtual void updateFrontColor();
+    virtual void hiding();
+    virtual void showing();
+    virtual void resize();
+
+    virtual bool processEvent(const Event& event);
+
+
+  private:
+    void init();
+
+    void applyTextSettings(unsigned int row, unsigned int column, LimitedWidthText* text);
+    bool checkIntegrity() const;
+
+  private:
+    typedef std::vector<LimitedWidthText> TableTextList;
+    TableTextList                _headers;
+    std::vector<TableTextList>   _entries;     //!< inner is by column, outer is by row.
+
+
+  };
+}
+
+#endif /* _GLGUI_TABLE_H */
Index: trunk/src/lib/gui/gl/glgui_widget.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_widget.cc	(revision 8518)
+++ trunk/src/lib/gui/gl/glgui_widget.cc	(revision 8619)
@@ -14,5 +14,5 @@
 */
 
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GUI
+#define DEBUG_SPECIAL_MODULE 4//DEBUG_MODULE_GUI
 
 #include "glgui_widget.h"
@@ -23,4 +23,6 @@
 
 #include "debug.h"
+
+#include "loading/load_param.h"
 
 namespace OrxGui
@@ -39,4 +41,31 @@
 
   /**
+   * @brief loads Parameters for a Style from XML
+   * @param root the XML-Element to load from.
+   */
+  void GLGuiWidget::loadParams(const TiXmlElement* root)
+  {
+
+    /// STYLE
+    LoadParam(root, "border-left", this, GLGuiWidget, setBorderLeft);
+    LoadParam(root, "border-right", this, GLGuiWidget, setBorderRight);
+    LoadParam(root, "border-top", this, GLGuiWidget, setBorderTop);
+    LoadParam(root, "border-bottom", this, GLGuiWidget, setBorderBottom);
+
+    LoadParam(root, "text-size", this, GLGuiWidget, setTextSize);
+    LoadParam(root, "background-color", this, GLGuiWidget, setBackgroundColorS);
+    LoadParam(root, "foreground-color", this, GLGuiWidget, setForegroundColorS);
+
+    //    LoadParamXML(root, "backmat", this, GLGuiWidget, loadBackgroundMaterial);
+    //    LoadParamXML(root, "frontmat", this, GLGuiWidget, loadForegroundMaterial);
+
+    LoadParam(root, "feature-position", this, GLGuiWidget, setFeaturePositionS);
+    LoadParam(root, "Font", this, GLGuiWidget, setFont);
+
+    LoadParam(root, "animated-state-changes", this, GLGuiWidget, setAnimatedStateChanges);
+  }
+
+
+  /**
    * @brief standard deconstructor
    */
@@ -45,7 +74,4 @@
     if (this == GLGuiWidget::_focused)
       GLGuiWidget::_focused = NULL;
-
-    if (this->_toFrontColor)
-      delete this->_toFrontColor;
   }
 
@@ -66,17 +92,34 @@
     this->_clickable = false;
     this->_pushed = false;
+    this->_state = OrxGui::Normal;
+
+
+    this->_font = NULL;
+    this->resetStyle();
+
+    this->_animating = false;
+    this->_animationCycle = 0.0;
+    this->_animationDuration = 1.0;
+
+
+    this->setBackgroundColor(Color(.51, .3, .3, .5));
+    this->setBackgroundColor(Color(.3, .5, .3, 1), OrxGui::Selected);
+    this->_style[0]._background.setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    this->_style[1]._background.setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    this->_style[2]._background.setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    this->_style[3]._background.setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+    this->setForegroundColor(Color(1, 0, 0, 1), OrxGui::Normal);
+    this->setForegroundColor(Color(0, 0, 1, 1), OrxGui::Selected);
+    this->setForegroundColor(Color(0, 1, 0, 1), OrxGui::Focused);
+    this->setForegroundColor(Color(.1, .1, .1, 1), OrxGui::Insensitive);
 
     this->setVisibility(GLGUI_WIDGET_DEFAULT_VISIBLE);
 
-    this->_backMat.setDiffuseColor(Color(1.0, 0.5, 0.4, 1.0));
-    this->_backMat.setDiffuseMap("gui_element_background.png");
-    this->_frontColor = Color(1.0, 0.0, 0.0);
-    this->_toFrontColor = NULL;
-
-
-    this->_borderLeft = 15.0;
-    this->_borderRight = 1.0;
-    this->_borderTop = 1.0;
-    this->_borderBottom = 1.0;
+    this->setBorderLeft(15);
+    this->setBackgroundTexture("gui_element_background.png");
+
+    this->switchState(_state);
+    this->_currentStyle = this->_style[_state];
   }
 
@@ -121,54 +164,11 @@
   }
 
+
+
   void GLGuiWidget::setFrontColor(const Color& frontColor, bool instantaniously)
   {
-    if (instantaniously)
-    {
-      this->_frontColor = frontColor;
-      if (this->_toFrontColor != NULL)
-      {
-        delete this->_toFrontColor;
-        this->_toFrontColor = NULL;
-      }
-    }
-    else if (!this->_toFrontColor)
-      this->_toFrontColor = new Color(frontColor);
-    else
-      *this->_toFrontColor = frontColor;
-    //this->_frontColor = frontColor;
-    //this->updateFrontColor();
+    this->_currentStyle._foreground.setDiffuseColor(frontColor);
+    this->animateBack();
   };
-
-
-  void GLGuiWidget::setBorderSize(float borderSize)
-  {
-    this->_borderLeft = borderSize;
-    this->_borderRight = borderSize;
-    this->_borderTop = borderSize;
-    this->_borderBottom = borderSize;
-    this->resize();
-  }
-
-  void GLGuiWidget::setBorderLeft(float borderLeft)
-  {
-    this->_borderLeft = borderLeft;
-    this->resize();
-  }
-  void GLGuiWidget::setBorderRight(float borderRight)
-  {
-    this->_borderRight = borderRight;
-    this->resize();
-  }
-  void GLGuiWidget::setBorderTop(float borderTop)
-  {
-    this->_borderTop = borderTop;
-    this->resize();
-  }
-  void GLGuiWidget::setBorderBottom(float borderBottom)
-  {
-    this->_borderBottom = borderBottom;
-    this->resize();
-  }
-
 
 
@@ -201,22 +201,20 @@
   void GLGuiWidget::clicking(const Vector2D& pos)
   {
-    this->setFrontColor(Color(0, 0, 1));
-
+    this->switchState(OrxGui::Selected);
   }
 
   void GLGuiWidget::releasing(const Vector2D& pos)
   {
-    this->setFrontColor(Color(0,1,0));
-
+    this->switchState(OrxGui::Normal);
   }
 
   void GLGuiWidget::receivedFocus()
   {
-    this->setFrontColor(Color(0, 1, 0));
+    this->switchState(OrxGui::Focused);
   }
 
   void GLGuiWidget::removedFocus()
   {
-    this->setFrontColor(Color(1, 0, 0));
+    this->switchState(OrxGui::Normal);
 
   }
@@ -267,18 +265,480 @@
   }
 
-  void GLGuiWidget::tick(float dt)
-  {
-    if (this->_toFrontColor)
+
+  /**
+   * @brief resets the Style to the default Settings.
+   */
+  void GLGuiWidget::resetStyle()
+  {
+    this->setBorderLeft(1.0);
+    this->setBorderRight(1.0);
+    this->setBorderTop(1.0);
+    this->setBorderBottom(1.0);
+
+    this->setTextSize(20.0);
+    this->setBackgroundColor(1.0);
+    this->setForegroundColor(1.0);
+
+    this->setFeaturePosition(FeatureLeft);
+    this->setFont(NULL);
+
+    this->setAnimatedStateChanges(true);
+  }
+
+
+  /**
+   * @brief sets the Width of the left border for all States
+   * @param value the borderWidth
+   */
+  void GLGuiWidget::setBorderLeft(float value)
+  {
+    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
+      setBorderLeft(value, (OrxGui::State)i);
+  }
+
+  /**
+   * @brief sets the Width of the left border.
+   * @param value the borderWidth
+   * @param state the State to set the borderwidth to
+   */
+  void GLGuiWidget::setBorderLeft(float value, OrxGui::State state)
+  {
+    _style[state]._borderLeft = value;
+    if (state == _state)
+      _currentStyle._borderLeft = value;
+  }
+
+  /**
+   * @brief sets the Width of the left border.
+   * @param value the borderWidth
+   * @param stateName the State to set the borderwidth to
+   */
+  void GLGuiWidget::setBorderLeftS(float value, const std::string& stateName)
+  {
+    OrxGui::State state;
+    if (getState(stateName, &state))
+      this->setBorderLeft(value, state);
+    else
+      this->setBorderLeft(value);
+  }
+
+  /**
+   * @brief sets the Width of the right border for all states.
+   * @param value the borderWidth
+   */
+  void GLGuiWidget::setBorderRight(float value)
+  {
+    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
+      setBorderRight(value, (OrxGui::State)i);
+  }
+
+  /**
+   * @brief sets the Width of the right border.
+   * @param value the borderWidth
+   * @param state the State to setup.
+   */
+  void GLGuiWidget::setBorderRight(float value, OrxGui::State state)
+  {
+    _style[state]._borderRight = value;
+    if (state == _state)
+      _currentStyle._borderRight = value;
+  }
+
+  /**
+   * @brief sets the Width of the right border.
+   * @param value the borderWidth
+   * @param stateName the State to setup.
+   */
+  void GLGuiWidget::setBorderRightS(float value, const std::string& stateName)
+  {
+    OrxGui::State state;
+    if (getState(stateName, &state))
+      this->setBorderRight(value, state);
+    else
+      this->setBorderRight(value);
+  }
+
+
+  /**
+   * @brief sets the Width of the top border for all states.
+   * @param value the borderWidth
+   */
+  void GLGuiWidget::setBorderTop(float value)
+  {
+    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
+      setBorderTop(value, (OrxGui::State)i);
+  }
+
+  /**
+   * @brief sets the Width of the top border.
+   * @param value the borderWidth
+   * @param state the State to setup.
+   */
+  void GLGuiWidget::setBorderTop(float value, OrxGui::State state)
+  {
+    _style[state]._borderTop = value;
+    if (state == _state)
+      _currentStyle._borderTop = value;
+  }
+
+  /**
+   * @brief sets the Width of the top border.
+   * @param value the borderWidth
+   * @param stateName the State to setup.
+   */
+  void GLGuiWidget::setBorderTopS(float value, const std::string& stateName)
+  {
+    OrxGui::State state;
+    if (getState(stateName, &state))
+      this->setBorderTop(value, state);
+    else
+      this->setBorderTop(value);
+  }
+
+
+  /**
+   * @brief sets the Width of the bottom border for all states.
+   * @param value the borderWidth
+   */
+  void GLGuiWidget::setBorderBottom(float value)
+  {
+    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
+      setBorderBottom(value, (OrxGui::State)i);
+  }
+
+  /**
+   * @brief sets the Width of the bottom border.
+   * @param value the borderWidth
+   * @param state the State to setup.
+   */
+  void GLGuiWidget::setBorderBottom(float value, OrxGui::State state)
+  {
+    _style[state]._borderBottom = value;
+    if (state == _state)
+      _currentStyle._borderBottom = value;
+
+  }
+
+  /**
+   * @brief sets the Width of the bottom border for all states.
+   * @param value the borderWidth
+   * @param stateName the State to setup.
+   */
+  void GLGuiWidget::setBorderBottomS(float value, const std::string& stateName)
+  {
+    OrxGui::State state;
+    if (getState(stateName, &state))
+      this->setBorderBottom(value, state);
+    else
+      this->setBorderBottom(value);
+  }
+
+
+  /**
+   * @brief sets the TextSize for all states.
+   * @param value the TextSize
+   */
+  void GLGuiWidget::setTextSize(float value)
+  {
+    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
+      setTextSize(value, (OrxGui::State)i);
+  }
+
+  /**
+   * @brief sets the TextSize.
+   * @param value the TextSize.
+   * @param state: the State to setup
+   */
+  void GLGuiWidget::setTextSize(float value, OrxGui::State state)
+  {
+    _style[state]._textSize = value;
+    if (state == _state)
+      _currentStyle._textSize = value;
+  }
+
+  /**
+   * @brief sets the TextSize.
+   * @param value the TextSize.
+   * @param stateName: the State to setup
+   */
+  void GLGuiWidget::setTextSizeS(float value, const std::string& stateName)
+  {
+    OrxGui::State state;
+    if (getState(stateName, &state))
+      this->setTextSize(value, state);
+    else
+      this->setTextSize(value);
+  }
+
+
+  /**
+   * @brief sets the Background Color for all States.
+   * @param color the Color.
+   */
+  void GLGuiWidget::setBackgroundColor(const Color& color)
+  {
+    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
+      setBackgroundColor(color, (OrxGui::State)i);
+  }
+
+  /**
+   * @brief sets the Background Color.
+   * @param color the Color.
+   * @param state: the State to setup
+   */
+  void GLGuiWidget::setBackgroundColor(const Color& color, OrxGui::State state)
+  {
+    _style[state]._background.setDiffuseColor(color);
+    if (state == _state)
+      _currentStyle._background.setDiffuseColor(color);
+
+  }
+
+  /**
+   * @brief sets the Background Color.
+   * @param r the Color's red part.
+   * @param g the Color's green part.
+   * @param b the Color's blue part.
+   * @param a the Color's alpha part.
+   * @param stateName: the State to setup
+   */
+  void GLGuiWidget::setBackgroundColorS(float r, float g, float b, float a, const std::string& stateName)
+  {
+    OrxGui::State state;
+    if (getState(stateName, &state))
+      this->setBackgroundColor(Color(r,g,b,a), state);
+    else
+      this->setBackgroundColor(Color(r,g,b,a));
+  }
+
+
+  /**
+   * @brief sets the Background Texture for all States.
+   * @param texture the Texture.
+   */
+  void GLGuiWidget::setBackgroundTexture(const Texture& texture)
+  {
+    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
+      setBackgroundTexture(texture, (OrxGui::State)i);
+  }
+
+  /**
+  * @brief sets the Background Texture to all States.
+  * @param textureName the Texture's fileName.
+   */
+  void GLGuiWidget::setBackgroundTexture(const std::string& textureName)
+  {
+    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
+      _style[i]._background.setDiffuseMap(textureName);
+    this->_currentStyle._background.setDiffuseMap(textureName);
+  }
+
+  /**
+   * @brief sets the Background Texture.
+   * @param texture the Texture.
+   * @param state the State to setup.
+   */
+  void GLGuiWidget::setBackgroundTexture(const Texture& texture, OrxGui::State state)
+  {
+    _style[state]._background.setDiffuseMap(texture);
+    if (state == _state)
+      _currentStyle._background.setDiffuseMap(texture);
+  }
+
+
+
+  /**
+   * @brief sets the Background Texture.
+   * @param texture the Texture.
+   * @param stateName the State to setup.
+   */
+  void GLGuiWidget::setBackgroundTexture(const std::string& textureName, const std::string& stateName)
+  {
+    OrxGui::State state;
+    if (getState(stateName, &state))
+      ; /// FIXME this->setBackgroundTexture(textureName, state);
+    else
+      ; ///    this->setBackgroundTexture(textureName);
+  }
+
+
+  /**
+   * @brief sets the Foreground Color for all States.
+   * @param color the Color.
+   */
+  void GLGuiWidget::setForegroundColor(const Color& color)
+  {
+    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
+      setForegroundColor(color, (OrxGui::State)i);
+  }
+
+  /**
+   * @brief sets the Foreground Color.
+   * @param color the Color.
+   * @param state the State to setup
+   */
+  void GLGuiWidget::setForegroundColor(const Color& color, OrxGui::State state)
+  {
+    _style[state]._foreground.setDiffuseColor(color);
+    if (state == _state)
+      _currentStyle._foreground.setDiffuseColor(color);
+
+  }
+
+  /**
+   * @brief sets the Foreground Color.
+   * @param r the Color's red part.
+   * @param g the Color's green part.
+   * @param b the Color's blue part.
+   * @param a the Color's alpha part.
+   * @param stateName: the State to setup
+   */
+  void GLGuiWidget::setForegroundColorS(float r, float g, float b, float a, const std::string& stateName)
+  {
+    OrxGui::State state;
+    if (getState(stateName, &state))
+      this->setForegroundColor(Color(r,g,b,a), state);
+    else
+      this->setForegroundColor(Color(r,g,b,a));
+  }
+
+
+  void GLGuiWidget::loadBackgroundMaterial(const Material& material)
+  {
+    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
+      this->loadForegroundMaterial(material, (OrxGui::State)i);
+  }
+
+  void GLGuiWidget::loadBackgroundMaterial(const Material& material, OrxGui::State state)
+  {
+    this->_style[state]._background = material;
+    if (state == _state)
+      _currentStyle._background = material;
+
+  }
+
+  void GLGuiWidget::loadBackgroundMaterial(const TiXmlElement* element)
+  {
+    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
+      this->loadBackgroundMaterial(element, (OrxGui::State)i);
+  }
+
+  void GLGuiWidget::loadBackgroundMaterial(const TiXmlElement* element, OrxGui::State state)
+  {
+    this->_style[state]._background.loadParams(element);
+    if (state == _state)
+      this->_currentStyle._background = _style[state]._background;
+  }
+
+  void GLGuiWidget::loadBackgroundMaterialS(const TiXmlElement* element, const std::string& stateName)
+  {
+    OrxGui::State state;
+    if (getState(stateName, &state))
+      this->loadBackgroundMaterial(element, state);
+    else
+      this->loadBackgroundMaterial(element);
+  }
+
+  void GLGuiWidget::loadForegroundMaterial(const Material& material)
+{}
+  void GLGuiWidget::loadForegroundMaterial(const Material& material, OrxGui::State state)
+  {}
+  void GLGuiWidget::loadForegroundMaterial(const TiXmlElement* element, OrxGui::State state)
+  {}
+  void GLGuiWidget::loadForegroundMaterialS(const TiXmlElement* element, const std::string& stateName)
+  {}
+
+
+  /**
+   * @brief sets the Feature-Position.
+   * @param featurePosition the Feature-Position.
+   */
+  void GLGuiWidget::setFeaturePosition(FeaturePosition featurePosition)
+  {
+    this->_featurePosition = featurePosition;
+  }
+
+  /**
+   * @brief sets the Feature-Position by converting from a String.
+   * @param featurePosition the Feature-Position.
+   */
+  void GLGuiWidget::setFeaturePositionS(const std::string& featurePosition)
+  {
+    for (unsigned int i = 0; i < 4; ++i)
     {
-      this->_frontColor.slerp(*_toFrontColor, dt*3.0);
-      this->updateFrontColor();
-      if (this->_frontColor.dist(*_toFrontColor) < .1)
+      if (featurePosition == FeaturePositionString[i])
       {
-        delete _toFrontColor;
-        _toFrontColor = NULL;
+        this->setFeaturePosition((FeaturePosition)i);
       }
     }
   }
 
+  /**
+   * @brief sets the Font.
+   * @param font the Font.
+   */
+  void GLGuiWidget::setFont(Font* font)
+  {
+    this->_font = font;
+  }
+
+  /**
+   * @brief sets the font from a Font-Name.
+   * @param fontName the FileName of the Font.
+   */
+  void GLGuiWidget::setFont(const std::string& fontName)
+  {
+    //this->font = new Font(fontName);
+  }
+
+  /**
+   * @brief sets the AnimatedState.
+   * @param animated: it states-changes should animate true, otherwise false.
+   */
+  void GLGuiWidget::setAnimatedStateChanges(bool animated)
+  {
+    this->_animatedStateChanges = animated;
+  }
+
+
+  void GLGuiWidget::switchState(OrxGui::State state)
+  {
+    //this->_currentStyle = this->_style[state];
+    this->_state = state;
+    PRINTF(3)("Switching to state %s\n", OrxGui::StateString[state].c_str());
+
+    this->animateBack();
+  }
+
+
+  void GLGuiWidget::animateBack()
+  {
+    this->_animating = true;
+    this->_animationCycle = 0.0f;
+  }
+
+
+  void GLGuiWidget::tick(float dt)
+  {
+    if (this->_animating)
+    {
+      this->foregroundColor();
+
+      _animationCycle += dt / _animationDuration;
+      if (_animationCycle >= 1.0)
+      {
+        _currentStyle._foreground.diffuseColor() = this->foregroundColor(_state);
+        _currentStyle._background.diffuseColor() = this->backgroundColor(_state);
+        _animating = false;
+      }
+      else
+      {
+        _currentStyle._foreground.diffuseColor().slerp(this->foregroundColor(_state), _animationCycle);
+        _currentStyle._background.diffuseColor().slerp(this->backgroundColor(_state), _animationCycle);
+      }
+      this->updateFrontColor();
+    }
+  }
+
 
   /**
@@ -287,8 +747,82 @@
   void GLGuiWidget::draw() const
   {
-    this->backMaterial().select();
+    this->background().select();
     this->drawRect(this->backRect());
-    this->backMaterial().unselect();
-  }
+    this->background().unselect();
+  }
+
+
+  /**
+   * @param stateName the Name of a State.
+   * @param state the found State is returned here if found.
+   * @returns true if String is found, false otherwise.
+   */
+  bool GLGuiWidget::getState(const std::string& stateName, OrxGui::State* state)
+  {
+    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
+      if (stateName == OrxGui::StateString[i])
+    {
+      *state = (OrxGui::State)i;
+      return true;
+    }
+    return false;
+  }
+
+  /**
+   * @brief print out some nice debug output about the Widget.
+   */
+  void GLGuiWidget::debug() const
+  {
+    PRINT(0)("Debug of %s::%s - WidgetPart ", this->getClassName(), this->getName());
+    if (_parent != NULL)
+      PRINT(0)("- Parent %s::%s ", _parent->getClassName(), _parent->getName());
+    PRINT(0)("- State: %s", StateString[_state].c_str());
+
+    if (_focusable)
+      PRINT(0)("- focusable ");
+    if (_clickable)
+      PRINT(0)("- Clickable ");
+    if (_pushed)
+      PRINT(0)("- Pushed ");
+    PRINT(0)("\n");
+
+
+    PRINT(0)("Minimum Size %0.2f %0.2f ", _minSize.x, _minSize.y);
+    PRINT(0)("Back Rect: ");
+    _backRect.debug();
+    PRINT(0)("Style:\n");
+
+    for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
+    {
+      PRINT(0)("In State %s: \n", StateString[i].c_str());
+
+      PRINT(0)("  Borders: Left: %0.2f, Right: %0.2f, Top: %0.2f, Bottom %0.2f\n",
+               _style[i]._borderLeft, _style[i]._borderRight, _style[i]._borderTop, _style[i]._borderBottom);
+      PRINT(0)("  TextSize %0.2f\n", _style[i]._textSize);
+      PRINT(0)("  BackgroundColor: "); _style[i]._background.diffuseColor().debug();
+      PRINT(0)("  ForegroundColor: "); _style[i]._foreground.diffuseColor().debug();
+      PRINT(0)("\n");
+    }
+
+
+    PRINT(0)(" Feature at %s ", FeaturePositionString[_featurePosition].c_str());
+    /// TODO    PRINT(0)("");    Font*               _font;                 //!< The Font used in the current Widget.
+
+    if (_animatedStateChanges)
+      PRINT(0)("- AnimatedStateChanges");
+    PRINT(0)("\n");
+
+    /*
+    if (_animating)
+      PRINT(0)("- Animated ");
+
+    //
+    float               _animationCycle;
+    float               _animationDuration;
+    StatedStyle         _currentStyle;
+    OrxGui::State       _currentState;
+    */
+  }
+
 
 }
Index: trunk/src/lib/gui/gl/glgui_widget.h
===================================================================
--- trunk/src/lib/gui/gl/glgui_widget.h	(revision 8518)
+++ trunk/src/lib/gui/gl/glgui_widget.h	(revision 8619)
@@ -9,5 +9,6 @@
 #include "element_2d.h"
 
-#include "glgui_style.h"
+#include "glgui_defs.h"
+
 #include "material.h"
 #include "rect2D.h"
@@ -15,4 +16,6 @@
 #include "event.h"
 #include "signal_connector.h"
+
+class Font;
 
 namespace OrxGui
@@ -66,35 +69,138 @@
     void disconnect(GLGuiWidget* sender, Signal& signal, BaseObject* receiver);
 
-
-    GLGuiStyle& style() { return this->_style; };
-    const GLGuiStyle style() const { return this->_style; };
-
-    /// MATERIAL (looks)
-    Material& backMaterial() { return this->_backMat; };
-    const Material& backMaterial() const { return this->_backMat; };
+    OrxGui::State state() const { return this->_state; };
+
     Rect2D& backRect() { return this->_backRect; };
     const Rect2D& backRect() const { return this->_backRect; };
 
     void setFrontColor(const Color& frontColor, bool instantaniously = false);
-    const Color& frontColor() const { return this->_frontColor; };
-
-    /** @brief sets all borders to the same value. */
-    void setBorderSize(float borderSize);
-    void setBorderLeft(float borderLeft);
-    void setBorderRight(float borderRight);
-    void setBorderTop(float borderTop);
-    void setBorderBottom(float borderBottom);
-
-    float borderLeft() const { return this->_borderLeft; };
-    float borderRight() const { return this->_borderRight; };
-    float borderTop() const { return this->_borderTop; };
-    float borderBottom() const { return this->_borderBottom; };
-
 
     void setWidgetSize(const Vector2D& size);
     void setWidgetSize(float x, float y);
 
-
-    void setBackgroundColor(float x, float y, float z) { this->backMaterial().setDiffuse(x,y,z); };
+    void animateBack();
+
+    /// STYLE
+    ////////////////////////////////
+    /// Retrieve Current Values. ///
+    ////////////////////////////////
+    /** @returns current left borderWidth */
+    inline float borderLeft() const { return _currentStyle._borderLeft; }
+    /** @returns current right borderWidth */
+    inline float borderRight() const { return _currentStyle._borderRight; }
+    /** @returns current top borderWidth */
+    inline float borderTop() const { return _currentStyle._borderTop; }
+    /** @returns burrent bottom borderWidth */
+    inline float borderBottom() const { return _currentStyle._borderBottom; }
+
+
+    /** @returns current textSize */
+    inline float textSize() const { return _currentStyle._textSize; }
+    /** @returns the Background Color */
+    inline const Color& backgroundColor() const { return _currentStyle._background.diffuseColor(); }
+    /** @returns the current Background Material. */
+    inline const Material& background() const { return _currentStyle._background; }
+    /** @returns the current background Texture. */
+    inline const Texture& backgroundTexture() const { return _currentStyle._background.diffuseTexture(); }
+    /** @returns the current foreground Color */
+    inline const Color& foregroundColor() const { return _currentStyle._foreground.diffuseColor(); }
+    /** @returns the current ForeGroung Material. */
+    inline const Material& foreground() const { return _currentStyle._foreground; }
+
+
+    /** @returns FeaturePosition */
+    inline FeaturePosition featurePosition() const { return _featurePosition; }
+    /** @returns the font */
+    inline const Font* const font() const { return _font; }
+    /** @returns true if the Element is Animated */
+    inline bool animating() const { return _animating; }
+    /** @returns true if State-Changes are animated */
+    inline bool animatedStateChanges() const { return _animatedStateChanges; }
+
+
+    ///////////////////////////////////////////////////////////////
+    /// Retrieve Values for the Saved Values inside the States. ///
+    ///////////////////////////////////////////////////////////////
+    /** @returns left borderWidth @param state the State to retrieve from */
+    inline float borderLeft(OrxGui::State state) const { return _style[state]._borderLeft; }
+    /** @returns right borderWidth @param state the State to retrieve from */
+    inline float borderRight(OrxGui::State state) const { return _style[state]._borderRight; }
+    /** @returns top borderWidth @param state the State to retrieve from */
+    inline float borderTop(OrxGui::State state) const { return _style[state]._borderTop; }
+    /** @returns bottom borderWidth @param state the State to retrieve from */
+    inline float borderBottom(OrxGui::State state) const { return _style[state]._borderBottom; }
+
+    /** @returns textSize @param state the State to retrieve from */
+    inline float textSize(OrxGui::State state) const { return _style[state]._textSize; }
+    /** @returns the Background Color @param state the State to retrieve from */
+    inline const Color& backgroundColor(OrxGui::State state) const { return _style[state]._background.diffuseColor(); }
+    /** @returns the Background Material. @param state the state to retrieve from */
+    inline const Material& background(OrxGui::State state) const { return _style[state]._background; }
+    /** @returns background Texture. @param state the State to retrieve from */
+    inline const Texture& backgroundTexture(OrxGui::State state) const { return _style[state]._background.diffuseTexture(); }
+    /** @returns the foreground Color @param state the State to retrieve from */
+    inline const Color& foregroundColor(OrxGui::State state) const { return _style[state]._foreground.diffuseColor(); }
+    /** @returns the ForeGroung Material. @param state the state to retrieve from */
+    inline const Material& foreground(OrxGui::State state) const { return _style[state]._foreground; }
+
+
+    /// SETUP
+    void resetStyle();
+    void loadParams(const TiXmlElement* root);
+
+    void setBorderLeft(float value);
+    void setBorderLeft(float value, OrxGui::State state);
+    void setBorderLeftS(float value, const std::string& stateName);
+
+    void setBorderRight(float value);
+    void setBorderRight(float value, OrxGui::State state);
+    void setBorderRightS(float value, const std::string& stateName);
+
+    void setBorderTop(float value);
+    void setBorderTop(float value, OrxGui::State state);
+    void setBorderTopS(float value, const std::string& stateName);
+
+    void setBorderBottom(float value);
+    void setBorderBottom(float value, OrxGui::State state);
+    void setBorderBottomS(float value, const std::string& stateName);
+
+    void setTextSize(float value);
+    void setTextSize(float value, OrxGui::State state);
+    void setTextSizeS(float value, const std::string& stateName);
+
+    void setBackgroundColor(const Color& color);
+    void setBackgroundColor(const Color& color, OrxGui::State state);
+    void setBackgroundColorS(float r, float g, float b, float a, const std::string& stateName);
+
+    void setBackgroundTexture(const Texture& texture);
+    void setBackgroundTexture(const std::string& textureName);
+    void setBackgroundTexture(const Texture& texture, OrxGui::State state);
+    void setBackgroundTexture(const std::string& textureName, const std::string& stateName);
+
+    void setForegroundColor(const Color& color);
+    void setForegroundColor(const Color& color, OrxGui::State state);
+    void setForegroundColorS(float r, float g, float b, float a, const std::string& stateName);
+
+    void loadBackgroundMaterial(const Material& material);
+    void loadBackgroundMaterial(const Material& material, OrxGui::State state);
+    void loadBackgroundMaterial(const TiXmlElement* element);
+    void loadBackgroundMaterial(const TiXmlElement* element, OrxGui::State state);
+    void loadBackgroundMaterialS(const TiXmlElement* element, const std::string& stateName);
+
+    void loadForegroundMaterial(const Material& material);
+    void loadForegroundMaterial(const Material& material, OrxGui::State state);
+    void loadForegroundMaterial(const TiXmlElement* element, OrxGui::State state);
+    void loadForegroundMaterialS(const TiXmlElement* element, const std::string& stateName);
+
+    void setFeaturePosition(FeaturePosition featurePosition);
+    void setFeaturePositionS(const std::string& featurePosition);
+
+    void setFont(Font* font);
+    void setFont(const std::string& fontName);
+
+    void setAnimatedStateChanges(bool animated);
+    void switchState(OrxGui::State state);
+
+
 
     inline void drawRect(const Rect2D& rect) const
@@ -116,4 +222,5 @@
     virtual bool processEvent(const Event& event) { return false; };
 
+    bool getState(const std::string& stateName, OrxGui::State* state);
 
   protected:
@@ -137,27 +244,26 @@
     virtual void destroyed();
 
+    virtual void debug() const;
+
   private:
     void init();
 
   private:
+    static GLGuiWidget*            _selected;         //!< The currently selected Widget.
+    static GLGuiWidget*            _focused;          //!< The currently Focused Widget.
+    static GLGuiWidget*            _inputGrabber;     //!< The Widget that grabs input.
+
+
+    /// WIDGET
     GLGuiWidget*                   _parent;           //!< The parent of this Widget.
 
     /// LOOKS
-    Material                       _backMat;
     Rect2D                         _backRect;
-
-    Color                          _frontColor;
-    Color*                         _toFrontColor;
-
-    float                          _borderLeft;
-    float                          _borderRight;
-    float                          _borderTop;
-    float                          _borderBottom;
-
     Vector2D                       _minSize;
 
-    GLGuiStyle                     _style;
 
     /// EVENTS
+    OrxGui::State                  _state;
+
     bool                           _focusable;        //!< If this widget can receive focus.
     bool                           _clickable;        //!< if this widget can be clicked upon.
@@ -166,8 +272,36 @@
 
 
-    static GLGuiWidget*            _selected;         //!< The currently selected Widget.
-    static GLGuiWidget*            _focused;          //!< The currently Focused Widget.
-
-    static GLGuiWidget*            _inputGrabber;     //!< The Widget that grabs input.
+
+    /// STYLE - Variables.
+    typedef struct
+    {
+      float             _borderLeft;           //!< The Distance to the left Border of the widget, before any internal Element starts.
+      float             _borderRight;          //!< The Distance to the right Border of the widget, before any internal Element starts.
+      float             _borderTop;            //!< The Distance to the top Border of the widget, before any internal Element starts
+      float             _borderBottom;         //!< The Distance to the bottom Border of the widget, before any internal Element starts
+
+      float             _textSize;             //!< The TextSize of the Widget.
+
+      Material          _background;           //!< The Background Material of the Widget.
+
+      Material          _foreground;           //!< The foreground Material of the Widget.
+    }
+    StatedStyle;
+
+
+    StatedStyle         _style[GLGUI_STATE_COUNT]; //!< Styles configured for different States
+
+    FeaturePosition     _featurePosition;      //!< The Position a Feature will be layed at (checkbox(box), slider(text),...)
+    Font*               _font;                 //!< The Font used in the current Widget.
+
+
+    /// ANIMATION STUFF:
+    bool                _animatedStateChanges; //!< If the Transitions between States are Animated automatically.
+
+    bool                _animating;            //!< If the Widget is animated at the moment (Texture might be an AnimatedTexture.)
+    float               _animationCycle;
+    float               _animationDuration;
+    StatedStyle         _currentStyle;
+
   };
 }
Index: trunk/src/lib/gui/gl/specials/glgui_notifier.cc
===================================================================
--- trunk/src/lib/gui/gl/specials/glgui_notifier.cc	(revision 8518)
+++ trunk/src/lib/gui/gl/specials/glgui_notifier.cc	(revision 8619)
@@ -25,5 +25,5 @@
 
   /**
-   * standard constructor
+   * @brief standard constructor
    */
   GLGuiNotifier::GLGuiNotifier ()
@@ -34,4 +34,6 @@
     this->lineSpacing = 0;
     this->linesProcessed = 0;
+    this->_fadeAge = 3.0;
+    this->setHideAge(4.0);
 
     this->setDisplayLineCount(10);
@@ -57,30 +59,45 @@
   }
 
+  /**
+   * @brief push a message onto the notifier.
+   * @param message the message to be pushed.
+   *
+   * @note it is not guaranteed, that the message is delivered instantaniously
+   * The possibility may arise, that the DisplayLines are all in use, then one
+   * has to wait until a line gets hidden, until a new one can be pushed to be
+   * displayed.
+   */
   void GLGuiNotifier::pushNotifyMessage(const std::string& message)
   {
     if (!this->hiddenText.empty())
     {
-      printf("%s\n", message.c_str());
-      DisplayLine dl;
+      DisplayLine dl; // put everything in here, and then display it
+
+      // retrieve a Text.
       dl.text = this->hiddenText.top();
-
+      this->hiddenText.pop();
+
+      // setup Text
       dl.text->setBlending(1.0f);
       dl.text->setText(message);
-      this->hiddenText.pop();
+      dl.text->setVisibility(true);
+      dl.text->setRelCoor2D(this->calculateLinePosition(0));
+
       dl.age = 0.0f;
       this->displayLines.push_front(dl);
-
-      dl.text->setVisibility(true);
-      dl.text->setRelCoor2D(this->calculateLinePosition(0));
       this->repositionText();
     }
     else
     {
+      // push it onto the List of messages we still need.
       this->inputBuffer.push_front(message);
-      //printf("grumble... must be fixed\n");
-    }
-  }
-
-
+    }
+  }
+
+
+  /**
+   * @brief sets the Dipsplay Line Count of the Notifier.
+   * @param coun the count of displayLines.
+   */
   void GLGuiNotifier::setDisplayLineCount(unsigned int count)
   {
@@ -96,4 +113,16 @@
   }
 
+  void GLGuiNotifier::setFadeAge(float fadeAge)
+  {
+    this->_fadeAge = fadeAge;
+    this->_transformAge = hideAge() - this->fadeAge();
+  }
+
+  void GLGuiNotifier::setHideAge(float hideAge)
+  {
+    this->_hideAge = hideAge;
+    this->_transformAge = this->hideAge() - fadeAge();
+  }
+
 
   /**
@@ -119,9 +148,9 @@
   void GLGuiNotifier::applyTextSettings(MultiLineText* text)
   {
-    text->setSize(this->style().textSize());
+    text->setSize(this->textSize());
     text->setLineWidth( 300 );
-    text->setFont("fonts/final_frontier.ttf", (int)this->style().textSize());
-
-    text->setColor(this->style().foregroundColor() );
+    text->setFont("fonts/final_frontier.ttf", (int)this->textSize());
+
+    text->setColor(this->foregroundColor() );
     if (text->getParent2D() != this)
       text->setParent2D(this);
@@ -129,4 +158,8 @@
 
 
+  /**
+   * @brief ticks the entire Notifier.
+   * @param dt the time passed since the last Tick
+   */
   void GLGuiNotifier::tick(float dt)
   {
@@ -135,8 +168,8 @@
     {
       (*line).age+=dt;
-      if ((*line).age > 3.0f)
+      if ((*line).age > this->fadeAge())
       {
-        (*line).text->setBlending(4.0 - (*line).age);
-        if ((*line).age > 4.0f)
+        (*line).text->setBlending((hideAge() - (*line).age)/_transformAge);
+        if ((*line).age > hideAge())
         {
           std::list<DisplayLine>::iterator tmp = line;
@@ -167,5 +200,5 @@
     this->beginDraw();
 
-    this->backMaterial().select();
+    this->background().select();
     this->drawRect(this->backRect());
     this->endDraw();
@@ -183,5 +216,5 @@
   Vector2D GLGuiNotifier::calculateLinePosition(unsigned int lineNumber)
   {
-    return Vector2D(0.0f, (float)(this->style().textSize() + this->lineSpacing)*(float)((int)this->bufferDisplaySize - (int)lineNumber - (int)1));
+    return Vector2D(0.0f, (float)(textSize() + this->lineSpacing)*(float)((int)this->bufferDisplaySize - (int)lineNumber - (int)1));
   }
 
Index: trunk/src/lib/gui/gl/specials/glgui_notifier.h
===================================================================
--- trunk/src/lib/gui/gl/specials/glgui_notifier.h	(revision 8518)
+++ trunk/src/lib/gui/gl/specials/glgui_notifier.h	(revision 8619)
@@ -30,6 +30,13 @@
     void pushNotifyMessage(const std::string& message);
 
-    // BUFFERS
+    /// Setup
     void setDisplayLineCount(unsigned int count);
+    void setFadeAge(float fadeAge);
+    void setHideAge(float hideAge);
+
+    /** @returns the beginning of the Hiding process */
+    inline float fadeAge() const { return _fadeAge; };
+    /** @returns at what age elements should be fully hidden */
+    inline float hideAge() const { return _hideAge; };
 
     void clear();
@@ -54,4 +61,5 @@
 
   private:
+    //! structure that defines a Displayed line.
     typedef struct
     {
@@ -59,6 +67,10 @@
       MultiLineText*    text;
 
-    }
-    DisplayLine;
+    } DisplayLine;
+
+
+    float                       _fadeAge;
+    float                       _hideAge;
+    float                       _transformAge;
 
     unsigned int                lineSpacing;            //!< The Spacing between lines.
@@ -72,5 +84,5 @@
 
     unsigned long               linesProcessed;         //!< How many Lines have been processed so far.
-    std::list<std::string>      inputBuffer;            //!<
+    std::list<std::string>      inputBuffer;            //!< The input buffer for lines that were not yet printet out, because there is too much input.
 
   };
