Index: trunk/src/lib/gui/gl_gui/Makefile.am
===================================================================
--- trunk/src/lib/gui/gl_gui/Makefile.am	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/Makefile.am	(revision 7919)
@@ -9,21 +9,29 @@
 
 
-libORXglgui_a_SOURCES = glmenu/glmenu_imagescreen.cc \
-                        glgui_handler.cc \
-                        signal_connector.cc \
-                        glgui_mainwidget.cc \
-                        glgui_widget.cc \
-                        glgui_button.cc \
-                        glgui_pushbutton.cc \
-                        glgui_container.cc \
-                        glgui_bar.cc \
-                        glgui_box.cc \
-                        glgui_frame.cc \
-                        glgui_window.cc
+libORXglgui_a_SOURCES = \
+		glmenu/glmenu_imagescreen.cc \
+		glgui_handler.cc \
+		signal_connector.cc \
+		glgui_mainwidget.cc \
+		glgui_widget.cc \
+		glgui_button.cc \
+		glgui_pushbutton.cc \
+		glgui_checkbutton.cc \
+		glgui_slider.cc \
+		glgui_container.cc \
+		glgui_bar.cc \
+		glgui_box.cc \
+		glgui_frame.cc \
+		glgui_inputline.cc \
+		glgui_textfield.cc \
+		glgui_window.cc \
+		glgui_cursor.cc
 
 
-noinst_HEADERS= glmenu/glmenu_imagescreen.h \
+noinst_HEADERS= \
+		glmenu/glmenu_imagescreen.h \
 		signal_connector.h \
 		glgui.h \
+		glgui_defs.h \
 		glgui_handler.h \
 		glgui_mainwidget.h \
@@ -31,9 +39,14 @@
 		glgui_button.h \
 		glgui_pushbutton.h \
+		glgui_checkbutton.h \
+		glgui_slider.h \
 		glgui_container.h \
 		glgui_bar.h \
 		glgui_box.h \
 		glgui_frame.h \
-		glgui_window.h
+		glgui_inputline.h \
+		glgui_textfield.h \
+		glgui_window.h \
+		glgui_cursor.h
 
 
Index: trunk/src/lib/gui/gl_gui/glgui.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui.h	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui.h	(revision 7919)
@@ -6,4 +6,7 @@
 #ifndef _GLGUI_H
 #define _GLGUI_H
+
+#include "glgui_handler.h"
+
 #include "glgui_widget.h"
 
@@ -12,15 +15,10 @@
 #include "glgui_button.h"
 #include "glgui_checkbutton.h"
-#include "glgui_colorselector.h"
-
-namespace OrxGui
-{
+//#include "glgui_colorselector.h"
+#include "glgui_pushbutton.h"
+#include "glgui_cursor.h"
+#include "glgui_inputline.h"
+#include "glgui_textfield.h"
 
 
-};
-
-
-
-
-
-#endif _GLGUI_H
+#endif /* _GLGUI_H */
Index: trunk/src/lib/gui/gl_gui/glgui_bar.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_bar.cc	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_bar.cc	(revision 7919)
@@ -46,5 +46,5 @@
     this->setClassID(CL_GLGUI_BAR, "GLGuiBar");
 
-    this->frontMat.setDiffuse(1,1,1);
+    this->frontMaterial().setDiffuse(1,1,1);
 
     this->setSize2D(50, 10);
@@ -64,5 +64,5 @@
     GLGuiWidget::draw();
 
-    this->frontMat.select();
+    this->frontMaterial().select();
     glBegin(GL_QUADS);
 
Index: trunk/src/lib/gui/gl_gui/glgui_button.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_button.cc	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_button.cc	(revision 7919)
@@ -26,8 +26,9 @@
    * standard constructor
   */
-  GLGuiButton::GLGuiButton ()
+  GLGuiButton::GLGuiButton (const std::string& label)
   {
     this->init();
 
+    this->label.setText( label );
   }
 
@@ -45,24 +46,27 @@
 
   /**
-   * initializes the GUI-element
+   * @brief initializes the GUI-element
    */
   void GLGuiButton::init()
   {
     this->setClassID(CL_GLGUI_BUTTON, "GLGuiButton");
+    this->setFocusable(true);
+    this->setClickable(true);
 
-    this->label = new Text();
-    this->label->setParent2D(this);
+    this->label.setFont("fonts/final_frontier.ttf", 20);
+    this->frontMaterial().setDiffuse(1, 0, 0);
+
+    this->label.setParent2D(this);
   }
+
 
   void GLGuiButton::setLabel(const std::string& label)
   {
-    this->label->setText(label);
-    this->label->setRelCoor2D(5, 5);
-    this->setSize2D(this->label->getSizeX2D()+10, this->label->getSizeY2D()+10);
+    this->label.setText(label);
+    this->resize();
   }
 
-
   /**
-   * draws the GLGuiButton
+   * @brief draws the GLGuiButton
    */
   void GLGuiButton::draw() const
Index: trunk/src/lib/gui/gl_gui/glgui_button.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_button.h	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_button.h	(revision 7919)
@@ -10,5 +10,5 @@
 #include "glgui_widget.h"
 
-class Text;
+#include "text.h"
 
 namespace OrxGui
@@ -27,5 +27,5 @@
   //! This is part of the openglGUI class
   /**
-   *
+   * The Button is an Abstract class, that can be pushed to Toggle its state.
    */
   class GLGuiButton : public GLGuiWidget
@@ -33,14 +33,21 @@
 
   public:
-    GLGuiButton();
+    GLGuiButton(const std::string& label);
     virtual ~GLGuiButton();
 
