Index: trunk/src/lib/gui/gl_gui/Makefile.am
===================================================================
--- trunk/src/lib/gui/gl_gui/Makefile.am	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/Makefile.am	(revision 8035)
@@ -25,4 +25,5 @@
 		glgui_inputline.cc \
 		glgui_textfield.cc \
+		glgui_image.cc \
 		glgui_window.cc \
 		glgui_cursor.cc
@@ -47,4 +48,5 @@
 		glgui_inputline.h \
 		glgui_textfield.h \
+		glgui_image.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 7919)
+++ trunk/src/lib/gui/gl_gui/glgui.h	(revision 8035)
@@ -7,4 +7,5 @@
 #define _GLGUI_H
 
+#include "glgui_defs.h"
 #include "glgui_handler.h"
 
@@ -17,7 +18,9 @@
 //#include "glgui_colorselector.h"
 #include "glgui_pushbutton.h"
+#include "glgui_slider.h"
 #include "glgui_cursor.h"
 #include "glgui_inputline.h"
 #include "glgui_textfield.h"
+#include "glgui_image.h"
 
 
Index: trunk/src/lib/gui/gl_gui/glgui_bar.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_bar.cc	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_bar.cc	(revision 8035)
@@ -60,5 +60,5 @@
   void GLGuiBar::draw() const
   {
-    this->startDraw();
+    this->beginDraw();
 
     GLGuiWidget::draw();
Index: trunk/src/lib/gui/gl_gui/glgui_box.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_box.cc	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_box.cc	(revision 8035)
@@ -23,9 +23,9 @@
    * standard constructor
   */
-  GLGuiBox::GLGuiBox (BoxType type)
+  GLGuiBox::GLGuiBox (OrxGui::Orientation orientation)
   {
     this->init();
 
-    this->setType (type);
+    this->setOrientation(orientation);
   }
 
@@ -47,8 +47,10 @@
   void GLGuiBox::pack(GLGuiWidget* widget)
   {
-    if (widget == NULL)
-      return;
+    assert (widget != NULL);
 
     this->children.push_back(widget);
+    widget->setParentWidget(this);
+
+    this->resize();
   }
 
@@ -56,17 +58,24 @@
   void GLGuiBox::unpack(GLGuiWidget* widget)
   {
-    if (widget == NULL)
+    assert(widget == NULL);
+
+    std::vector<GLGuiWidget*>::iterator delWidget = std::find(this->children.begin(), this->children.end(), widget);
+    if (delWidget != this->children.end())
     {
-      this->children.clear();
+      (*delWidget)->setParentWidget(NULL);
+      this->children.erase(delWidget);
     }
-    else
-    {
-      this->children.remove(widget);
-    }
+    this->resize();
+  }
+
+  void GLGuiBox::clear()
+  {
+    this->children.clear();
+    this->resize();
   }
 
   void GLGuiBox::showAll()
   {
-    std::list<GLGuiWidget*>::iterator itC = this->children.begin();
+    std::vector<GLGuiWidget*>::iterator itC = this->children.begin();
     while (itC != this->children.end())
     {
@@ -79,10 +88,9 @@
 
     this->show();
-
   }
 
   void GLGuiBox::hideAll()
   {
-    std::list<GLGuiWidget*>::iterator itC = this->children.begin();
+    std::vector<GLGuiWidget*>::iterator itC = this->children.begin();
     while (itC != this->children.end())
     {
@@ -97,10 +105,61 @@
   }
 
+  void GLGuiBox::resize()
+  {
+    if (orientation() == OrxGui::Vertical)
+    {
+      float height = this->borderSize();
+      float width = 0.0f;
+      std::vector<GLGuiWidget*>::iterator widget;
+
+      // find out how big the Widgets are.
+      for (widget = this->children.begin(); widget != this->children.end(); ++widget)
+      {
+        (*widget)->setRelCoor2D(this->borderSize(), height);
+        height += (*widget)->getSizeY2D();
+        width = fmax(width, (*widget)->getSizeX2D());
+      }
+
+      width += this->borderSize() * 2.0;
+      height += this->borderSize(); /* *2 done further up */
+
+      printf("%f %f\n", width, height);
+      this->setSize2D(width, height);
+    }
+    else
+    {
+      float height = this->borderSize();
+      float width = this->borderSize();
+      std::vector<GLGuiWidget*>::iterator widget;
+
+      // find out how big the Widgets are.
+      for (widget = this->children.begin(); widget != this->children.end(); ++widget)
+      {
+        (*widget)->setRelCoor2D(width, this->borderSize());
+        height = fmax(height, (*widget)->getSizeY2D());
+        width += (*widget)->getSizeX2D();
+      }
+
+      width += this->borderSize() ;
+      height += this->borderSize(); /* *2 done further up */
+
+      printf("%f %f\n", width, height);
+      this->setSize2D(width, height);
+    }
+    GLGuiWidget::resize();
+
+    // resize everything.
+    //for (widget = this->children.begin(); widget != this->children.end(); ++widget)
+    //{}
+  }
 
   /**
-   * draws the GLGuiBox
+   * @brief draws the GLGuiBox
    */
   void GLGuiBox::draw() const
   {
+    this->beginDraw();
+    GLGuiWidget::draw();
+    this->endDraw();
   }
 }
Index: trunk/src/lib/gui/gl_gui/glgui_box.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_box.h	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_box.h	(revision 8035)
@@ -9,14 +9,8 @@
 
 #include "glgui_container.h"
-
+#include "glgui_defs.h"
 
 namespace OrxGui
 {
-  typedef enum
-  {
-    Box_H,
-    Box_V,
-  } BoxType;
-
   //! This is BOX part of the openglGUI class
   /**
@@ -27,12 +21,16 @@
 
   public:
-    GLGuiBox(BoxType type = Box_H);
+    GLGuiBox(OrxGui::Orientation orientation = OrxGui::Vertical);
     virtual ~GLGuiBox();
 
-    void init();
-    void setType(BoxType type) { this->type = type; };
+    /** @returns the Orientation of the Box */
+    OrxGui::Orientation orientation() const { return this->_orientation; };
+    /** @param orientation the Orientation of the Box */
+    void setOrientation(OrxGui::Orientation orientation) { this->_orientation = orientation; };
 
     virtual void pack(GLGuiWidget* widget);
     virtual void unpack(GLGuiWidget* widget);
+    virtual void clear();
+
     virtual void showAll();
     virtual void hideAll();
@@ -40,7 +38,12 @@
     virtual void draw() const;
 
+  protected:
+    virtual void resize();
+
   private:
-    BoxType                  type;
-    std::list<GLGuiWidget*>  children;
+    void init();
+
+    Orientation                _orientation;
+    std::vector<GLGuiWidget*>  children;
   };
 }
Index: trunk/src/lib/gui/gl_gui/glgui_button.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_button.cc	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_button.cc	(revision 8035)
@@ -67,4 +67,15 @@
   }
 
