Index: trunk/src/lib/gui/gl/Makefile.am
===================================================================
--- trunk/src/lib/gui/gl/Makefile.am	(revision 9406)
+++ trunk/src/lib/gui/gl/Makefile.am	(revision 9656)
@@ -13,6 +13,6 @@
 		\
 		glgui_handler.cc \
+		glgui_widget.cc \
 		glgui_mainwidget.cc \
-		glgui_widget.cc \
 		glgui_button.cc \
 		glgui_pushbutton.cc \
@@ -22,4 +22,5 @@
 		glgui_bar.cc \
 		glgui_box.cc \
+		glgui_fixedposition_box.cc \
 		glgui_frame.cc \
 		glgui_text.cc \
@@ -40,6 +41,6 @@
 		glgui_defs.h \
 		glgui_handler.h \
+		glgui_widget.h \
 		glgui_mainwidget.h \
-		glgui_widget.h \
 		glgui_button.h \
 		glgui_pushbutton.h \
@@ -49,4 +50,5 @@
 		glgui_bar.h \
 		glgui_box.h \
+		glgui_fixedposition_box.h \
 		glgui_frame.h \
 		glgui_text.h \
Index: trunk/src/lib/gui/gl/glgui.h
===================================================================
--- trunk/src/lib/gui/gl/glgui.h	(revision 9406)
+++ trunk/src/lib/gui/gl/glgui.h	(revision 9656)
@@ -14,4 +14,5 @@
 #include "glgui_bar.h"
 #include "glgui_box.h"
+#include "glgui_fixedposition_box.h"
 #include "glgui_button.h"
 #include "glgui_checkbutton.h"
Index: trunk/src/lib/gui/gl/glgui_box.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_box.cc	(revision 9406)
+++ trunk/src/lib/gui/gl/glgui_box.cc	(revision 9656)
@@ -18,4 +18,5 @@
 #include "glgui_box.h"
 #include <cassert>
+#include "debug.h"
 
 namespace OrxGui
@@ -36,5 +37,13 @@
   */
   GLGuiBox::~GLGuiBox()