-    void init();
+    const std::string& getLabel() const { return this->label.getText(); };
     void setLabel(const std::string& label);
+
+    virtual void resize() = 0;
 
     virtual void draw() const;
 
+    private:
+      void init();
+
+
   protected:
-    Text*                label;
+
+    Text                 label;
 
   private:
Index: trunk/src/lib/gui/gl_gui/glgui_checkbutton.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_checkbutton.cc	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_checkbutton.cc	(revision 7919)
@@ -27,8 +27,11 @@
    * standard constructor
   */
-  GLGuiCheckButton::GLGuiCheckButton ()
+  GLGuiCheckButton::GLGuiCheckButton (const std::string& label, bool active)
+  : GLGuiButton(label)
   {
     this->init();
+    this->bActive = active;
 
+    this->resize();
   }
 
@@ -44,15 +47,86 @@
    * initializes the GUI-element
    */
-  GLGuiCheckButton::init()
+  void GLGuiCheckButton::init()
   {
     this->setClassID(CL_GLGUI_CHECKBUTTON, "GLGuiCheckButton");
+  }
 
+
+  void GLGuiCheckButton::toggleActiveState()
+  {
+    this->bActive = !this->bActive;
+  }
+
+  void GLGuiCheckButton::resize()
+  {
+    this->label.setRelCoor2D(25, 5);
+    this->setSize2D(this->label.getSizeX2D() + 30, this->label.getSizeY2D() + 10);
+  }
+
+
+  void GLGuiCheckButton::released()
+  {
+    printf("%s released\n", this->getLabel().c_str());
+    GLGuiWidget::released();
+    this->toggleActiveState();
   }
 
   /**
-   * draws the GLGuiCheckButton
+   * @brief draws the GLGuiPushButton
    */
   void GLGuiCheckButton::draw() const
   {
+    this->startDraw();
+    GLGuiButton::draw();
+
+    this->frontMaterial().select();
+    glBegin(GL_QUADS);
+
+    glTexCoord2i(0,0); glVertex2d(1, 1);
+    glTexCoord2i(0,1); glVertex2d(1, this->getSizeY2D() - 1);
+    glTexCoord2i(1,1); glVertex2d(this->getSizeX2D() - 1, this->getSizeY2D() -1);
+    glTexCoord2i(1,0); glVertex2d(this->getSizeX2D() - 1, 1);
+
+    if (this->bActive)
+    {
+      glColor3f( 1, 1 ,1);
+      glTexCoord2i(0,0); glVertex2d(8, 8);
+      glTexCoord2i(0,1); glVertex2d(8, this->getSizeY2D()-8);
+      glTexCoord2i(1,1); glVertex2d(this->getSizeY2D()-8, this->getSizeY2D()-8);
+      glTexCoord2i(1,0); glVertex2d(this->getSizeY2D()-8, 8);
+      glEnd();
+
+
+      // DRAW a cross :)
+      glColor3f(0,0,0);
+      glLineWidth(3.0);
+      glBegin(GL_LINE_LOOP);
+      glVertex2d(8,8);
+      glVertex2d(this->getSizeY2D()/2, this->getSizeY2D()/2 - 1);
+
+      glVertex2d(this->getSizeY2D() -8, 8);
+      glVertex2d(this->getSizeY2D()/2 +1, this->getSizeY2D()/2);
+
+      glVertex2d(this->getSizeY2D() -8, this->getSizeY2D() - 8);
+      glVertex2d(this->getSizeY2D()/2, this->getSizeY2D()/2+1);
+
+      glVertex2d(8, this->getSizeY2D() - 8);
+      glVertex2d(this->getSizeY2D()/2 -1, this->getSizeY2D()/2);
+      glEnd();
+    }
+    else
+    {
+      glColor3f(0, 0, 0);
+      glTexCoord2i(0,0); glVertex2d(8, 8);
+      glTexCoord2i(0,1); glVertex2d(8, this->getSizeY2D()-8);
+      glTexCoord2i(1,1); glVertex2d(this->getSizeY2D()-8, this->getSizeY2D()-8);
+      glTexCoord2i(1,0); glVertex2d(this->getSizeY2D()-8, 8);
+      glEnd();
+    }
+
+
+    this->endDraw();
+    //   this->label->draw();
+    //  printf("test");
   }
 }
Index: trunk/src/lib/gui/gl_gui/glgui_checkbutton.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_checkbutton.h	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_checkbutton.h	(revision 7919)
@@ -6,5 +6,5 @@
 
 #ifndef _GLGUI_CHECKBUTTON_H
-#define _GLGUI__H
+#define _GLGUI_CHECKBUTTON_H
 
 #include "glgui_button.h"
@@ -23,14 +23,20 @@
 
   public:
-    GLGuiCheckButton();
+    GLGuiCheckButton(const std::string& label = "", bool active = false);
     virtual ~GLGuiCheckButton();
 
-    void init();
+    virtual void resize();
+    virtual void released();
 
     bool    isActive() { return this->bActive; };
     void    setActivity(bool bActive);
+    void    toggleActiveState();
 
     virtual void draw() const;
     virtual void update() {};
+
+  private:
+    void init();
+
 
   private:
Index: trunk/src/lib/gui/gl_gui/glgui_colorselector.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_colorselector.h	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_colorselector.h	(revision 7919)
@@ -5,8 +5,8 @@
  */
 
-#ifndef _GLGUI__H
-#define _GLGUI__H
+#ifndef _GLGUI_COLORSELECTOR_H
+#define _GLGUI_COLORSELECTOR_H
 