+
+
+  void GLGuiButton::clicking(const Vector2D& pos)
+  {
+    emit(clicked());
+  }
+  void GLGuiButton::releasing(const Vector2D& pos)
+  {
+    emit(released());
+  }
+
   /**
    * @brief draws the GLGuiButton
Index: trunk/src/lib/gui/gl_gui/glgui_button.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_button.h	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_button.h	(revision 8035)
@@ -32,14 +32,19 @@
   {
 
-  public:
-    GLGuiButton(const std::string& label);
-    virtual ~GLGuiButton();
+    public:
+      GLGuiButton(const std::string& label);
+      virtual ~GLGuiButton();
 
-    const std::string& getLabel() const { return this->label.getText(); };
-    void setLabel(const std::string& label);
+      const std::string& getLabel() const { return this->label.getText(); };
+      void setLabel(const std::string& label);
 
-    virtual void resize() = 0;
+      virtual void draw() const;
 
-    virtual void draw() const;
+      DeclareSignal0(released);
+      DeclareSignal0(clicked);
+
+    protected:
+      virtual void clicking(const Vector2D& pos);
+      virtual void releasing(const Vector2D& pos);
 
     private:
@@ -47,10 +52,11 @@
 
 
-  protected:
 
-    Text                 label;
+    protected:
 
-  private:
-    ButtonState          state;
+      Text                 label;
+
+    private:
+      ButtonState          state;
   };
 }
Index: trunk/src/lib/gui/gl_gui/glgui_checkbutton.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_checkbutton.cc	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_checkbutton.cc	(revision 8035)
@@ -52,8 +52,13 @@
   }
 
+  void GLGuiCheckButton::setActivity(bool bActive)
+  {
+    this->bActive = bActive;
+    emit(this->toggled(this->bActive));
+  }
 
   void GLGuiCheckButton::toggleActiveState()
   {
-    this->bActive = !this->bActive;
+    this->setActivity(!this->isActive());
   }
 
@@ -62,13 +67,17 @@
     this->label.setRelCoor2D(25, 5);
     this->setSize2D(this->label.getSizeX2D() + 30, this->label.getSizeY2D() + 10);
+    GLGuiWidget::resize();
+    this->frontRect().setTopLeft(borderSize(), borderSize());
+    this->frontRect().setSize(this->getSizeX2D() -2.0*borderSize(), this->getSizeY2D() -2.0*borderSize());
   }
 
 
-  void GLGuiCheckButton::released()
+  void GLGuiCheckButton::releasing(const Vector2D& pos)
   {
-    printf("%s released\n", this->getLabel().c_str());
-    GLGuiWidget::released();
+    GLGuiButton::releasing(pos);
     this->toggleActiveState();
   }
+
+
 
   /**
@@ -77,17 +86,13 @@
   void GLGuiCheckButton::draw() const
   {
-    this->startDraw();
+    this->beginDraw();
     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);
+    this->drawRect(this->frontRect());
 
     if (this->bActive)
     {
+      glBegin(GL_QUADS);
       glColor3f( 1, 1 ,1);
       glTexCoord2i(0,0); glVertex2d(8, 8);
@@ -117,4 +122,5 @@
     else
     {
+      glBegin(GL_QUADS);
       glColor3f(0, 0, 0);
       glTexCoord2i(0,0); glVertex2d(8, 8);
@@ -125,8 +131,5 @@
     }
 
-
     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 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_checkbutton.h	(revision 8035)
@@ -26,6 +26,4 @@
     virtual ~GLGuiCheckButton();
 
-    virtual void resize();
-    virtual void released();
 
     bool    isActive() { return this->bActive; };
@@ -35,4 +33,10 @@
     virtual void draw() const;
     virtual void update() {};
+
+    DeclareSignal1(toggled, bool);
+
+  protected:
+    virtual void resize();
+    virtual void releasing(const Vector2D& pos);
 
   private:
Index: trunk/src/lib/gui/gl_gui/glgui_container.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_container.h	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_container.h	(revision 8035)
@@ -25,13 +25,11 @@
     virtual ~GLGuiContainer();
 
-    void init();
-
-
-    void setBorderWidth(float borderwidth);
-
-
+    /** @brief packs a widget into this one. */
     virtual void pack(GLGuiWidget* widget) = 0;
     /** unpacks a Widget from this container. @param widget the GLGuiWidget to unpack, if NULL all subwidgets will be unpackt. */
     virtual void unpack(GLGuiWidget* widget) = 0;
+    /** @brief clears all Widgets out. */
+    virtual void clear() = 0;
+
     virtual void hideAll() = 0;
     virtual void showAll() = 0;
@@ -41,5 +39,5 @@
 
   private:
-
+    void init();
   };
 }
Index: trunk/src/lib/gui/gl_gui/glgui_cursor.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_cursor.cc	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_cursor.cc	(revision 8035)
@@ -59,9 +59,11 @@
     this->backMaterial().setDiffuse(1.0,0.0,0.0);
     this->backMaterial().setDiffuseMap("cursor.png");
-    this->setSize2D(10, 20);
+    this->backMaterial().setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    this->setSize2D(20, 30);
     this->setAbsCoor2D(100, 100);
     this->setLayer(E2D_LAYER_ABOVE_ALL);
     this->color = 0.0f;
 
+    this->resize();
   }
 
@@ -74,5 +76,5 @@
     this->backMaterial().setDiffuse(color.x, color.y, color.z);
 
-    if (this->movement != Vector2D())
+    //if (this->movement != Vector2D())
     {
       newPos += movement;
@@ -88,7 +90,7 @@
 
 
-      this->setAbsCoorSoft2D(newPos, 10);
       movement = Vector2D();
     }
+    this->setAbsCoor2D(newPos);
   }
 
@@ -98,5 +100,5 @@
   void GLGuiCursor::draw() const
   {
-    this->startDraw();
+    this->beginDraw();
     GLGuiWidget::draw();
     this->endDraw();
Index: trunk/src/lib/gui/gl_gui/glgui_handler.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_handler.cc	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_handler.cc	(revision 8035)
@@ -107,10 +107,16 @@
           {
             if (GLGuiWidget::focused()->clickable())
-              GLGuiWidget::focused()->click();
+            {
+              Vector2D cursorPos = (this->cursor != NULL) ? this->cursor->getAbsCoor2D() : Vector2D(event.x, event.y);
+              GLGuiWidget::focused()->click(cursorPos - GLGuiWidget::focused()->getAbsCoor2D());
+            }
           }
           else
           {
             if (GLGuiWidget::focused()->clickable())
-              GLGuiWidget::focused()->release();
+            {
+              Vector2D cursorPos = (this->cursor != NULL) ? this->cursor->getAbsCoor2D() : Vector2D(event.x, event.y);
+              GLGuiWidget::focused()->release(cursorPos - GLGuiWidget::focused()->getAbsCoor2D());
+            }
           }
         }
@@ -137,4 +143,27 @@
 
   }
+
+
+  Vector2D GLGuiHandler::cursorPositionOverFocusedWidget() const
+  {
+    return (this->cursor != NULL) ? this->cursor->getAbsCoor2D() : Vector2D(0,0);
+  }
+
+  const Vector2D& GLGuiHandler::cursorPositionAbs() const
+  {
+    if (this->cursor)
+      return this->cursor->getAbsCoor2D();
+    else
+      return Vector2D::nullVector();
+  }
+  Vector2D GLGuiHandler::cursorPositionRel(const GLGuiWidget* const widget) const
+  {
+    assert (widget != NULL);
+    if (this->cursor)
+      return  this->cursor->getAbsCoor2D() - widget->getAbsCoor2D();
+    else
+      return Vector2D::nullVector();
+  }
+
 
   void GLGuiHandler::draw()
