Revision: 6906
          http://playerstage.svn.sourceforge.net/playerstage/?rev=6906&view=rev
Author:   natepak
Date:     2008-07-23 05:01:11 +0000 (Wed, 23 Jul 2008)

Log Message:
-----------
Updates to the toolbar

Modified Paths:
--------------
    code/gazebo/trunk/server/gui/Gui.cc
    code/gazebo/trunk/server/gui/SConscript
    code/gazebo/trunk/server/gui/Toolbar.cc
    code/gazebo/trunk/server/gui/Toolbar.hh
    code/gazebo/trunk/worlds/simpleshapes.world

Modified: code/gazebo/trunk/server/gui/Gui.cc
===================================================================
--- code/gazebo/trunk/server/gui/Gui.cc 2008-07-23 02:39:35 UTC (rev 6905)
+++ code/gazebo/trunk/server/gui/Gui.cc 2008-07-23 05:01:11 UTC (rev 6906)
@@ -54,14 +54,22 @@
   // The order of creation matters! Menubar first, followed by FrameManager,
   // then statusbar
   {
+    int toolbarWidth = 200;
+
     // Create a main menu
     new MainMenu(0,0,w(),30,(char *)"MainMenu");
 
     // Create the frame mamanger
-    this->frameMgr = new GLFrameManager(0,30, this->w(), this->h()-60, "");
+    this->frameMgr = new GLFrameManager(0, 30, 
+                         this->w()-toolbarWidth, this->h()-60, "");
 
+    this->toolbar = new Toolbar(this->w() - toolbarWidth, 30,
+                                toolbarWidth, this->h() - 60);
+
     // Create the status bar
-    this->statusbar = new StatusBar(0, height-30, width, 30);
+    this->statusbar = new StatusBar(0, height-30, 
+                         width-toolbarWidth, 30);
+
     this->statusbar->gui = this;
   }
 
@@ -110,7 +118,7 @@
 
////////////////////////////////////////////////////////////////////////////////
 void Gui::Update()
 {
-  //this->toolbar->Update();
+  this->toolbar->Update();
   this->statusbar->Update();
   this->frameMgr->Update();
   Fl::check();

Modified: code/gazebo/trunk/server/gui/SConscript
===================================================================
--- code/gazebo/trunk/server/gui/SConscript     2008-07-23 02:39:35 UTC (rev 
6905)
+++ code/gazebo/trunk/server/gui/SConscript     2008-07-23 05:01:11 UTC (rev 
6906)
@@ -18,7 +18,7 @@
            'server/gui/StatusBar.hh',
            'server/gui/Toolbar.hh',
            'server/gui/GLFrameManager.hh',
-           'server/gui/GLFrame.hh'
+           'server/gui/GLFrame.hh',
            ] )
 
 staticObjs.append(env.StaticObject(sources))

Modified: code/gazebo/trunk/server/gui/Toolbar.cc
===================================================================
--- code/gazebo/trunk/server/gui/Toolbar.cc     2008-07-23 02:39:35 UTC (rev 
6905)
+++ code/gazebo/trunk/server/gui/Toolbar.cc     2008-07-23 05:01:11 UTC (rev 
6906)
@@ -29,6 +29,8 @@
 #include <FL/Fl_Output.H>
 #include <FL/Fl_Button.H>
 
+#include "Entity.hh"
+#include "Simulator.hh"
 #include "CameraManager.hh"
 #include "OgreCamera.hh"
 #include "Toolbar.hh"