-  {}
+  {
+    // unpack all the widgets.
+    while(!this->_children.empty())
+    {
+      /// not deleting children here.
+      this->_children.front()->setParentWidget(NULL);
+      this->_children.pop_front();
+    }
+  }
 
   /**
@@ -49,21 +58,80 @@
   {
     assert (widget != NULL);
-
-    this->children.push_back(widget);
+    this->_children.push_back(widget);
+
+    this->packing(widget);
+  }
+
+
+  void GLGuiBox::pack(GLGuiWidget* widget, std::list<GLGuiWidget*>::iterator pos)
+  {
+    this->_children.insert(pos, widget);
+    this->packing(widget);
+  }
+
+  void GLGuiBox::pack(GLGuiWidget* widget, unsigned int position)
+  {
+    if (this->_children.empty())
+      this->pack(widget);
+
+    unsigned int pos = 0;
+    std::list<GLGuiWidget*>::iterator it = this->_children.begin();
+
+    for (; pos < position; ++pos)
+    {
+      if (this->_children.end() == ++it)
+      {
+        PRINTF(2)("Reached end of packing list, without getting to the designated position %d (i am at %d)\n", position, pos);
+        this->pack(widget);
+      }
+    }
+    this->_children.insert(it, widget);
+    this->packing(widget);
+  }
+
+  void GLGuiBox::pack(GLGuiWidget* widget, const GLGuiWidget* widgetPointer)
+  {
+    assert (widget != NULL && widgetPointer != NULL);
+
+    std::list<GLGuiWidget*>::iterator it = this->_children.begin();
+    for (; it != this->_children.end(); ++it)
+    {
+      if (widgetPointer == *it)
+      {
+        this->_children.insert(it, widget);
+        this->packing(widget);
+        return;
+      }
+    }
+    PRINTF(2)("WidgetPointer %p not found, inserting at the end\n", widgetPointer);
+    this->pack(widget);
+  }
+
+  void GLGuiBox::packFront(GLGuiWidget* widget)
+  {
+    this->_children.push_front(widget);
+    this->packing(widget);
+  }
+
+  void GLGuiBox::packBack(GLGuiWidget* widget)
+  {
+    this->pack(widget);
+  }
+
+  void GLGuiBox::packing(GLGuiWidget* widget)
+  {
     widget->setParentWidget(this);
-
     this->resize();
   }
 
-
   void GLGuiBox::unpack(GLGuiWidget* widget)
   {
     assert(widget != NULL);
 
-    std::vector<GLGuiWidget*>::iterator delWidget = std::find(this->children.begin(), this->children.end(), widget);
-    if (delWidget != this->children.end())
+    std::list<GLGuiWidget*>::iterator delWidget = std::find(this->_children.begin(), this->_children.end(), widget);
+    if (delWidget != this->_children.end())
     {
       (*delWidget)->setParentWidget(NULL);
-      this->children.erase(delWidget);
+      this->_children.erase(delWidget);
     }
     this->resize();
@@ -72,5 +140,5 @@
   void GLGuiBox::clear()
   {
-    this->children.clear();
+    this->_children.clear();
     this->resize();
   }
@@ -78,6 +146,6 @@
   void GLGuiBox::showAll()
   {
-    std::vector<GLGuiWidget*>::iterator itC = this->children.begin();
-    while (itC != this->children.end())
+    std::list<GLGuiWidget*>::iterator itC = this->_children.begin();
+    while (itC != this->_children.end())
     {
       if ((*itC)->isA(CL_GLGUI_CONTAINER))
@@ -93,6 +161,6 @@
   void GLGuiBox::hideAll()
   {
-    std::vector<GLGuiWidget*>::iterator itC = this->children.begin();
-    while (itC != this->children.end())
+    std::list<GLGuiWidget*>::iterator itC = this->_children.begin();
+    while (itC != this->_children.end())
     {
       if ((*itC)->isA(CL_GLGUI_CONTAINER))
@@ -112,8 +180,8 @@
       float height = borderTop();
       float width = 0.0f;
-      std::vector<GLGuiWidget*>::iterator widget;
+      std::list<GLGuiWidget*>::iterator widget;
 
       // find out how big the Widgets are.
-      for (widget = this->children.begin(); widget != this->children.end(); ++widget)
+      for (widget = this->_children.begin(); widget != this->_children.end(); ++widget)
       {
         (*widget)->setRelCoor2D(borderLeft(), height);
@@ -131,8 +199,8 @@
       float height = borderTop();
       float width = borderLeft();
-      std::vector<GLGuiWidget*>::iterator widget;
+      std::list<GLGuiWidget*>::iterator widget;
 
       // find out how big the Widgets are.
-      for (widget = this->children.begin(); widget != this->children.end(); ++widget)
+      for (widget = this->_children.begin(); widget != this->_children.end(); ++widget)
       {
         (*widget)->setRelCoor2D(width, borderTop());
@@ -149,5 +217,5 @@
 
     // resize everything.
-    //for (widget = this->children.begin(); widget != this->children.end(); ++widget)
+    //for (widget = this->_children.begin(); widget != this->_children.end(); ++widget)
     //{}
   }
Index: trunk/src/lib/gui/gl/glgui_box.h
===================================================================
--- trunk/src/lib/gui/gl/glgui_box.h	(revision 9406)
+++ trunk/src/lib/gui/gl/glgui_box.h	(revision 9656)
@@ -1,4 +1,4 @@
 /*!
- * @file glgui_.h
+ * @file glgui_box.h
  * The gl_box widget of th openglGUI
  *
@@ -30,5 +30,10 @@
 
     virtual void pack(GLGuiWidget* widget);
+    void pack(GLGuiWidget* widget, unsigned int position);
+    void pack(GLGuiWidget* widget, const GLGuiWidget* widgetPointer);
+    void packFront(GLGuiWidget* widget);
+    void packBack(GLGuiWidget* widget);
     virtual void unpack(GLGuiWidget* widget);
+
     virtual void clear();
 
@@ -43,7 +48,12 @@
   private:
     void init();
+    void packing(GLGuiWidget* widget); // the action executing when packing a widget.
+    void pack(GLGuiWidget* widget, std::list<GLGuiWidget*>::iterator pos);
+
+  private:
+
 
     Orientation                _orientation;
-    std::vector<GLGuiWidget*>  children;
+    std::list<GLGuiWidget*>    _children;
   };
 }
Index: trunk/src/lib/gui/gl/glgui_container.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_container.cc	(revision 9406)
+++ trunk/src/lib/gui/gl/glgui_container.cc	(revision 9656)
@@ -48,4 +48,10 @@
 
 
+  void GLGuiContainer::removeChildWidget(GLGuiWidget* widget)
+  {
+    this->unpack(widget);
+  }
+
+
   /**
    * draws the GLGuiContainer
Index: trunk/src/lib/gui/gl/glgui_container.h
===================================================================
--- trunk/src/lib/gui/gl/glgui_container.h	(revision 9406)
+++ trunk/src/lib/gui/gl/glgui_container.h	(revision 9656)
@@ -38,4 +38,7 @@
     virtual void draw();
 
+  protected:
+    virtual void removeChildWidget(GLGuiWidget* widget);
+
   private:
     void init();
Index: trunk/src/lib/gui/gl/glgui_defs.h
===================================================================
--- trunk/src/lib/gui/gl/glgui_defs.h	(revision 9406)
+++ trunk/src/lib/gui/gl/glgui_defs.h	(revision 9656)
@@ -23,8 +23,37 @@
 
   //! Names of Orientations
-  const std::string OrientationString[] = {
-    "Horizontal",
-    "Vertical"
-  };
+  const std::string OrientationString[] =
+    {
+      "Horizontal",
+      "Vertical"
+    };
+
+  //! An enumeration for the Positions of some Elements (FixedPositionBox as an example).
+  typedef enum {
+    Left,               //!< Left
+    Right,              //!< Right
+    Top,                //!< Top
+    Bottom,             //!< Bottom
+    TopLeft,            //!< TopLeft
+    TopRight,           //!< TopRight
+    BottomLeft,         //!< BottomLeft
+    BottomRight,        //!< BottomRight
+    Center,             //!< Centered
+  } Position;
+
+  //! Names of Positions
+  const std::string PositionString[] =
+    {
+      "Left",
+      "Right",
+      "Top",
+      "Bottom",
+      "TopLeft",
+      "TopRight",
+      "BottomLeft",
+      "BottomRight",
+      "Center"
+    };
+
 
   //! An enumerator that defines the different states Widgets may be in.
@@ -39,5 +68,5 @@
 #define GLGUI_DEFAULT_STYLE OrxGui::Normal
 
-//! names of the States.
+  //! names of the States.
   const std::string StateString[] =
     {
@@ -48,14 +77,14 @@
     };
 
-    //! Where a Certain feature will be positioned at.
-    typedef enum {
-      FeatureLeft,          //!< On the Left side.
-      FeatureRight,         //!< On the Right side.
-      FeatureTop,           //!< On Top of the rest of the Widget.
-      FeatureBottom,        //!< At the Bottom of the rest of the Widget.
-    } FeaturePosition;
+  //! Where a Certain feature will be positioned at.
+  typedef enum {
+    FeatureLeft,          //!< On the Left side.
+    FeatureRight,         //!< On the Right side.
+    FeatureTop,           //!< On Top of the rest of the Widget.
+    FeatureBottom,        //!< At the Bottom of the rest of the Widget.
+  } FeaturePosition;
 
-    //! Names of Feature-Positions
-    const std::string FeaturePositionString[] =
+  //! Names of Feature-Positions
+  const std::string FeaturePositionString[] =
     {
       "Left",
Index: trunk/src/lib/gui/gl/glgui_fixedposition_box.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_fixedposition_box.cc	(revision 9656)
+++ trunk/src/lib/gui/gl/glgui_fixedposition_box.cc	(revision 9656)
@@ -0,0 +1,70 @@
+/*
+   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_fixedposition_box.h"
+#include "glgui_handler.h"
+
+#include <cassert>
+
+namespace OrxGui
+{
+  /**
+   * standard constructor
+  */
+  GLGuiFixedpositionBox::GLGuiFixedpositionBox (OrxGui::Position position, OrxGui::Orientation orientation)
+      : GLGuiBox(orientation)
+  {
+    this->subscribeEvent(ES_ALL, EV_VIDEO_RESIZE);
+    this->setPosition(position);
+  }
+
+
+  void GLGuiFixedpositionBox::setPosition(OrxGui::Position position)
+  {
+    this->_position = position;
+    this->resize();
+  }
+
+
+  void GLGuiFixedpositionBox::resize()
+  {
+    GLGuiBox::resize();
+
+    switch (this->_position)
+    {
+      case OrxGui::Center:
+        this->setAbsCoor2D((GLGuiHandler::getInstance()->resolution() - this->getSize2D()) / 2.0);
+        break;
+      default:
+        printf("not done mode yet!!\n");
+    }
+  }
+
+  void GLGuiFixedpositionBox::process(const Event& event)
+  {
+    switch(event.type)
+    {
+      case EV_VIDEO_RESIZE:
+        this->resize();
+        break;
+
+    }
+
+  }
+
+
+}
Index: trunk/src/lib/gui/gl/glgui_fixedposition_box.h
===================================================================
--- trunk/src/lib/gui/gl/glgui_fixedposition_box.h	(revision 9656)
+++ trunk/src/lib/gui/gl/glgui_fixedposition_box.h	(revision 9656)
@@ -0,0 +1,38 @@
+/*!
+ * @file glgui_fixedposition_box.h
+ * The gl_fixedposition_box widget of th openglGUi
+ */
+
+#ifndef _GLGUI_FIXEDPOSITION_BOX_H
+#define _GLGUI_FIXEDPOSITION_BOX_H
+
+#include "glgui_box.h"
+#include "event_listener.h"
+
+namespace OrxGui
+{
+  //! This is BOX part of the openglGUI class
+  /**
+   * The Box is always positioned at the designated position on the screen
+   *
+   * @note If you pack the box or move it with setRel/AbsCoor2D the
+   * behaviour of positioning is not predictable!
+   */
+  class GLGuiFixedpositionBox : public OrxGui::GLGuiBox, EventListener
+  {
+
+    public:
+      GLGuiFixedpositionBox(OrxGui::Position position = OrxGui::Center, OrxGui::Orientation orientation = OrxGui::Vertical);
+
+      inline OrxGui::Position position() const { return this->_position; };
+      void setPosition(OrxGui::Position position);
+
+    protected:
+      virtual void resize();
+      virtual void process(const Event& event); //!< from eventListener
+
+    private:
+      OrxGui::Position     _position;     //!< The Fixed position of the Widget.
+  };
+}
+#endif /* _GLGUI_FIXEDPOSITION_BOX_H */
Index: trunk/src/lib/gui/gl/glgui_handler.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_handler.cc	(revision 9406)
+++ trunk/src/lib/gui/gl/glgui_handler.cc	(revision 9656)
@@ -28,6 +28,4 @@
 #include "debug.h"
 
