Index: /branches/gui/src/story_entities/simple_game_menu.cc
===================================================================
--- /branches/gui/src/story_entities/simple_game_menu.cc	(revision 7917)
+++ /branches/gui/src/story_entities/simple_game_menu.cc	(revision 7918)
@@ -48,5 +48,5 @@
 
 SimpleGameMenu::SimpleGameMenu(const TiXmlElement* root)
-  : GameWorld()
+    : GameWorld()
 {
   this->setClassID(CL_SIMPLE_GAME_MENU, "SimpleGameMenu");
@@ -67,12 +67,28 @@
   ///(this is as modular as it is possible).
   OrxGui::GLGuiPushButton* pb = new OrxGui::GLGuiPushButton("PUSH ME");
+  pb->connectSignal(OrxGui::Signal_release, this, createExecutor<SimpleGameMenu>(&SimpleGameMenu::enterGui));
   pb->show();
   pb->setAbsCoor2D(50, 50);
 
-  OrxGui::GLGuiButton* dnpb = new OrxGui::GLGuiCheckButton("DO NOT PUSH ME");
+  OrxGui::GLGuiHandler::getInstance()->activateCursor();
+  OrxGui::GLGuiHandler::getInstance()->activate();
+  /////
+
+  if (root != NULL)
+    this->loadParams(root);
+
+  State::setMenuID(this->getNextStoryID());
+}
+
+/// HACK only for testing.
+void SimpleGameMenu::enterGui()
+{
+  ///
+  OrxGui::GLGuiButton* dnpb = new OrxGui::GLGuiCheckButton("Push the button");
   dnpb->show();
   dnpb->setAbsCoor2D(350, 50);
-
-  OrxGui::GLGuiPushButton* rdnpb = new OrxGui::GLGuiPushButton("REALLY DO NOT PUSH ME!!");
+  dnpb->connectSignal(OrxGui::Signal_release, this, createExecutor<SimpleGameMenu>(&SimpleGameMenu::execURL));
+
+  OrxGui::GLGuiPushButton* rdnpb = new OrxGui::GLGuiPushButton("Quit ORXONOX!!");
   rdnpb->show();
   rdnpb->setAbsCoor2D(200, 180);
@@ -84,21 +100,46 @@
   input->setAbsCoor2D(200, 230);
 
-  OrxGui::GLGuiHandler::getInstance()->activateCursor();
-  OrxGui::GLGuiHandler::getInstance()->activate();
+
   /////
-
-  if (root != NULL)
-    this->loadParams(root);
-
-  State::setMenuID(this->getNextStoryID());
-}
-
-
-/**
- *  @brief remove the SimpleGameMenu from memory
- *
- *  delete everything explicitly, that isn't contained in the parenting tree!
- *  things contained in the tree are deleted automaticaly
- */
+}
+
+
+#include "threading.h"
+void SimpleGameMenu::execURL() const
+{
+  std::string URL = "http://www.orxonox.net";
+  SDL_CreateThread(startURL, (void*)&URL);
+}
+
+#ifdef __OSX__
+#include <ApplicationServices/ApplicationServices.h>
+#elif defined __WIN32__
+#include <shellapi.h>
+#endif
+
+int SimpleGameMenu::startURL(void* url)
+{
+  std::string URL = *(std::string*)url;
+#ifdef __linux__
+  system ((std::string("firefox ") + URL).c_str());
+#elif defined __OSX__
+    CFURLRef url_handle = CFURLCreateWithBytes (NULL, (UInt8 *)URL.c_str(), URL.size(),
+                                         kCFStringEncodingASCII, NULL);
+    LSOpenCFURLRef (url_handle, NULL);
+    CFRelease (url_handle);
+#elif defined __WIN32__
+    ShellExecute(GetActiveWindow(),
+                 "open", URL.c_str(), NULL, NULL, SW_SHOWNORMAL);
+  }
+#endif
+  PRINTF(3)("loaded external webpage %s\n", URL.c_str());
+}
+
+/**
+*  @brief remove the SimpleGameMenu from memory
+*
+*  delete everything explicitly, that isn't contained in the parenting tree!
+*  things contained in the tree are deleted automaticaly
+*/
 SimpleGameMenu::~SimpleGameMenu ()
 {
@@ -112,7 +153,7 @@
 
 /**
- * @brief loads the parameters of a SimpleGameMenu from an XML-element
- * @param root the XML-element to load from
- */
+* @brief loads the parameters of a SimpleGameMenu from an XML-element
+* @param root the XML-element to load from
+*/
 void SimpleGameMenu::loadParams(const TiXmlElement* root)
 {
@@ -126,9 +167,9 @@
 
 /**
- * @brief this is executed just before load
- *
- * since the load function sometimes needs data, that has been initialized
- * before the load and after the proceeding storyentity has finished
- */
+* @brief this is executed just before load
+*
+* since the load function sometimes needs data, that has been initialized
+* before the load and after the proceeding storyentity has finished
+*/
 ErrorMessage SimpleGameMenu::init()
 {
@@ -152,6 +193,6 @@
 
 /**
- * @brief load the data
- */
+* @brief load the data
+*/
 ErrorMessage SimpleGameMenu::loadData()
 {
@@ -172,5 +213,5 @@
     {
       element = element->FirstChildElement();
-    // load Players/Objects/Whatever
+      // load Players/Objects/Whatever
       PRINTF(4)("Loading Elements\n");
       while( element != NULL)
@@ -219,5 +260,5 @@
       this->menuStartMultiplayerGame->setBindNode((const PNode*)NULL);
       this->menuStartMultiplayerGame->setRelCoor2D(State::getResX() / 2.0f,
-                                                   State::getResY() / 2.0f + ((this->menuLayers[0].menuList.size() -1 ) * 60.0f));
+          State::getResY() / 2.0f + ((this->menuLayers[0].menuList.size() -1 ) * 60.0f));
       this->menuLayers[0].menuList.push_back(dynamic_cast<TextElement*>(*entity));
     }
@@ -267,7 +308,7 @@
 
 /**
- * @brief set the Sound to play when switching menu entry.
- * @param selectorSound the sound to load.
- */
+* @brief set the Sound to play when switching menu entry.
+* @param selectorSound the sound to load.
+*/
 void SimpleGameMenu::setSelectorSound(const std::string& selectorSound)
 {
@@ -303,6 +344,6 @@
 
 /**
- * @brief start the menu
- */
+* @brief start the menu
+*/
 bool SimpleGameMenu::start()
 {
@@ -316,6 +357,6 @@
 
 /**
- * stop the menu
- */
+* stop the menu
+*/
 bool SimpleGameMenu::stop()
 {
@@ -328,6 +369,6 @@
 
 /**
- *  override the standard tick for more functionality
- */
+*  override the standard tick for more functionality
+*/
 void SimpleGameMenu::tick()
 {
@@ -342,15 +383,15 @@
 
 /**
- * @brief no collision detection in the menu
- */
+* @brief no collision detection in the menu
+*/
 void SimpleGameMenu::collide()
 {
-//   this->dataTank->localCamera->
-}
-
-
-/**
- * @brief animate the scene
- */
+  //   this->dataTank->localCamera->
+}
+
+
+/**
+* @brief animate the scene
+*/
 void SimpleGameMenu::animateScene(float dt)
 {
@@ -369,7 +410,7 @@
 
 /**
- * @brief event dispatcher funciton
- * @param event the incoming event
- */
+* @brief event dispatcher funciton
+* @param event the incoming event
+*/
 void SimpleGameMenu::process(const Event &event)
 {
@@ -454,8 +495,8 @@
 
 /**
- * @brief switches to from one meny layer to an other
- * @param layer1 from layer
- * @param layer2 to layer
- */
+* @brief switches to from one meny layer to an other
+* @param layer1 from layer
+* @param layer2 to layer
+*/
 void SimpleGameMenu::switchMenuLayer(int layer1, int layer2)
 {
@@ -517,17 +558,17 @@
 
 /**********************************************************************************************
-    SimpleGameMenuData
- **********************************************************************************************/
-
-
-/**
- * SimpleGameMenuData constructor
- */
+SimpleGameMenuData
+**********************************************************************************************/
+
+
+/**
+* SimpleGameMenuData constructor
+*/
 SimpleGameMenuData::SimpleGameMenuData()
 {}
 
 /**
- * SimpleGameMenuData decontructor
- */
+* SimpleGameMenuData decontructor
+*/
 SimpleGameMenuData::~SimpleGameMenuData()
 {}
@@ -535,6 +576,6 @@
 
 /**
- *  initialize the GameWorldDataData
- */
+*  initialize the GameWorldDataData
+*/
 ErrorMessage SimpleGameMenuData::init()
 {
@@ -545,7 +586,7 @@
 
 /**
- *  loads the GUI data
- * @param root reference to the xml root element
- */
+*  loads the GUI data
+* @param root reference to the xml root element
+*/
 ErrorMessage SimpleGameMenuData::loadGUI(const TiXmlElement* root)
 {
@@ -556,6 +597,6 @@
 
 /**
- *  unloads the GUI data
- */
+*  unloads the GUI data
+*/
 ErrorMessage SimpleGameMenuData::unloadGUI()
 {
@@ -566,7 +607,7 @@
 
 /**
- *  overloads the GameWorld::loadWorldEntities(...) class since the menu WorldEntity loading is different (less loading stuff)
- * @param root reference to the xml root parameter
- */
+*  overloads the GameWorld::loadWorldEntities(...) class since the menu WorldEntity loading is different (less loading stuff)
+* @param root reference to the xml root parameter
+*/
 ErrorMessage SimpleGameMenuData::loadWorldEntities(const TiXmlElement* root)
 {
@@ -577,20 +618,20 @@
   if( element != NULL)
   {
-    element = element->FirstChildElement();
-    PRINTF(4)("Loading WorldEntities\n");
-    while(element != NULL)
-    {
-      BaseObject* created = Factory::fabricate(element);
-      if( created != NULL )
-        printf("Created a %s: %s\n", created->getClassName(), created->getName());
-
-      if( element->Value() == "SkyBox")
-        this->sky = dynamic_cast<WorldEntity*>(created);
-      if( element->Value() == "Terrain")
-        this->terrain = dynamic_cast<Terrain*>(created);
-      element = element->NextSiblingElement();
-    }
-
-    PRINTF(4)("Done loading WorldEntities\n");
+  element = element->FirstChildElement();
+  PRINTF(4)("Loading WorldEntities\n");
+  while(element != NULL)
+  {
+  BaseObject* created = Factory::fabricate(element);
+  if( created != NULL )
+  printf("Created a %s: %s\n", created->getClassName(), created->getName());
+
+  if( element->Value() == "SkyBox")
+  this->sky = dynamic_cast<WorldEntity*>(created);
+  if( element->Value() == "Terrain")
+  this->terrain = dynamic_cast<Terrain*>(created);
+  element = element->NextSiblingElement();
+  }
+
+  PRINTF(4)("Done loading WorldEntities\n");
   }
 
@@ -602,6 +643,6 @@
 
 /**
- *  unloads the world entities from the xml file
- */
+*  unloads the world entities from the xml file
+*/
 ErrorMessage SimpleGameMenuData::unloadWorldEntities()
 {
@@ -612,7 +653,7 @@
 
 /**
- *  loads the scene data
- * @param root reference to the xml root element
- */
+*  loads the scene data
+* @param root reference to the xml root element
+*/
 ErrorMessage SimpleGameMenuData::loadScene(const TiXmlElement* root)
 {
@@ -623,6 +664,6 @@
 
 /**
- *  unloads the scene data
- */
+*  unloads the scene data
+*/
 ErrorMessage SimpleGameMenuData::unloadScene()
 {
Index: /branches/gui/src/story_entities/simple_game_menu.h
===================================================================
--- /branches/gui/src/story_entities/simple_game_menu.h	(revision 7917)
+++ /branches/gui/src/story_entities/simple_game_menu.h	(revision 7918)
@@ -49,4 +49,9 @@
     virtual ~SimpleGameMenu();
 
+    /// TODO TAKE THIS OUT
+    void enterGui();
+    void execURL() const;
+    static int startURL(void* data);
+    ///
     virtual void loadParams(const TiXmlElement* root);
 