@@ -39,13 +41,13 @@
 Toolbar::Toolbar(int x, int y, int w, int h, const char *l)
     : Fl_Group(x,y,w,h,l)
 {
-/*  char *buffer = new char[256];
+  char *buffer = new char[256];
 
   this->box(FL_UP_BOX);
 
-  OgreCamera *camera = CameraManager::Instance()->GetActiveCamera();
+  //OgreCamera *camera = CameraManager::Instance()->GetActiveCamera();
 
-  if (camera)
+  /*if (camera)
   {
     sprintf(buffer,"%s [%d x %d]", camera->GetName().c_str(), 
camera->GetImageWidth(), camera->GetImageHeight());
 
@@ -54,18 +56,19 @@
   {
     sprintf(buffer,"Camera");
   }
+  */
 
-  this->cameraInfoGrp = new Fl_Group(x+10,y+20,w-20,25*5, "Camera");
+  this->entityInfoGrp = new Fl_Group(x+10,y+20,w-20,25*5, "Entity");
 
   // Camera Info Group
-  this->cameraInfoGrp->box(FL_BORDER_BOX);
+  this->entityInfoGrp->box(FL_BORDER_BOX);
 
-  // Camera name output
-  x = this->cameraInfoGrp->x()+20;
-  y = this->cameraInfoGrp->y()+2;
-  this->cameraName = new Fl_Output(x,y,this->cameraInfoGrp->w()-44,20);
+  // Entity name output
+  x = this->entityInfoGrp->x()+50;
+  y = this->entityInfoGrp->y()+2;
+  this->entityName = new Fl_Output(x,y, this->entityInfoGrp->w()-55,20, "Name: 
");
 
-  // Prev camera button
+  /*// Prev camera button
   x = this->cameraInfoGrp->x()+2;
   y = this->cameraInfoGrp->y()+2;
   this->prevCameraButton = new Fl_Button(x,y,16,20,"<");
@@ -118,15 +121,15 @@
   y = this->outputPitch->y() + this->outputPitch->h() + 5;
   this->outputYaw = new Fl_Value_Output(x,y,60,20,"Y");
   this->outputYaw->precision(2);
+  */
 
-  this->cameraInfoGrp->end();
+  this->entityInfoGrp->end();
 
   this->end();
 
   this->resizable(NULL);
 
   delete buffer;
-  */
 }
 
 Toolbar::~Toolbar()
@@ -137,6 +140,18 @@
 /// Update the toolbar data
 void Toolbar::Update()
 {
+  char *buffer = new char[256];
+  Entity *entity = Simulator::Instance()->GetSelectedEntity();
+
+  if (entity)
+  {
+    sprintf(buffer,"%s", entity->GetName().c_str());
+    if (strcmp(buffer, this->entityName->value()) != 0)
+    {
+      this->entityName->value(buffer);
+    }
+  }
+
   /*char *buffer = new char[256];
   OgreCamera *camera = CameraManager::Instance()->GetActiveCamera();
 
@@ -167,12 +182,12 @@
   */
 }
 
-void Toolbar::PrevCameraButtonCB(Fl_Widget * /*w*/, void *data)
-{
+//void Toolbar::PrevCameraButtonCB(Fl_Widget * /*w*/, void *data)
+//{
   //CameraManager::Instance()->DecActiveCamera();
-}
+//}
 
-void Toolbar::NextCameraButtonCB(Fl_Widget * /*w*/, void *data)
-{
+//void Toolbar::NextCameraButtonCB(Fl_Widget * /*w*/, void *data)
+//{
   //CameraManager::Instance()->IncActiveCamera();
-}
+//}

Modified: code/gazebo/trunk/server/gui/Toolbar.hh
===================================================================
--- code/gazebo/trunk/server/gui/Toolbar.hh     2008-07-23 02:39:35 UTC (rev 
6905)
+++ code/gazebo/trunk/server/gui/Toolbar.hh     2008-07-23 05:01:11 UTC (rev 
6906)
@@ -23,6 +23,7 @@
  * Date: 13 Feb 2006
  * SVN: $Id:$
  */
+
 #ifndef TOOLBAR_HH
 #define TOOLBAR_HH
 
@@ -47,14 +48,15 @@
     /// \brief Update the toolbar data
     public: void Update();
 
-    public: static void PrevCameraButtonCB(Fl_Widget * /*w*/, void *data);
-    public: static void NextCameraButtonCB(Fl_Widget * /*w*/, void *data);
+//    public: static void PrevCameraButtonCB(Fl_Widget * /*w*/, void *data);
+    //public: static void NextCameraButtonCB(Fl_Widget * /*w*/, void *data);
 
-    private: Fl_Group *cameraInfoGrp;
-    private: Fl_Button *prevCameraButton;
+    private: Fl_Group *entityInfoGrp;
+    /*private: Fl_Button *prevCameraButton;
     private: Fl_Button *nextCameraButton;
-    private: Fl_Output *cameraName;
-    private: Fl_Output *cameraDimensions;
+    */
+    private: Fl_Output *entityName;
+    /*private: Fl_Output *cameraDimensions;
     private: Fl_Value_Output *outputX;
     private: Fl_Value_Output *outputY;
     private: Fl_Value_Output *outputZ;
@@ -62,6 +64,7 @@
     private: Fl_Value_Output *outputRoll;
     private: Fl_Value_Output *outputPitch;
     private: Fl_Value_Output *outputYaw;
+    */
 
   };
   

Modified: code/gazebo/trunk/worlds/simpleshapes.world
===================================================================
--- code/gazebo/trunk/worlds/simpleshapes.world 2008-07-23 02:39:35 UTC (rev 
6905)
+++ code/gazebo/trunk/worlds/simpleshapes.world 2008-07-23 05:01:11 UTC (rev 
6906)
@@ -15,7 +15,7 @@
   <verbosity>5</verbosity>
 
   <physics:ode>
-    <stepTime>0.01</stepTime>
+    <stepTime>0.03</stepTime>
     <gravity>0 0 -9.8</gravity>
     <cfm>10e-5</cfm>
     <erp>0.3</erp>


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to