Index: trunk/src/lib/gui/gl_gui/glgui_handler.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_handler.h	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_handler.h	(revision 8035)
@@ -30,4 +30,8 @@
     GLGuiCursor* getCursor() const { return this->cursor; }
 
+    Vector2D cursorPositionOverFocusedWidget() const;
+    const Vector2D& cursorPositionAbs() const;
+    Vector2D cursorPositionRel(const GLGuiWidget* const widget) const;
+
     void activate();
     void deactivate();
Index: trunk/src/lib/gui/gl_gui/glgui_image.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_image.cc	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_image.cc	(revision 8035)
@@ -43,13 +43,53 @@
   void GLGuiImage::init()
   {
-    this->setClassID(CL_GLGUI_, "GLGuiImage");
+    this->setClassID(CL_GLGUI_IMAGE, "GLGuiImage");
 
+    this->frontMaterial().setDiffuseMap(this->texture);
+    this->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+    this->resize();
   }
 
+
+  void GLGuiImage::loadImageFromTexture(const Texture& texture)
+  {
+    this->frontMaterial().setDiffuseMap(texture);
+    this->frontMaterial().setDiffuse(1,1,1);
+  }
+
+  void GLGuiImage::loadImageFromFile(const std::string& fileName)
+  {
+    this->texture.loadImage(fileName);
+  }
+
+  void GLGuiImage::loadImageFromSDLSurface(SDL_Surface* surface)
+  {
+    //this->texture.loadSurface(surface);
+  }
+
+  void GLGuiImage::loadImageFromDisplayList(GLuint texture)
+  {
+//    this->texture.setTexture(texture);
+  }
+
+  void GLGuiImage::resize()
+  {
+    this->frontRect().setTopLeft(this->borderSize(), this->borderSize());
+    this->frontRect().setSize(this->getSizeX2D() -2.0*this->borderSize(), this->getSizeY2D() - 2.0* this->borderSize() );
+    GLGuiWidget::resize();
+  }
+
+
   /**
-   * draws the GLGuiImage
+   * @brief draws the GLGuiImage
    */
-  void GLGuiImage::draw()
+  void GLGuiImage::draw() const
   {
+    this->beginDraw();
+    GLGuiWidget::draw();
+
+    this->frontMaterial().select();
+    this->drawRect(this->frontRect());
+    this->endDraw();
   }
 }
Index: trunk/src/lib/gui/gl_gui/glgui_image.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_image.h	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_image.h	(revision 8035)
@@ -8,5 +8,5 @@
 #define _GLGUI_IMAGE_H
 
-#include "base_object.h"
+#include "glgui_widget.h"
 
 // FORWARD DECLARATION
@@ -26,13 +26,20 @@
     virtual ~GLGuiImage();
 
-    void init();
-    void loadImageFromFile(const char* fileName);
+    void loadImageFromTexture(const Texture& texture);
+
+    void loadImageFromFile(const std::string& fileName);
     void loadImageFromSDLSurface(SDL_Surface* surface);
-    void loadImageFromDisplayList(GLuint displayList);
+    void loadImageFromDisplayList(GLuint texture);
 
-    virtual void draw();
+    virtual void draw() const;
+
+    DeclareSignal0(imageChanged);
 
   private:
+    void init();
+    virtual void resize();
 
+  private:
+    Texture       texture;
   };
 }
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 8035)
@@ -21,16 +21,15 @@
 {
   /**
-   * standard constructor
+   * @brief standard constructor
   */
   GLGuiInputLine::GLGuiInputLine ()
   {
     this->init();
-
-  }
-
-
-  /**
-   * standard deconstructor
-  */
+  }
+
+
+  /**
+   * @brief standard deconstructor
+   */
   GLGuiInputLine::~GLGuiInputLine()
   {}
@@ -41,5 +40,5 @@
 
   /**
-   * initializes the GUI-element
+   * @brief initializes the GUI-element
    */
   void GLGuiInputLine::init()
@@ -52,32 +51,59 @@
     this->text.setRelCoor2D(4,4);
     this->text.setFont("fonts/final_frontier.ttf", 20);
-  }
-
+    this->resize();
+  }
+
+
+  /**
+   * @brief sets the Text of the InputLine
+   * @param text The new Text.
+   */
   void GLGuiInputLine::setText(const std::string& text)
   {
     this->text.setText(text);
     this->resize();
-  }
-
+
+    emit(this->textChanged(this->getText()));
+  }
+
+  /**
+   * @brief appends text to the InputLine
+   * @param appendText the Text to append
+   */
   void GLGuiInputLine::append(const std::string& appendText)
   {
     this->text.append(appendText);
     this->resize();
-  }
-
+    emit(this->textChanged(this->text.getText()));
+  }
+
+
+  /**
+   * @brief appends a Character to the InputLine
+   * @param character the Character to append.
+   */
   void GLGuiInputLine::appendCharacter(char character)
   {
     this->text.appendCharacter(character);
     this->resize();
-  }
-
-
+    emit(this->textChanged(this->text.getText()));
+  }
+
+
+  /**
+   * @brief Removes Characters from the InputLine
+   * @param chars The count of characters to remove
+   */
   void GLGuiInputLine::removeCharacters(unsigned int chars)
   {
     this->text.removeCharacters(chars);
     this->resize();
-  }
-
-
+    emit(this->textChanged(this->text.getText()));
+  }
+
+
+  /**
+   * removes the focus from this Widget.
+   */
   void GLGuiInputLine::removedFocus()
   {
@@ -88,4 +114,9 @@
 
 
+  /**
+   * Processes an Event.
+   * @param event The event to be processed
+   * @return true if the event was catched.
+   */
   bool GLGuiInputLine::processEvent(const Event& event)
   {
@@ -126,10 +157,20 @@
 
 
+  /**
+   * @brief Resizes the Widget to the new Size-constraints.
+   */
   void GLGuiInputLine::resize()
   {
     this->setSize2D( this->text.getSize2D() + Vector2D(8, 8));
-  }
-
-
+    GLGuiWidget::resize();
+    this->frontRect().setTopLeft(borderSize(), borderSize());
+    this->frontRect().setSize(this->getSize2D() - Vector2D(borderSize(), borderSize()));
+  }
+
+
+  /**
+   * ticks the InputLine
+   * @param dt the time passed.
+   */
   void GLGuiInputLine::tick(float dt)
   {
@@ -156,20 +197,14 @@
 
   /**
-   * draws the GLGuiInputLine
+   * @brief draws the GLGuiInputLine
    */
   void GLGuiInputLine::draw() const
   {
-    this->startDraw();
+    this->beginDraw();
     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();
+    GLGuiWidget::drawRect(this->frontRect());
+
     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 8035)
@@ -16,7 +16,10 @@
 {
 
-  //! This is part of the openglGUI class
+  //! This is InputLine part of the openglGUI class
   /**
+   * The InputLine 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 GLGuiInputLine : public OrxGui::GLGuiWidget
@@ -27,5 +30,7 @@
     virtual ~GLGuiInputLine();
 
-    void init();
+
+    /** @returns the text of the inputLine */
+    const std::string& getText() const { return this->text.getText(); };
 
     void setText(const std::string& text);
@@ -33,6 +38,4 @@
     void appendCharacter(char character);
     void removeCharacters(unsigned int chars);
-    const std::string& getName() const { return this->text.getText(); };
-
 
     virtual void removedFocus();
@@ -43,7 +46,9 @@
     virtual bool processEvent(const Event& event);
 
-    private:
-      void resize();
+    DeclareSignal1(textChanged, const std::string&);
 
+  private:
+    void init();
+    void resize();
 
   private:
@@ -55,8 +60,6 @@
     float                   delayNext;        //!< How much time must pass before next output.
 
-    static float            repeatDelay;
-    static float            repeatRate;
-
-
+    static float            repeatDelay;      //!< Repead Delay.
+    static float            repeatRate;       //!< Repeat Rate.
   };
 }
Index: trunk/src/lib/gui/gl_gui/glgui_pushbutton.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_pushbutton.cc	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_pushbutton.cc	(revision 8035)
@@ -47,4 +47,8 @@
     this->label.setRelCoor2D(5, 5);
     this->setSize2D(this->label.getSizeX2D() + 10, this->label.getSizeY2D() + 10);
+
+    GLGuiWidget::resize();
+    this->frontRect().setTopLeft(1, 1);
+    this->frontRect().setSize(this->getSizeX2D() -2, this->getSizeY2D() -2);
   }
 