-#include "base_object.h"
+#include "glgui_widget.h"
 
 namespace OrxGui
Index: trunk/src/lib/gui/gl_gui/glgui_cursor.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_cursor.cc	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_cursor.cc	(revision 7919)
@@ -16,5 +16,9 @@
 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GUI
 
-#include "glgui_.h"
+#include "glgui_cursor.h"
+
+#include "glgui_handler.h"
+#include "color.h"
+
 
 namespace OrxGui
@@ -24,7 +28,11 @@
    * standard constructor
   */
-  GLGui::GLGui ()
+  GLGuiCursor::GLGuiCursor ()
   {
     this->init();
+
+    this->subscribeEvent(ES_MENU,  EV_MOUSE_MOTION);
+    this->subscribeEvent(ES_MENU, EV_WINDOW_FOCUS);
+
 
   }
@@ -32,24 +40,84 @@
 
   /**
-   * standard deconstructor
-  */
-  GLGui::~GLGui()
+   * @brief standard deconstructor
+   */
+  GLGuiCursor::~GLGuiCursor()
   {
+    GLGuiHandler::getInstance()->deactivateCursor(false);
+  }
+
+  float GLGuiCursor::_mouseSensitivity = 1.0;
+
+
+  /**
+   * @brief initializes the GUI-element
+   */
+  void GLGuiCursor::init()
+  {
+    this->setClassID(CL_GLGUI_CURSOR, "GLGuiCursor");
+
+    this->backMaterial().setDiffuse(1.0,0.0,0.0);
+    this->backMaterial().setDiffuseMap("cursor.png");
+    this->setSize2D(10, 20);
+    this->setAbsCoor2D(100, 100);
+    this->setLayer(E2D_LAYER_ABOVE_ALL);
+    this->color = 0.0f;
+
+  }
+
+  void GLGuiCursor::tick(float dt)
+  {
+    this->color += dt*10.0;
+    if (this->color > 360.0)
+      this->color -= 360.0;
+    Vector color =  Color::HSVtoRGB(Vector(this->color, 1.0, 1.0));
+    this->backMaterial().setDiffuse(color.x, color.y, color.z);
+
+    if (this->movement != Vector2D())
+    {
+      newPos += movement;
+      // reposition the cursor.
+      if (newPos.x < 0.0f )
+        newPos.x = 0.0f;
+      if (newPos.x > this->_maxBorders.x)
+        newPos.x = this->_maxBorders.x;
+      if (newPos.y < 0.0f )
+        newPos.y = 0.0f;
+      if (newPos.y > this->_maxBorders.y)
+        newPos.y = this->_maxBorders.y;
+
+
+      this->setAbsCoorSoft2D(newPos, 10);
+      movement = Vector2D();
+    }
   }
 
   /**
-   * initializes the GUI-element
+   * @brief draws the GLGuiCursor
    */
-  GLGui::init()
+  void GLGuiCursor::draw() const
   {
-    this->setClassID(CL_GLGUI_, "GLGui");
-
+    this->startDraw();
+    GLGuiWidget::draw();
+    this->endDraw();
   }
 
-  /**
-   * draws the GLGui
-   */
-  void GLGui::draw()
+  void GLGuiCursor::process(const Event& event)
   {
+    switch (event.type)
+    {
+      case EV_WINDOW_FOCUS:
+        if (event.bPressed)
+        {
+          int mouseX, mouseY;
+          SDL_GetMouseState(&mouseX, &mouseY);
+          newPos = Vector2D(mouseX, mouseY);
+        }
+        break;
+      case EV_MOUSE_MOTION:
+        movement += Vector2D((float)event.xRel * _mouseSensitivity, (float)event.yRel * _mouseSensitivity);
+        break;
+
+    }
   }
 }
Index: trunk/src/lib/gui/gl_gui/glgui_cursor.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_cursor.h	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_cursor.h	(revision 7919)
@@ -1,12 +1,14 @@
 /*!
- * @file glgui_.h
- * The gl_ widget of th openglGUI
+ * @file glgui_cursor.h
+ * The gl_cursor widget of th openglGUI
  *
  */
 
-#ifndef _GLGUI__H
-#define _GLGUI__H
+#ifndef _GLGUI_CURSOR_H
+#define _GLGUI_CURSOR_H
 
-#include "base_object.h"
+#include "glgui_widget.h"
+#include "event_listener.h"
+#include "vector2D.h"
 
 namespace OrxGui
@@ -18,18 +20,35 @@
    *
    */
-  class GLGui : public GLGui
+  class GLGuiCursor : public GLGuiWidget, public EventListener
   {
 
   public:
-    GLGui();
-    virtual ~GLGui();
+    GLGuiCursor();
+    virtual ~GLGuiCursor();
+
+    static void setMouseSensitivity(float mouseSensitivity);
+    static float mouseSensitivity() { return GLGuiCursor::_mouseSensitivity; };
+
+    void setMaxBorders(const Vector2D& maxBorders) { this->_maxBorders = maxBorders; };
 
     void init();
+    const Vector2D& position() const { return Element2D::getAbsCoor2D(); }
 
-    virtual void draw();
 
+    virtual void tick(float dt);
+    virtual void draw() const;
+    virtual void process(const Event& event);
   private:
+
+    Vector2D      _maxBorders;
+
+    Vector2D      newPos;
+    Vector2D      movement;
+
+    float         color; // so f****ing temporary... ... ....
+
+    static float _mouseSensitivity;
 
   };
 }