-#include <cassert>
-
 
 /// TAKE THIS OUT OF HERE.
@@ -46,4 +44,5 @@
     this->setName("GLGuiHandler");
 
+    this->_resolution = Vector2D(GraphicsEngine::getInstance()->getResolutionX(), GraphicsEngine::getInstance()->getResolutionY());
 
     EventHandler::getInstance()->withUNICODE(ES_MENU, true );
@@ -52,5 +51,7 @@
     for (unsigned int i = 0; i < EV_NUMBER; i++)
     {
-      this->subscribeEvent(ES_ALL, i);
+      this->subscribeEvent(ES_GAME, i);
+      this->subscribeEvent(ES_GAME_MENU, i);
+      this->subscribeEvent(ES_MENU, i);
     }
   }
@@ -88,4 +89,11 @@
       this->_cursor = NULL;
     }
+  }
+
+  const Vector2D& GLGuiHandler::resolution()
+  {
+    if (this->_resolution == Vector2D::nullVector())
+      this->_resolution = Vector2D(GraphicsEngine::getInstance()->getResolutionX(), GraphicsEngine::getInstance()->getResolutionY());
+    return _resolution;
   }
 
@@ -244,5 +252,7 @@
         if (this->_cursor != NULL)
           this->_cursor->setMaxBorders(Vector2D(event.resize.w, event.resize.h));