@@ -70,15 +74,15 @@
   }
 
-  void GLGuiPushButton::clicked()
+  void GLGuiPushButton::clicking(const Vector2D& pos)
   {
     printf("%s clicked\n", this->getLabel().c_str());
-    GLGuiWidget::clicked();
+    GLGuiButton::clicking(pos);
   }
 
 
-  void GLGuiPushButton::released()
+  void GLGuiPushButton::releasing(const Vector2D& pos)
   {
     printf("%s released\n", this->getLabel().c_str());
-    GLGuiWidget::released();
+    GLGuiButton::releasing(pos);
   }
 
@@ -90,16 +94,9 @@
   void GLGuiPushButton::draw() const
   {
-    this->startDraw();
+    this->beginDraw();
     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);
-
-    glEnd();
+    this->drawRect(this->frontRect());
     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 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_pushbutton.h	(revision 8035)
@@ -27,14 +27,17 @@
 
 
-    virtual void resize();
-
-    virtual void receivedFocus();
-    virtual void removedFocus();
-    virtual void clicked();
-    virtual void released();
 
 
     virtual void draw() const;
     virtual void update();
+  protected:
+    virtual void resize();
+    virtual void clicking(const Vector2D& pos);
+    virtual void releasing(const Vector2D& pos);
+    virtual void receivedFocus();
+    virtual void removedFocus();
+
+
+
   private:
     void init();
Index: trunk/src/lib/gui/gl_gui/glgui_slider.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_slider.cc	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_slider.cc	(revision 8035)
@@ -17,4 +17,7 @@
 
 #include "glgui_slider.h"
+#include "event_def.h"
+
+#include "glgui_handler.h"
 
 namespace OrxGui
@@ -22,6 +25,6 @@
 
   /**
-   * standard constructor
-  */
+   * @brief standard constructor
+   */
   GLGuiSlider::GLGuiSlider ()
   {
@@ -32,24 +35,227 @@
 
   /**
-   * standard deconstructor
-  */
+   * @brief standard deconstructor
+   */
   GLGuiSlider::~GLGuiSlider()
-  {
-  }
-
-  /**
-   * initializes the GUI-element
+  {}
+
+  /**
+   * @brief initializes the GUI-element
    */
   void GLGuiSlider::init()
   {
+
     this->setClassID(CL_GLGUI_SLIDER, "GLGuiSlider");
 
-  }
-
-  /**
-   * draws the GLGuiSlider
+    this->setClickable( );
+    this->setFocusable( );
+
+    this->_value = 0.0;
+    this->_minValue = 0.0;
+    this->_maxValue = 1.0;
+    this->_step = 0.1;
+    this->_sliderWidth = 5.0;
+    this->grabbed = false;
+
+    this->setSize2D(100, 30);
+    this->resize();
+  }
+
+  /**
+   * @param value the new Value.
+   * @note will automatically be set between max() and min()
+   */
+  void GLGuiSlider::setValue(float value)
+  {
+    if (value < this->min())
+      this->_value = min();
+    else if (value > max())
+      this->_value = max();
+    else
+      this->_value = value;
+    emit(valueChanged(this->_value));
+  }
+
+  /**
+   * @param minimum the minumum of the range.
+   *
+   * @note will rearange value if necessary and will not be made bigger than max()
+   */
+  void GLGuiSlider::setMin(float minimum)
+  {
+    if (minimum <= max())
+    {
+      this->_minValue = minimum;
+      emit(rangeChanged(this->_minValue, this->_maxValue));
+    }
+    if (this->value() < this->min())
+      this->setValue(this->min());
+  }
+
+
+  /**
+   * @param maximum the maximum of the range.
+   *
+   * @note will rearange value if necessary and will not be made smaller than min()
+   */
+  void GLGuiSlider::setMax(float maximum)
+  {
+    if (maximum >= min())
+    {
+      this->_maxValue = maximum;
+      emit(rangeChanged(this->_minValue, this->_maxValue));
+    }
+    if (this->value() > this->max())
+      this->setValue(this->max());
+  }
+
+  /**
+   * @param minimum the minimum
+   * @param maximum the maximum
+   *
+   * @see setMax
+   * @see setMin
+   */
+  void GLGuiSlider::setRange(float minimum, float maximum)
+  {
+    if (minimum < maximum)
+    {
+      this->_minValue = minimum;
+      this->_maxValue = maximum;
+      emit(rangeChanged(this->_minValue, this->_maxValue));
+    }
+    if (this->value() < this->min())
+      this->setValue(this->min());
+    else if (this->value() > this->max())
+      this->setValue(this->max());
+  }
+
+  /**
+   * @brief sets the stepSize
+   */
+  void GLGuiSlider::setStep(float step)
+  {
+    this->_step = step;
+  }
+
+  /**
+   * @brief makes one step into the minus direction
+   */
+  void GLGuiSlider::stepMinus()
+  {
+    this->setValue(value() - step());
+  }
+
+  /**
+   * @brief makes one step into the minus direction
+   */
+  void GLGuiSlider::stepPlus()
+  {
+    this->setValue(value() + step());
+  }
+
+  /**
+   * @brief resizes the Slider, and through this Synchronizes the GUI-size.
+   */
+  void GLGuiSlider::resize()
+  {
+    GLGuiWidget::resize();
+    this->frontRect().setTopLeft(5, this->getSizeY2D()/2.0 - 2.0);
+    this->frontRect().setSize(this->getSizeX2D() - 10.0, 4.0);
+  }
+
+  /**
+   * @brief handle the clicked event.
+   * @param pos the position the Click occured (from the topleft corner out)
+   */
+  void GLGuiSlider::clicking(const Vector2D& pos)
+  {
+    GLGuiWidget::clicking(pos);
+
+    float sliderPosition = this->sliderPosition();
+    if (sliderPosition > pos.x + this->_sliderWidth)
+      this->setValue(this->value() - this->step());
+
+    else if (sliderPosition < pos.x - this->_sliderWidth)
+      this->setValue(this->value() + this->step());
+    else
+      this->grabbed = true;
+  }
+
+  void GLGuiSlider::releasing(const Vector2D& pos)
+  {
+    GLGuiWidget::releasing(pos);
+    this->grabbed = false;
+  }
+
+  void GLGuiSlider::removedFocus()
+  {
+    GLGuiWidget::removedFocus();
+    this->grabbed = false;
+  }
+
+  /**
+   * @returns the current SliderPosition calculated from the current value and the Silders' size.
+   */
+  float GLGuiSlider::sliderPosition() const
+  {
+    return (this->_value - this->_minValue)/( this->_maxValue - this->_minValue) *
+           (this->getSizeX2D() - 2.0*(borderSize() + _sliderWidth)) +
+           (borderSize() +_sliderWidth);
+  }
+
+  /**
+   * @param position the position relative from the left border.
+   * @returns the Value at the given position.
+   */
+  float GLGuiSlider::sliderValue(float position) const
+  {
+    return (position - (borderSize()+_sliderWidth)) / (this->getSizeX2D() - 2.0*(borderSize() + _sliderWidth))
+           *( this->_maxValue - this->_minValue) +
+           this->_minValue ;
+  }
+
+  void GLGuiSlider::tick(float dt)
+  {
+  }
+
+  /**
+   * @brief draws the GLGuiSlider
    */
   void GLGuiSlider::draw() const
   {
+    this->beginDraw();
+    GLGuiWidget::draw();
+
+    this->frontMaterial().select();
+    this->drawRect(this->frontRect());
+
+    this->drawRect(Rect2D(this->sliderPosition()-_sliderWidth/2.0, borderSize(), _sliderWidth, this->getSizeY2D() - 2 * borderSize()));
+
+    this->endDraw();
+  }
+
+
+  bool GLGuiSlider::processEvent( const Event& event )
+  {
+    if (this->grabbed && event.type == EV_MOUSE_MOTION)
+    {
+      this->setValue(sliderValue(GLGuiHandler::getInstance()->cursorPositionRel(this).x));
+      return true;
+    }
+    else if (event.bPressed)
+    {
+      if (event.type == SDLK_LEFT)
+      {
+        this->stepMinus();
+        return true;
+      }
+      else if (event.type == SDLK_RIGHT)
+      {
+        this->stepPlus();
+        return true;
+      }
+    }
+    return false;
   }
 }
Index: trunk/src/lib/gui/gl_gui/glgui_slider.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_slider.h	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_slider.h	(revision 8035)
@@ -17,5 +17,5 @@
   //! This is part of the openglGUI class
   /**
-   *
+   * The Slider is a Widget, with a Range and a Value.
    */
   class GLGuiSlider : public GLGuiWidget
@@ -26,7 +26,43 @@
     virtual ~GLGuiSlider();
 
+    /** @returns the Value of the Slider. */
+    float value() const { return this->_value; }
+    /** @returns the minimum of the sliders range */
+    float min() const { return this->_minValue; };
+    /** @returns the maximum of the sliders range */
+    float max() const { return this->_maxValue; };
+    /** @returns the step size */
+    float step() const { return this->_step; };
+
+    void setValue(float value);
+
+    void setMin(float minimum);
+    void setMax(float maximum);
+    void setRange(float minimum, float maximum);
+
+    void setStep(float step);
+
+    void stepPlus();
+    void stepMinus();
+
+
+    virtual void tick(float dt);
+    virtual bool processEvent(const Event& event);
+    virtual void draw() const;
+
+    DeclareSignal1(valueChanged, float);
+    DeclareSignal2(rangeChanged, float, float);
+
+  protected:
+    virtual void resize();
+
+    virtual void clicking(const Vector2D& pos);
+    virtual void releasing(const Vector2D& pos);
+    virtual void removedFocus();
+
+  private:
     void init();
-
-    virtual void draw() const;
+    float sliderPosition() const;
+    float sliderValue(float position) const;
 
   private:
@@ -35,6 +71,11 @@
     float            _maxValue;
     float            _minValue;
+    float            _step;
 
     float            _value;
+
+    float            _sliderWidth;
+
+    bool             grabbed;
 
   };
Index: trunk/src/lib/gui/gl_gui/glgui_text.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_text.h	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_text.h	(revision 8035)
@@ -26,7 +26,11 @@
     virtual ~GLGuiText();
 
+    void setText();
+
+    virtual void draw();
+
+  private:
     void init();
 
-    virtual void draw();
 
   private:
Index: trunk/src/lib/gui/gl_gui/glgui_textfield.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_textfield.cc	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_textfield.cc	(revision 8035)
@@ -43,13 +43,17 @@
   {
     this->setClassID(CL_GLGUI_TEXTFIELD, "GLGuiTextfield");
-
-
   }
 
   /**
-   * draws the GLGuiTextfield
+   * @brief draws the GLGuiTextfield
    */
   void GLGuiTextfield::draw() const
   {
+    this->beginDraw();
+    GLGuiWidget::draw();
+
+    this->frontMaterial().select();
+    this->drawRect(this->frontRect());
+    this->endDraw();
   }
 }
Index: trunk/src/lib/gui/gl_gui/glgui_widget.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_widget.cc	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_widget.cc	(revision 8035)
@@ -28,14 +28,16 @@
 
   /**
-   * standard constructor
+   * @brief standard constructor
   */
-  GLGuiWidget::GLGuiWidget ( )
+  GLGuiWidget::GLGuiWidget (GLGuiWidget* parent)
   {
     this->init();
-  }
-
-
-  /**
-   * standard deconstructor
+
+    this->setParentWidget(parent);
+  }
+
+
+  /**
+   * @brief standard deconstructor
    */
   GLGuiWidget::~GLGuiWidget()
@@ -45,4 +47,5 @@
   }
 
+  GLGuiWidget* GLGuiWidget::_selected = NULL;
   GLGuiWidget* GLGuiWidget::_focused = NULL;
   GLGuiWidget* GLGuiWidget::_inputGrabber = NULL;
@@ -63,10 +66,17 @@
     this->setVisibility(GLGUI_WIDGET_DEFAULT_VISIBLE);
 
-    this->backMat.setDiffuse(1.0, 1.0, 1.0);
-    this->frontMat.setDiffuse(1.0, 0.0, 0.0);
-
-    this->widgetSignals.resize(SignalCount, SignalConnector());
-  }
-
+    this->_backMat.setDiffuse(1.0, 1.0, 1.0);
+    this->_frontMat.setDiffuse(1.0, 0.0, 0.0);
+    this->_borderSize = 1.0;
+  }
+
+
+  void GLGuiWidget::setParentWidget(GLGuiWidget* parent)
+  {
+    this->_parent = parent;
+
+    if (parent != NULL)
+      parent->addChild2D(this);
+  }
 
   /** @brief gives focus to this widget */
@@ -93,5 +103,5 @@
   {
     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);
+            this->getAbsCoor2D().y < position.y && this->getAbsCoor2D().y + this->getSizeY2D() > position.y);
   }
 
@@ -101,20 +111,33 @@
   }
 
-  void GLGuiWidget::click()
+
+  void GLGuiWidget::setBorderSize(float borderSize)
+  {
+    this->_borderSize = borderSize;
+    this->resize();
+  }
+
+
+  void GLGuiWidget::resize()
+  {
+    this->backRect().setSize(this->getSize2D());
+    if (this->parent() != NULL)
+      this->parent()->resize();
+  }
+
+
+  void GLGuiWidget::click(const Vector2D& pos)
   {
     assert (!this->_pushed);
-    this->widgetSignals[Signal_click]("none");
     this->_pushed = true;
 
-    this->clicked();
-  }
-
-  void GLGuiWidget::release()
+    this->clicking(pos);
+  }
+
+  void GLGuiWidget::release(const Vector2D& pos)
   {
     if (this->_pushed)
     {
-      this->widgetSignals[Signal_release]("none");
-
-      this->released();
+      this->releasing(pos);
       this->_pushed = false;
     }
@@ -122,5 +145,5 @@
 
 
-  void GLGuiWidget::clicked()
+  void GLGuiWidget::clicking(const Vector2D& pos)
   {
     this->frontMaterial().setDiffuse(0, 0, 1);
@@ -128,7 +151,7 @@
   }
 
-  void GLGuiWidget::released()
-  {
-    this->frontMat.setDiffuse(0,1,0);
+  void GLGuiWidget::releasing(const Vector2D& pos)
+  {
+    this->frontMaterial().setDiffuse(0,1,0);
 
   }
@@ -146,60 +169,52 @@
 
   void GLGuiWidget::destroyed()
-  {
-  };
-
-
-
-
-  /**
-   * @brief connects a Signal to the Gui-Elements' Event.
-   * @param sinalType the Type of Signal to set. @see GLGuiSignalType
-   * @param signal the name of the Signal
+  {}
+  ;
+
+  void GLGuiWidget::setWidgetSize(const Vector2D& size)
+  {
+    this->setSize2D(size);
+    this->resize();
+
+  }
+
+
+  void GLGuiWidget::setWidgetSize(float x, float y)
+  {
+    this->setWidgetSize(Vector2D(x, y));
+  }
+
+
+
+  void GLGuiWidget::connect(GLGuiWidget* sender, Signal& signal, BaseObject* receiver, Slot executor)
+  {
+    sender->connect(signal, receiver, executor);
+  }
+
+  void GLGuiWidget::connect(Signal& signal, BaseObject* receiver, Slot executor)
+  {
+    signal.push_back(SignalConnector(receiver, executor));
+  }
+
+
+  void GLGuiWidget::show()
+  {
+    this->setVisibility(true);
+  }
+
+
+  void GLGuiWidget::hide()
+  {
+    this->setVisibility(false);
+  }
+
+
+  /**
+   * USE THIS FUNCTION ONLY FROM DERIVED CLASS
    */
-  void GLGuiWidget::connectSignal(SignalType signalType, BaseObject* object, const Executor* signal)
-  {
-    if (signalType >= this->widgetSignals.size())
-      return;
-
-//    if (this->widgetSignals[signalType] != NULL)
-//      PRINTF(2)("Already connected a Signal to '%s::%s' type %s... overwriting\n", this->getClassName(), this->getName(), "TEST");
-
-    this->widgetSignals[signalType] = SignalConnector(object, signal);
-  }
-
-  /**
-   * @brief removes a Signal from a Gui-ELements' Event
-   * @param signalType the type of Signal to remove.
-   */
-  void GLGuiWidget::disconnectSignal(SignalType signalType)
-  {
-    if (signalType >= this->widgetSignals.size())
-      return;
-
-    this->widgetSignals[signalType] = SignalConnector();
-  }
-
-
-  void GLGuiWidget::show()
-  {
-    this->setVisibility(true);
-  }
-
-  void GLGuiWidget::hide()
-  {
-    this->setVisibility(false);
-  }
-
-
   void GLGuiWidget::draw() const
   {
-    this->backMat.select();
-
-    glBegin(GL_QUADS);
-    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();
+    this->backMaterial().select();
+    this->drawRect(this->backRect());
   }
 
Index: trunk/src/lib/gui/gl_gui/glgui_widget.h
===================================================================
--- trunk/src/lib/gui/gl_gui/glgui_widget.h	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/glgui_widget.h	(revision 8035)
@@ -24,17 +24,4 @@
 namespace OrxGui
 {
-  typedef enum
-  {
-    Signal_click     = 0,
-    Signal_release,
-    Signal_rollOn,
-    Signal_rollOff,
-    Signal_open,
-    Signal_close,
-    Signal_destroy,
-
-    SignalCount,
-  } SignalType;
-
 
   class GLGuiCursor;
@@ -49,9 +36,6 @@
   class GLGuiWidget : public Element2D
   {
-
-  private:
-
   public:
-    GLGuiWidget();
+    GLGuiWidget(GLGuiWidget* parent = NULL);
     virtual ~GLGuiWidget();
 
@@ -59,8 +43,7 @@
     void hide();
 
-    /// INTERCONNECTIVITY
-    void connectSignal(SignalType signalType, BaseObject* obj, const Executor* signal);
-    void disconnectSignal(SignalType signalType);
 
+    void setParentWidget(GLGuiWidget* parent);
+    GLGuiWidget* parent() const { return this->_parent; }
 
     /// FOCUS
@@ -82,30 +65,59 @@
 
     /// CLICK
-    void click();
-    void release();
+    void click(const Vector2D& pos);
+    void release(const Vector2D& pos);
     bool clickable() const { return this->_clickable; };
     void setClickable(bool clickable = true) { this->_clickable = clickable; };
+
+    static void connect(GLGuiWidget* sender, Signal& signal, BaseObject* receiver, Slot executor);
+    void connect(Signal& signal, BaseObject* receiver, Slot executor);
+
+    void disconnect(GLGuiWidget* sender, Signal& signal, BaseObject* receiver);
+
+
+    /// MATERIAL (looks)
+    Material& backMaterial() { return this->_backMat; };
+    const Material& backMaterial() const { return this->_backMat; };
+    Rect2D& backRect() { return this->_backRect; };
+    const Rect2D& backRect() const { return this->_backRect; };
+
+    Material& frontMaterial() { return this->_frontMat; };
+    const Material& frontMaterial() const { return this->_frontMat; };
+    Rect2D& frontRect() { return this->_frontRect; };
+    const Rect2D& frontRect() const { return this->_frontRect; };
+
+    float borderSize() const { return this->_borderSize; };
+    void setBorderSize(float borderSize);
+
+    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); };
+
+    inline void drawRect(const Rect2D& rect) const {
+      glBegin(GL_QUADS);
+      glTexCoord2i(0,0); glVertex2d(rect.left(), rect.top());
+      glTexCoord2i(0,1); glVertex2d(rect.left(), rect.bottom());
+      glTexCoord2i(1,1); glVertex2d(rect.right(), rect.bottom());
+      glTexCoord2i(1,0); glVertex2d(rect.right(), rect.top());
+      glEnd();
+    }
+
 
     virtual void update() {};
     virtual void draw() const;
 
-
-    /// MATERIAL (looks)
-    Material& backMaterial() { return this->backMat; };
-    const Material& backMaterial() const { return this->backMat; };
-
-    Material& frontMaterial() { return this->frontMat; };
-    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) { };
 
+  protected:
 
-    DeclareSignal(testSignal, ());
+    /// LOOKS
+    virtual void resize();
 
-  protected:
-        // if something was clickt on the GUI-widget.
-    virtual void clicked();
-    virtual void released();
+    // if something was clickt on the GUI-widget.
+    virtual void clicking(const Vector2D& pos);
+    virtual void releasing(const Vector2D& pos);
     virtual void receivedFocus();
     virtual void removedFocus();
@@ -114,5 +126,5 @@
 
 
-    inline void startDraw() const { glPushMatrix(); glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); };
+    inline void beginDraw() const { glPushMatrix(); glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); };
     inline void endDraw() const { glPopMatrix(); };
 