-#endif /* _GLGUI__H */
+#endif /* _GLGUI_CURSOR_H */
Index: trunk/src/lib/gui/gl_gui/glgui_defs.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_defs.h	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_defs.h	(revision 7919)
@@ -0,0 +1,20 @@
+/*!
+ * @file glgui_defs.h
+ * Definitions for the GLGui.
+ */
+
+#ifndef _GLGUI_DEFS_H
+#define _GLGUI_DEFS_H
+
+/// TODO MOVE TO ORXGUI_TYPES
+namespace OrxGui
+{
+  //! An enumeration for the Orientation of an Element.
+  typedef enum {
+    Horizontal,    //!< Horizontal Orientation.
+    Vertical       //!< Vertical Orientation.
+  } Orientation;
+};
+
+
+#endif /* _GLGUI_DEFS_H */
Index: trunk/src/lib/gui/gl_gui/glgui_handler.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_handler.cc	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_handler.cc	(revision 7919)
@@ -20,4 +20,11 @@
 
 #include "glgui_mainwidget.h"
+#include "glgui_cursor.h"
+
+#include "class_list.h"
+
+
+/// TAKE THIS OUT OF HERE.
+#include "graphics_engine.h"
 
 namespace OrxGui
@@ -32,6 +39,12 @@
     this->setName("GLGuiHandler");
 
-    //this->subscribeEvent()
 
+    EventHandler::getInstance()->withUNICODE(ES_MENU, true );
+
+    this->cursor = NULL;
+    for (unsigned int i = 0; i < EV_NUMBER; i++)
+    {
+      this->subscribeEvent(ES_MENU, i);
+    }
   }
 
@@ -49,7 +62,28 @@
   }
 
+  void GLGuiHandler::activateCursor()
+  {
+    if (this->cursor == NULL)
+      this->cursor = new GLGuiCursor();
+    this->cursor->show();
+    this->cursor->setMaxBorders(Vector2D(GraphicsEngine::getInstance()->getResolutionX(), GraphicsEngine::getInstance()->getResolutionY()));
+  }
+
+  void GLGuiHandler::deactivateCursor(bool deleteCursor)
+  {
+    if (this->cursor)
+    {
+      if (deleteCursor)
+        delete this->cursor;
+      this->cursor = NULL;
+    }
+  }
+
+
   void GLGuiHandler::activate()
   {
     EventHandler::getInstance()->pushState(ES_MENU);
+
+
 
   }
@@ -59,4 +93,5 @@
     EventHandler::getInstance()->popState();
 
+
   }
 
@@ -64,4 +99,39 @@
   void GLGuiHandler::process(const Event &event)
   {
+    switch (event.type)
+    {
+      case  EV_MOUSE_BUTTON_LEFT:
+        if (GLGuiWidget::focused() != NULL)
+        {
+          if (event.bPressed)
+          {
+            if (GLGuiWidget::focused()->clickable())
+              GLGuiWidget::focused()->click();
+          }
+          else
+          {
+            if (GLGuiWidget::focused()->clickable())
+              GLGuiWidget::focused()->release();
+          }
+        }
+        break;
+      case EV_LEAVE_STATE:
+        if (GLGuiWidget::focused() != NULL)
+          GLGuiWidget::focused()->breakFocus();
+        break;
+
+      case EV_VIDEO_RESIZE:
+        if (this->cursor != NULL)
+          this->cursor->setMaxBorders(Vector2D(event.resize.w, event.resize.h));
+        break;
+    }
+
+
+
+    if (GLGuiWidget::focused())
+    {
+      GLGuiWidget::focused()->processEvent(event);
+    }
+
 
 
@@ -70,5 +140,5 @@
   void GLGuiHandler::draw()
   {
-//    GLGuiMainWidget::getInstance()->draw2D(E2D_LAYER_TOP);
+    //    GLGuiMainWidget::getInstance()->draw2D(E2D_LAYER_TOP);
   }
 
@@ -76,4 +146,29 @@
   void GLGuiHandler::tick(float dt)
   {
+
+    // CHECK THE COLLISIONS.
+    const std::list<BaseObject*>* objects = ClassList::getList(CL_GLGUI_WIDGET);
+
+    if (objects != NULL && this->cursor != NULL)
+    {
+      for (std::list<BaseObject*>::const_iterator it = objects->begin(); it != objects->end(); it++)
+      {
+        GLGuiWidget* widget = dynamic_cast<GLGuiWidget*>(*it);
+
+        if (widget->isVisible() &&
+            widget->focusable() &&
+            widget->focusOverWidget(this->cursor))
+        {
+          // receiving Focus
+          if (GLGuiWidget::focused() != widget)
+          {
+            widget->giveFocus();
+          }
+          return ;
+        }
+      }
+      if (GLGuiWidget::focused() != NULL)
+        GLGuiWidget::focused()->breakFocus();
+    }
   }
 }
Index: trunk/src/lib/gui/gl_gui/glgui_handler.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_handler.h	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_handler.h	(revision 7919)
@@ -8,7 +8,11 @@
 
 #include "event_listener.h"
+#include "glgui_widget.h"
 
 namespace OrxGui
 {
+
+  class GLGuiCursor;
+
   // FORWARD DECLARATION
 
@@ -21,4 +25,8 @@
     /** @returns a Pointer to the only object of this Class */
     inline static GLGuiHandler* getInstance(void) { if (!GLGuiHandler::singletonRef) GLGuiHandler::singletonRef = new GLGuiHandler();  return GLGuiHandler::singletonRef; };
+
+    void activateCursor();
+    void deactivateCursor(/** ignore param */ bool deleteCursor = true);
+    GLGuiCursor* getCursor() const { return this->cursor; }
 
     void activate();
@@ -36,4 +44,6 @@
 
     bool                 isActive;
+    GLGuiCursor*         cursor;
+
   };
 }
Index: trunk/src/lib/gui/gl_gui/glgui_inputline.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_inputline.cc	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_inputline.cc	(revision 7919)
@@ -0,0 +1,176 @@
+/*
+   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_inputline.h"
+
+namespace OrxGui
+{
+  /**
+   * standard constructor
+  */
+  GLGuiInputLine::GLGuiInputLine ()
+  {
+    this->init();
+
+  }
+
+
+  /**
+   * standard deconstructor
+  */
+  GLGuiInputLine::~GLGuiInputLine()
+  {}
+
+  float GLGuiInputLine::repeatDelay = 0.3f;
+  float GLGuiInputLine::repeatRate  = 0.01f;
+
+
+  /**
+   * initializes the GUI-element
+   */
+  void GLGuiInputLine::init()
+  {
+    this->setClassID(CL_GLGUI_INPUTLINE, "GLGuiInputLine");
+
+    this->setFocusable(true);
+
+    this->text.setParent2D(this);
+    this->text.setRelCoor2D(4,4);
+    this->text.setFont("fonts/final_frontier.ttf", 20);
+  }
+
+  void GLGuiInputLine::setText(const std::string& text)
+  {
+    this->text.setText(text);
+    this->resize();
+  }
+
+  void GLGuiInputLine::append(const std::string& appendText)
+  {
+    this->text.append(appendText);
+    this->resize();
+  }
+
+  void GLGuiInputLine::appendCharacter(char character)
+  {
+    this->text.appendCharacter(character);
+    this->resize();
+  }
+
+
+  void GLGuiInputLine::removeCharacters(unsigned int chars)
+  {
+    this->text.removeCharacters(chars);
+    this->resize();
+  }
+
+
+  void GLGuiInputLine::removedFocus()
+  {
+    GLGuiWidget::removedFocus();
+    this->pressedKey = 0;
+    this->pressedKeyName = 0;
+  }
+
+
+  bool GLGuiInputLine::processEvent(const Event& event)
+  {
+    if (event.bPressed)
+    {
+      if (event.type == SDLK_BACKSPACE)
+      {
+        this->delayNext = GLGuiInputLine::repeatDelay;
+        this->pressedKey = SDLK_BACKSPACE;
+        this->pressedKeyName = SDLK_BACKSPACE;
+        this->removeCharacters(1);
+        return true;
+      }
+      // any other keyboard key
+      else if (likely(event.type < 127))
+      {
+        this->delayNext = GLGuiInputLine::repeatDelay;
+
+        this->appendCharacter(event.x);
+        this->pressedKey = event.type;
+        this->pressedKeyName = event.x;
+        return true;
+      }
+    }
+    else // if(!event.bPressed)
+    {
+      if (this->pressedKey == event.type)
+      {
+        this->pressedKeyName = 0;
+        this->pressedKey = 0;
+        this->delayNext = 0.0;
+        return true;
+      }
+    }
+
+    return false;
+  }
+
+
+  void GLGuiInputLine::resize()
+  {
+    this->setSize2D( this->text.getSize2D() + Vector2D(8, 8));
+  }
+
+
+  void GLGuiInputLine::tick(float dt)
+  {
+    if (this->delayNext > 0.0)
+      this->delayNext -= dt;
+        else if (this->pressedKey != SDLK_FIRST )
+    {
+      this->delayNext = GLGuiInputLine::repeatRate;
+      switch (this->pressedKey)
+      {
+        case SDLK_BACKSPACE:
+          this->removeCharacters(1);
+          break;
+        default:
+        {
+          if (likely(this->pressedKey < 127))
+            this->appendCharacter(this->pressedKeyName);
+        }
+      }
+    }
+
+
+  }
+
+  /**
+   * draws the GLGuiInputLine
+   */
+  void GLGuiInputLine::draw() const
+  {
+    this->startDraw();
+    GLGuiWidget::draw();
+
+    this->frontMaterial().select();
+    glBegin(GL_QUADS);
+
+    glTexCoord2i(0,0); glVertex2d(3, 3);
+    glTexCoord2i(0,1); glVertex2d(3, this->getSizeY2D() - 3);
+    glTexCoord2i(1,1); glVertex2d(this->getSizeX2D() - 3, this->getSizeY2D() -3);
+    glTexCoord2i(1,0); glVertex2d(this->getSizeX2D() - 3, 3);
+
+    glEnd();
+    this->endDraw();
+  }
+}
Index: trunk/src/lib/gui/gl_gui/glgui_inputline.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_inputline.h	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_inputline.h	(revision 7919)
@@ -0,0 +1,64 @@
+/*!
+ * @file glgui_inputline.h
+ * The gl_INPUTLINE widget of th openglGUI
+ *
+ */
+
+#ifndef _GLGUI_INPUTLINE_H
+#define _GLGUI_INPUTLINE_H
+
+#include "glgui_widget.h"
+#include "text.h"
+#include "event.h"
+
+// FORWARD DECLARATION
+namespace OrxGui
+{
+
+  //! This is part of the openglGUI class
+  /**
+   *
+   */
+  class GLGuiInputLine : public OrxGui::GLGuiWidget
+  {
+
+  public:
+    GLGuiInputLine();
+    virtual ~GLGuiInputLine();
+
+    void init();
+
+    void setText(const std::string& text);
+    void append(const std::string& appendText);
+    void appendCharacter(char character);
+    void removeCharacters(unsigned int chars);
+    const std::string& getName() const { return this->text.getText(); };
+
+
+    virtual void removedFocus();
+
+    virtual void tick(float dt);
+    virtual void draw() const;
+
+    virtual bool processEvent(const Event& event);
+
+    private:
+      void resize();
+
+
+  private:
+    Text                    text;             //!< The Text to display inside of the InputLine.
+
+    Uint16                  pressedKey;       //!< the pressed key that will be repeated.
+    Uint16                  pressedKeyName;   //!< The Name of the Key, that was pressed.
+
+    float                   delayNext;        //!< How much time must pass before next output.
+
+    static float            repeatDelay;
+    static float            repeatRate;
+
+
+  };
+}
+
+#endif /* _GLGUI_INPUTLINE_H */
Index: trunk/src/lib/gui/gl_gui/glgui_pushbutton.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_pushbutton.cc	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_pushbutton.cc	(revision 7919)
@@ -25,17 +25,26 @@
 
   /**
-   * standard constructor
-  */
-  GLGuiPushButton::GLGuiPushButton ()
+   * @brief standard constructor
+   */
+  GLGuiPushButton::GLGuiPushButton (const std::string& label)
+  : GLGuiButton(label)
   {
     this->init();
+
+    this->resize();
   }
 
 
   /**
-   * standard deconstructor
+   * @brief standard deconstructor
   */
   GLGuiPushButton::~GLGuiPushButton()
   {
+  }
+
+  void GLGuiPushButton::resize()
+  {
+    this->label.setRelCoor2D(5, 5);
+    this->setSize2D(this->label.getSizeX2D() + 10, this->label.getSizeY2D() + 10);
   }
 
@@ -46,27 +55,51 @@
   {
     this->setClassID(CL_GLGUI_PUSHBUTTON, "GLGuiPushButton");
-    this->frontMat.setDiffuse(1,0,0);
-    //  this->label->setRelCoor2D(10, 10);
   }
 
+  void GLGuiPushButton::receivedFocus()
+  {
+    printf("%s received focus\n", this->getLabel().c_str());
+    GLGuiWidget::receivedFocus();
+  }
+
+  void GLGuiPushButton::removedFocus()
+  {
+    printf("%s removed focus\n", this->getLabel().c_str());
+    GLGuiWidget::removedFocus();
+
+  }
+
+  void GLGuiPushButton::clicked()
+  {
+    printf("%s clicked\n", this->getLabel().c_str());
+    GLGuiWidget::clicked();
+  }
+
+
+  void GLGuiPushButton::released()
+  {
+    printf("%s released\n", this->getLabel().c_str());
+    GLGuiWidget::released();
+  }
+
+
+
   /**
-   * draws the GLGuiPushButton
+   * @brief draws the GLGuiPushButton
    */
   void GLGuiPushButton::draw() const
   {
     this->startDraw();
+    GLGuiButton::draw();
 
-    //  GLGuiButton::draw();
-
-    this->frontMat.select();
+    this->frontMaterial().select();
     glBegin(GL_QUADS);
 
-    glVertex2d(0,0);
-    glVertex2d(0, this->getSizeY2D());
-    glVertex2d(this->getSizeX2D(), this->getSizeY2D());
-    glVertex2d(this->getSizeX2D(),0);
+    glTexCoord2i(0,0); glVertex2d(1, 1);
+    glTexCoord2i(0,1); glVertex2d(1, this->getSizeY2D() - 1);
+    glTexCoord2i(1,1); glVertex2d(this->getSizeX2D() - 1, this->getSizeY2D() -1);
+    glTexCoord2i(1,0); glVertex2d(this->getSizeX2D() - 1, 1);
 
     glEnd();
-
     this->endDraw();
     //   this->label->draw();
Index: trunk/src/lib/gui/gl_gui/glgui_pushbutton.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_pushbutton.h	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_pushbutton.h	(revision 7919)
@@ -23,12 +23,20 @@
 
   public:
-    GLGuiPushButton();
+    GLGuiPushButton(const std::string& label = "");
     virtual ~GLGuiPushButton();
 
-    void init();
+
+    virtual void resize();
+
+    virtual void receivedFocus();
+    virtual void removedFocus();
+    virtual void clicked();
+    virtual void released();
+
 
     virtual void draw() const;
     virtual void update();
   private:
+    void init();
 
   };
Index: trunk/src/lib/gui/gl_gui/glgui_slider.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_slider.cc	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_slider.cc	(revision 7919)
@@ -50,5 +50,5 @@
    * draws the GLGuiSlider
    */
-  void GLGuiSlider::draw()
+  void GLGuiSlider::draw() const
   {
   }
Index: trunk/src/lib/gui/gl_gui/glgui_slider.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_slider.h	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_slider.h	(revision 7919)
@@ -8,6 +8,6 @@
 #define _GLGUI_SLIDER_H
 
-#include "base_object.h"
-
+#include "glgui_widget.h"
+#include "glgui_defs.h"
 
 namespace OrxGui
@@ -19,5 +19,5 @@
    *
    */
-  class GLGuiSlider : public GLGuiSlider
+  class GLGuiSlider : public GLGuiWidget
   {
 
@@ -28,7 +28,13 @@
     void init();
 
-    virtual void draw();
+    virtual void draw() const;
 
   private:
+    Orientation      orientation;
+
+    float            _maxValue;
+    float            _minValue;
+
+    float            _value;
 
   };
Index: trunk/src/lib/gui/gl_gui/glgui_textfield.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_textfield.cc	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_textfield.cc	(revision 7919)
@@ -16,5 +16,5 @@
 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GUI
 
