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;
   };
 }