@@ -122,14 +134,14 @@
 
   private:
+    GLGuiWidget*                   _parent;           //!< The parent of this Widget.
+
     /// LOOKS
-    Material                       backMat;
-    Rect2D                         backRect;
+    Material                       _backMat;
+    Rect2D                         _backRect;
 
-    Material                       frontMat;
-    Rect2D                         frontRect;
+    Material                       _frontMat;
+    Rect2D                         _frontRect;
 
-
-    /// SIGNALS
-    std::vector<SignalConnector>   widgetSignals;
+    float                          _borderSize;
 
     /// EVENTS
@@ -139,6 +151,9 @@
     bool                           _pushed;
 
-    static GLGuiWidget*            _focused;
-    static GLGuiWidget*            _inputGrabber;
+
+    static GLGuiWidget*            _selected;         //!< The currently selected Widget.
+    static GLGuiWidget*            _focused;          //!< The currently Focused Widget.
+
+    static GLGuiWidget*            _inputGrabber;     //!< The Widget that grabs input.
   };
 }
Index: trunk/src/lib/gui/gl_gui/signal_connector.cc
===================================================================
--- trunk/src/lib/gui/gl_gui/signal_connector.cc	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/signal_connector.cc	(revision 8035)
@@ -21,4 +21,7 @@
 {
 
+  /**
+   * @brief creates a clean SignalConnector
+   */
   SignalConnector::SignalConnector( )
   {
@@ -27,4 +30,10 @@
   }
 
+  /**
+   * @brief Creates a SignalConnector out of an ObjectPointer, and an Executor.
+   * @param object the Object the Executor will apply to.
+   * @param executor the Executor that will be executed.
+   * @return a new SignalConnector.
+   */
   SignalConnector::SignalConnector(BaseObject* object, const Executor* executor)
   {
@@ -33,4 +42,8 @@
   };
 
+  /**
+   * @brief Creates a SignalConnector as a copy of another one.
+   * @param signalConnector The SignalConnector to copy.
+   */
   SignalConnector::SignalConnector(const SignalConnector& signalConnector)
   {
@@ -39,4 +52,9 @@
   }
 
+  /**
+   * @brief deletes a SignalConnector.
+   *
+   * frees the stored executor
+   */
   SignalConnector::~SignalConnector()
   {
@@ -44,4 +62,9 @@
   }
 
+  /**
+   * @brief assignes a SignalConnector to the current one
+   * @param signalConnector the SignalConnector to assign to this one
+   * @return A Reference to this SignalConnector.
+   */
   SignalConnector& SignalConnector::operator=(const SignalConnector& signalConnector)
   {
@@ -51,9 +74,95 @@
   }
 
-  void SignalConnector::operator()(const std::string& parameters) const
+
+  /**
+   * @brief compares two SignalConnectors.
+   * @param signalConnector the SignalConnector to compare against this one.
+   * @return true if the Connectors are the same.
+   */
+  bool SignalConnector::operator==(const SignalConnector& signalConnector) const
+  {
+    return (this->object == signalConnector.object /* && this->exec == signalConnector.exec */ );
+  }
+
+
+  /**
+   * @brief Executes the SignalConnector.
+   */
+  void SignalConnector::operator()() const
+  {
+    if (this->isValid())
+      (*this->exec)(this->object, 0, NULL);
+  }
+
+  /**
+   * @brief Executes the SignalConnector.
+   * @param value0 First Value.
+   */
+  void SignalConnector::operator()(const MultiType& value0) const
   {
     if (exec != NULL && object != NULL)
-      (*this->exec)(this->object, parameters);
+      (*this->exec)(this->object, 1, &value0);
   }
 
+  /**
+   * @brief Executes the SignalConnector.
+   * @param value0 First Value
+   * @param value1 Second Value
+   */
+  void SignalConnector::operator()(const MultiType& value0, const MultiType& value1) const
+  {
+    if (exec != NULL && object != NULL)
+    {
+      MultiType mt[] = { value0, value1 };
+      (*this->exec)(this->object, 2, mt);
+    }
+  }
+
+  /**
+   * @brief Executes the SignalConnector.
+   * @param value0 First Value
+   * @param value1 Second Value
+   * @param value2 Third Value
+   */
+  void SignalConnector::operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2) const
+  {
+    if (exec != NULL && object != NULL)
+    {
+      MultiType mt[] = { value0, value1, value2 };
+      (*this->exec)(this->object, 3, mt);
+    }
+  }
+
+  /**
+   * @brief Executes the SignalConnector.
+   * @param value0 First Value
+   * @param value1 Second Value
+   * @param value2 Third Value
+   * @param value3 Fourth Value
+   */
+  void SignalConnector::operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2, const MultiType& value3) const
+  {
+    if (exec != NULL && object != NULL)
+    {
+      MultiType mt[] = { value0, value1, value2, value3 };
+      (*this->exec)(this->object, 4, mt);
+    }
+  }
+
+  /**
+   * @brief Executes the SignalConnector.
+   * @param value0 First Value
+   * @param value1 Second Value
+   * @param value2 Third Value
+   * @param value3 Fourth Value
+   * @param value3 Fifth Value
+   */
+  void SignalConnector::operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2, const MultiType& value3, const MultiType& value4) const
+  {
+    if (exec != NULL && object != NULL)
+    {
+      MultiType mt[] = { value0, value1, value2, value3, value4 };
+      (*this->exec)(this->object, 5, mt);
+    }
+  }
 }