-#include "glgui_textfield_.h"
+#include "glgui_textfield.h"
 namespace OrxGui
 {
@@ -42,5 +42,6 @@
   void GLGuiTextfield::init()
   {
-    this->setClassID(CL_GLGUI_, "GLGuiTextfield");
+    this->setClassID(CL_GLGUI_TEXTFIELD, "GLGuiTextfield");
+
 
   }
@@ -49,5 +50,5 @@
    * draws the GLGuiTextfield
    */
-  void GLGuiTextfield::draw()
+  void GLGuiTextfield::draw() const
   {
   }
Index: trunk/src/lib/gui/gl_gui/glgui_textfield.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_textfield.h	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_textfield.h	(revision 7919)
@@ -9,4 +9,7 @@
 
 #include "glgui_widget.h"
+
+#include "text.h"
+#include <vector>
 
 // FORWARD DECLARATION
@@ -28,8 +31,10 @@
     void init();
 
-    virtual void draw();
+    void process(const Event& event);
+
+    virtual void draw() const;
 
   private:
-    std::list<Text*>      textLines;
+    std::vector<Text>        textLines;
 
   };
Index: trunk/src/lib/gui/gl_gui/glgui_widget.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_widget.cc	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_widget.cc	(revision 7919)
@@ -18,4 +18,6 @@
 #include "glgui_widget.h"
 
+#include "glgui_cursor.h"
+
 #include "material.h"
 
@@ -39,5 +41,11 @@
   GLGuiWidget::~GLGuiWidget()
   {
-  }
+    if (this == GLGuiWidget::_focused)
+      GLGuiWidget::_focused = NULL;
+  }
+
+  GLGuiWidget* GLGuiWidget::_focused = NULL;
+  GLGuiWidget* GLGuiWidget::_inputGrabber = NULL;
+
 
 
@@ -49,12 +57,12 @@
     this->setClassID(CL_GLGUI_WIDGET, "GLGuiWidget");
 
-    this->focusable = true;
-    this->clickable = true;
+    this->_focusable = false;
+    this->_clickable = false;
+    this->_pushed = false;
+
     this->setVisibility(GLGUI_WIDGET_DEFAULT_VISIBLE);
-    //  this->setParent2D((Element2D*)NULL);
 
     this->backMat.setDiffuse(1.0, 1.0, 1.0);
-
-    this->frontModel = 0;
+    this->frontMat.setDiffuse(1.0, 0.0, 0.0);
 
     this->widgetSignals.resize(SignalCount, SignalConnector());
@@ -62,12 +70,85 @@
 
 
-  bool GLGuiWidget::focusOverWidget(float x, float y)
-  {
-    if (this->getAbsCoor2D().x < x && this->getAbsCoor2D().x + this->getSizeX2D() > x &&
-        this->getAbsCoor2D().y < y && this->getAbsCoor2D().y + this->getSizeY2D() > y)
-      return true;
-    else
-      return false;
-  }
+  /** @brief gives focus to this widget */
+  void GLGuiWidget::giveFocus()
+  {
+    if (GLGuiWidget::focused() != NULL)
+      GLGuiWidget::focused()->breakFocus();
+    GLGuiWidget::_focused = this;
+    this->receivedFocus();
+  };
+
+  void GLGuiWidget::breakFocus()
+  {
+    if (GLGuiWidget::_focused == this)
+    {
+      GLGuiWidget::_focused = NULL;
+      this->_pushed = false;
+      this->removedFocus();
+    }
+  };
+
+
+  bool GLGuiWidget::focusOverWidget(const Vector2D& position) const
+  {
+    return (this->getAbsCoor2D().x < position.x && this->getAbsCoor2D().x + this->getSizeX2D() > position.x &&
+        this->getAbsCoor2D().y < position.y && this->getAbsCoor2D().y + this->getSizeY2D() > position.y);
+  }
+
+  bool GLGuiWidget::focusOverWidget(const GLGuiCursor* const cursor) const
+  {
+    return this->focusOverWidget(cursor->getAbsCoor2D());
+  }
+
+  void GLGuiWidget::click()
+  {
+    assert (!this->_pushed);
+    this->widgetSignals[Signal_click]("none");
+    this->_pushed = true;
+
+    this->clicked();
+  }
+
+  void GLGuiWidget::release()
+  {
+    if (this->_pushed)
+    {
+      this->widgetSignals[Signal_release]("none");
+
+      this->released();
+      this->_pushed = false;
+    }
+  }
+
+
+  void GLGuiWidget::clicked()
+  {
+    this->frontMaterial().setDiffuse(0, 0, 1);
+
+  }
+
+  void GLGuiWidget::released()
+  {
+    this->frontMat.setDiffuse(0,1,0);
+
+  }
+
+  void GLGuiWidget::receivedFocus()
+  {
+    this->frontMaterial().setDiffuse(0, 1, 0);
+  }
+
+  void GLGuiWidget::removedFocus()
+  {
+    this->frontMaterial().setDiffuse(1, 0, 0);
+
+  }
+
+  void GLGuiWidget::destroyed()
+  {
+  };
+
+
+
 
   /**
@@ -116,8 +197,8 @@
 
     glBegin(GL_QUADS);
-    glTexCoord2i(0,1); glVertex2d(0, 0);
-    glTexCoord2i(0,0); glVertex2d(0, this->getSizeY2D());
-    glTexCoord2i(1,0); glVertex2d(this->getSizeX2D(), this->getSizeY2D());
-    glTexCoord2i(1,1); glVertex2d(this->getSizeX2D(), 0);
+    glTexCoord2i(0,0); glVertex2d(0, 0);
+    glTexCoord2i(0,1); glVertex2d(0, this->getSizeY2D());
+    glTexCoord2i(1,1); glVertex2d(this->getSizeX2D(), this->getSizeY2D());
+    glTexCoord2i(1,0); glVertex2d(this->getSizeX2D(), 0);
     glEnd();
   }
Index: trunk/src/lib/gui/gl_gui/glgui_widget.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_widget.h	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glgui_widget.h	(revision 7919)
@@ -8,9 +8,14 @@
 
 #include "element_2d.h"
-#include "event.h"
+#include "rect2D.h"
+
 #include "material.h"
 
+#include "event.h"
+#include "signal_connector.h"
+
 #include "glincl.h"
-#include "signal_connector.h"
+
+#include <vector>
 
 // FORWARD DECLARATION
@@ -19,5 +24,4 @@
 namespace OrxGui
 {
-
   typedef enum
   {
@@ -34,4 +38,6 @@
 
 
+  class GLGuiCursor;
+
   //! if the Element should be visible by default.
 #define GLGUI_WIDGET_DEFAULT_VISIBLE       false
@@ -43,4 +49,5 @@
   class GLGuiWidget : public Element2D
   {
+
   private:
 
@@ -52,12 +59,37 @@
     void hide();
 
+    /// INTERCONNECTIVITY
     void connectSignal(SignalType signalType, BaseObject* obj, const Executor* signal);
     void disconnectSignal(SignalType signalType);
-    bool focusOverWidget(float x, float y);
 
+
+    /// FOCUS
+    /** @brief gives focus to this widget */
+    void giveFocus();
+    void breakFocus();
+    /** @returns true if the widget is focusable */
+    bool focusable() const { return this->_focusable; };
+    /** @param focusable sets if the Widget should be focusable */
+    void setFocusable(bool focusable = true) { this->_focusable = focusable; };
+    /** @returns true if the position is inside of the Widget. @param position the position to check */
+    bool focusOverWidget(const Vector2D& position) const;
+    /** @brief overloaded function, that returns true if the cursor is on top of the Widget */
+    bool focusOverWidget(const OrxGui::GLGuiCursor* const cursor) const;
+
+    /** @returns the currently focused Widget (NULL if none is selected) */
+    static GLGuiWidget* focused() { return GLGuiWidget::_focused; };
+
+
+    /// CLICK
+    void click();
+    void release();
+    bool clickable() const { return this->_clickable; };
+    void setClickable(bool clickable = true) { this->_clickable = clickable; };
 
     virtual void update() {};
     virtual void draw() const;
 
+
+    /// MATERIAL (looks)
     Material& backMaterial() { return this->backMat; };
     const Material& backMaterial() const { return this->backMat; };
@@ -66,13 +98,18 @@
     const Material& frontMaterial() const { return this->frontMat; };
 
+    /** @param the Event to process. @returns true if the Event has been consumed*/
+    virtual bool processEvent(const Event& event) { };
+
+
+    DeclareSignal(testSignal, ());
+
   protected:
         // if something was clickt on the GUI-widget.
-    virtual void clicked(const Event& event) {};
-    virtual void released(const Event& event) {};
+    virtual void clicked();
+    virtual void released();
+    virtual void receivedFocus();
+    virtual void removedFocus();
 
-    virtual void receivedFocus() {};
-    virtual void removedFocus() {};
-
-    virtual void destroyed() {};
+    virtual void destroyed();
 
 
@@ -84,18 +121,24 @@
 
 
+  private:
+    /// LOOKS
+    Material                       backMat;
+    Rect2D                         backRect;
+
+    Material                       frontMat;
+    Rect2D                         frontRect;
 
 
-  protected:
-    Material               backMat;
-    GLuint                 backModel;
+    /// SIGNALS
+    std::vector<SignalConnector>   widgetSignals;
 
-    Material               frontMat;
-    GLuint                 frontModel;
+    /// EVENTS
+    bool                           _focusable;        //!< If this widget can receive focus.
+    bool                           _clickable;        //!< if this widget can be clicked upon.
 
-  private:
-    std::vector<SignalConnector> widgetSignals;
+    bool                           _pushed;
 
-    bool                   focusable;        //!< If this widget can receive focus.
-    bool                   clickable;        //!< if this widget can be clicked upon.
+    static GLGuiWidget*            _focused;
+    static GLGuiWidget*            _inputGrabber;
   };
 }
Index: trunk/src/lib/gui/gl_gui/glmenu/glmenu_imagescreen.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glmenu/glmenu_imagescreen.cc	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/glmenu/glmenu_imagescreen.cc	(revision 7919)
@@ -240,5 +240,4 @@
   glEnd();
 
-  glDisable(GL_TEXTURE_2D);
   /* draw white border */
   glBegin(GL_LINE_LOOP);
Index: trunk/src/lib/gui/gl_gui/signal_connector.h
===================================================================
--- trunk/src/lib/gui/gl_gui/signal_connector.h	(revision 7868)
+++ trunk/src/lib/gui/gl_gui/signal_connector.h	(revision 7919)
@@ -11,4 +11,17 @@
 namespace OrxGui
 {
+
+#define DeclareSignal(name, params) \
+  public: \
+   void signal_ ##connect ##name(const SignalConnector& connector) { \
+     name ## connected.push_back(connector); \
+   }\
+  private: \
+   void  signal_ ## name params { \
+     for (unsigned int i = 0; i < name ## connected . size(); i++) \
+       name ## connected[i] ("TEST"); \
+   }\
+   std::vector<SignalConnector> name ## connected
+
   //! A class for Conncting Signals to Objects, inside of the GUI
   class SignalConnector