-        break;
+        this->_resolution = Vector2D(event.resize.w, event.resize.h);
+        break;
+
       case SDLK_TAB:
         if (event.bPressed)
Index: trunk/src/lib/gui/gl/glgui_handler.h
===================================================================
--- trunk/src/lib/gui/gl/glgui_handler.h	(revision 9406)
+++ trunk/src/lib/gui/gl/glgui_handler.h	(revision 9656)
@@ -12,8 +12,7 @@
 namespace OrxGui
 {
-
+ // FORWARD DECLARATION
   class GLGuiCursor;
 
-  // FORWARD DECLARATION
 
   //! A singleton class for the GLGui-Handler
@@ -22,7 +21,8 @@
 
   public:
-    virtual ~GLGuiHandler(void);
     /** @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; };
+    /** @brief deletes the instance if it exists */
+    inline static void deleteInstance() { if (GLGuiHandler::singletonRef) delete GLGuiHandler::singletonRef; };
 
     void activateCursor();
@@ -33,4 +33,6 @@
     const Vector2D& cursorPositionAbs() const;
     Vector2D cursorPositionRel(const GLGuiWidget* const widget) const;
+
+    const Vector2D& resolution();
 
     void selectNext();
@@ -48,4 +50,5 @@
   private:
     GLGuiHandler(void);
+    virtual ~GLGuiHandler(void);
     static GLGuiHandler* singletonRef;
 
@@ -53,4 +56,5 @@
     bool                 isActive;
     GLGuiCursor*         _cursor;
+    Vector2D             _resolution;
 
   };