Index: trunk/src/lib/gui/gl_gui/signal_connector.h
===================================================================
--- trunk/src/lib/gui/gl_gui/signal_connector.h	(revision 7919)
+++ trunk/src/lib/gui/gl_gui/signal_connector.h	(revision 8035)
@@ -12,17 +12,141 @@
 {
 
-#define DeclareSignal(name, params) \
+  //////////////// TO BE IGNORED BY YOU /////
+#define DeclareSignalBegin(SignalName) \
   public: \
-   void signal_ ##connect ##name(const SignalConnector& connector) { \
-     name ## connected.push_back(connector); \
+   void signal_ ## connect ## SignalName(const SignalConnector& connector) { \
+     SignalName ## connected.push_back(connector); \
+}\
+   Signal& getSignalVector_##SignalName () { return this->SignalName ## connected; }; \
+  private:
+
+#define DeclareSignalEnd(SignalName) \
+  Signal SignalName ## connected
+  /////////////////////////////////////////////
+
+
+  /**
+   * @brief declares a new Signal.
+   * @param SignalName the Name of the Signal.
+   */
+#define DeclareSignal0(SignalName) \
+  DeclareSignalBegin(SignalName) \
+   void  SignalName () { \
+     for (unsigned int i = 0; i < SignalName ## connected .size(); i++) \
+       SignalName ## connected[i] (); \
    }\
-  private: \
-   void  signal_ ## name params { \
-     for (unsigned int i = 0; i < name ## connected . size(); i++) \
-       name ## connected[i] ("TEST"); \
-   }\
-   std::vector<SignalConnector> name ## connected
+     DeclareSignalEnd(SignalName)
 
-  //! A class for Conncting Signals to Objects, inside of the GUI
+
+  /**
+   * @brief declares a new Signal.
+   * @param SignalName the Name of the Signal.
+   * @param param0 the first Parameter the Function takes
+   */
+#define DeclareSignal1(SignalName, param0) \
+  DeclareSignalBegin(SignalName) \
+   void  SignalName (param0 val0) { \
+     for (unsigned int i = 0; i < SignalName ## connected .size(); i++) \
+       SignalName ## connected[i] (val0); \
+    }\
+    DeclareSignalEnd(SignalName)
+
+  /**
+   * @brief declares a new Signal.
+   * @param SignalName the Name of the Signal.
+   * @param param0 the first Parameter the Function takes
+   * @param param1 the second Parameter the Function takes
+   */
+#define DeclareSignal2(SignalName, param0, param1) \
+  DeclareSignalBegin(SignalName) \
+   void  SignalName (param0 val0, param1 val1) { \
+     for (unsigned int i = 0; i < SignalName ## connected .size(); i++) \
+       SignalName ## connected[i] (val0, val1); \
+}\
+    DeclareSignalEnd(SignalName)
+
+
+
+  /**
+   * @brief declares a new Signal.
+   * @param SignalName the Name of the Signal.
+   * @param param0 the first Parameter the Function takes
+   * @param param1 the second Parameter the Function takes
+   * @param param2 the third Parameter the Function takes
+   */
+#define DeclareSignal3(SignalName, param0, param1, param2) \
+  DeclareSignalBegin(SignalName) \
+   void  SignalName (param0 val0, param1 val1, param2 val2) { \
+     for (unsigned int i = 0; i < SignalName ## connected .size(); i++) \
+       SignalName ## connected[i] (val0, val1, val2); \
+}\
+    DeclareSignalEnd(SignalName)
+
+  /**
+   * @brief declares a new Signal.
+   * @param SignalName the Name of the Signal.
+   * @param param0 the first Parameter the Function takes
+   * @param param1 the second Parameter the Function takes
+   * @param param2 the third Parameter the Function takes
+   * @param param3 the fourth Parameter the Function takes
+   */
+#define DeclareSignal4(SignalName, param0, param1, param2, param3) \
+  DeclareSignalBegin(SignalName) \
+   void  SignalName (param0 val0, param1 val1, param2 val2, param3 val3) { \
+     for (unsigned int i = 0; i < SignalName ## connected .size(); i++) \
+       SignalName ## connected[i] (val0, val1, val2, val3); \
+}\
+    DeclareSignalEnd(SignalName)
+
+
+  /**
+   * @brief declares a new Signal.
+   * @param SignalName the Name of the Signal.
+   * @param param0 the first Parameter the Function takes
+   * @param param1 the second Parameter the Function takes
+   * @param param2 the third Parameter the Function takes
+   * @param param4 the fifth Parameter the Function takes
+   */
+#define DeclareSignal5(SignalName, param0, param1, param2, param3, param4) \
+  DeclareSignalBegin(SignalName) \
+   void  SignalName (param0 val0, param1 val1, param2 val2, param3 val3, param4 val4) { \
+     for (unsigned int i = 0; i < SignalName ## connected .size(); i++) \
+       SignalName ## connected[i] (val0, val1, val2, val3, val4); \
+}\
+    DeclareSignalEnd(SignalName)
+
+
+  /**
+   * @brief selects a Signal.
+   * @param SignalName the Signal to be retrieved.
+   */
+#define SIGNAL(Object, SignalName) \
+    Object->getSignalVector_##SignalName()
+
+  /**
+   * @brief defines a Slot, the sink of a Signal.
+   * @param Class the Class the Slot belongs to.
+   * @param function the Function to Connect to.
+   */
+#define SLOT(Class, function) \
+    createExecutor<Class>(&Class::function)
+
+  /**
+   * @brief emits function
+   */
+#define emit(function) function
+
+  //! A class for Conncting Signals to Objects, inside of the Graphical user interface.
+  /**
+   * The SignalConnector binds an Object to a Functional (Executor)
+   * The Usage is quite easy in the Widget for this:
+   *
+   * int the header (Class Definition) you can add a definition of a Signal with:
+   * @verbatim DeclareSignal3(my_signal, int, int, float)
+   * and a Signal with the the Parameters int,int and float will be created.
+   *
+   * now you can use the connect function of GLWidget to connect this Signal to a Slot.
+   * @see GLGuiWidget::connect
+   */
   class SignalConnector
   {
@@ -34,8 +158,16 @@
 
     SignalConnector& operator=(const SignalConnector& signalConnector);
+    bool operator==(const SignalConnector& signalConnector) const;
 
-    void operator()(const std::string& parameters) const;
-    void execute(const std::string& parameters) const { (*this)(parameters); };
+    void operator()() const;
+    void operator()(const MultiType& value0) const;
+    void operator()(const MultiType& value0, const MultiType& value1) const;
+    void operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2) const;
+    void operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2, const MultiType& value3) const;
+    void operator()(const MultiType& value0, const MultiType& value1, const MultiType& value2, const MultiType& value3, const MultiType& value4) const;
 
+    /** checks wether the SignalConnector is valid @return true on valid. */
+    bool isValid() const { return (this->object && this->exec); };
+    /** @brief checks if the SignalConnector is clean, invalid @returns true if invalid */
     bool isClean() const { return (this->object == NULL || this->exec == NULL); }
 
@@ -45,4 +177,10 @@
     const Executor*      exec;           //!< The Executor, that will be called, on object.
   };
+
+  //! TypeDefinition for SignalLists
+  typedef std::vector<SignalConnector> Signal;
+  //! TypeDefinition for a Slot.
+  typedef Executor*                    Slot;
+
 }
 #endif /* _SIGNAL_CONNECTOR_H */