Index: trunk/src/lib/gui/gl/glgui_text.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_text.cc	(revision 9406)
+++ trunk/src/lib/gui/gl/glgui_text.cc	(revision 9656)
@@ -101,6 +101,7 @@
   {
     this->_text.clear();
-    this->changedText();
+    this->resize();
   }
+
 
   /**
@@ -114,4 +115,16 @@
     this->setFrontColor(_changedTextColor, true);
     this->textChanged.emit(this->_text.text());
+  }
+
+  void GLGuiText::setTextSize(float size)
+  {
+    this->_text.setSize(size);
+    this->changedText();
+  }
+
+  void GLGuiText::setFont(const Font& font)
+  {
+    GLGuiWidget::setFont(font);
+    this->_text.setFont(font);
   }
 
Index: trunk/src/lib/gui/gl/glgui_text.h
===================================================================
--- trunk/src/lib/gui/gl/glgui_text.h	(revision 9406)
+++ trunk/src/lib/gui/gl/glgui_text.h	(revision 9656)
@@ -31,4 +31,6 @@
     void clear();
 
+    void setTextSize(float size);
+    virtual void setFont(const Font& font);
     void setChangedTextColor(const Color& color);
 
Index: trunk/src/lib/gui/gl/glgui_widget.cc
===================================================================
--- trunk/src/lib/gui/gl/glgui_widget.cc	(revision 9406)
+++ trunk/src/lib/gui/gl/glgui_widget.cc	(revision 9656)
@@ -79,4 +79,7 @@
     if (this == GLGuiWidget::selected())
       this->unselect();
+
+    if (this->_parent != NULL)
+      this->_parent->removeChildWidget(this);
   }
 
@@ -84,5 +87,5 @@
   GLGuiWidget* GLGuiWidget::_mouseFocused = NULL;
   GLGuiWidget* GLGuiWidget::_inputGrabber = NULL;
-
+  Font* GLGuiWidget::_defaultFont = NULL;
 
 
@@ -100,6 +103,8 @@
     this->_state = OrxGui::Normal;
 
-
-    this->_font = Font(ResourceManager::getInstance()->getDataDir() + "/fonts/final_frontier.ttf", 20);
+    if(GLGuiWidget::_defaultFont == NULL)
+      GLGuiWidget::_defaultFont = new Font(ResourceManager::getInstance()->getDataDir() + "/fonts/final_frontier.ttf", 20);
+
+    this->_font = *GLGuiWidget::_defaultFont;
     this->resetStyle();
 
@@ -776,5 +781,5 @@
   void GLGuiWidget::setFont(const std::string& fontName, unsigned int renderSize)
   {
-    this->_font = Font(fontName, renderSize);
+    this->setFont(Font(fontName, renderSize));
   }
 
Index: trunk/src/lib/gui/gl/glgui_widget.h
===================================================================
--- trunk/src/lib/gui/gl/glgui_widget.h	(revision 9406)
+++ trunk/src/lib/gui/gl/glgui_widget.h	(revision 9656)
@@ -206,6 +206,6 @@
     void setFeaturePositionS(const std::string& featurePosition);
 
-    void setFont(const Font& font);
-    void setFont(const std::string& fontName, unsigned int renderSize);
+    virtual void setFont(const Font& font);
+    void setFont(const std::string& fontName, unsigned int renderSize = FONT_DEFAULT_RENDER_SIZE);
 
     void setAnimatedStateChanges(bool animated);
@@ -270,4 +270,7 @@
     virtual void destroying();
 
+    // unparent the widget and from this widget seen as parent
+    virtual void removeChildWidget(GLGuiWidget* widget) {};
+
 
     virtual void debug(unsigned int level) const;
@@ -323,4 +326,5 @@
     Font                           _font;                 //!< The Font used in the current Widget.
 
+    static Font*                   _defaultFont;          //!< The default Font.
 
     /// ANIMATION STUFF:
