Revision: 8955
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8955&view=rev
Author:   natepak
Date:     2010-11-03 23:25:46 +0000 (Wed, 03 Nov 2010)

Log Message:
-----------
Fixed some bugs

Modified Paths:
--------------
    code/gazebo/trunk/server/wx/PhysicsPage.cc
    code/gazebo/trunk/server/wx/PhysicsPage.hh
    code/gazebo/trunk/server/wx/Properties.cc
    code/gazebo/trunk/server/wx/Properties.hh

Modified: code/gazebo/trunk/server/wx/PhysicsPage.cc
===================================================================
--- code/gazebo/trunk/server/wx/PhysicsPage.cc  2010-11-03 22:51:07 UTC (rev 
8954)
+++ code/gazebo/trunk/server/wx/PhysicsPage.cc  2010-11-03 23:25:46 UTC (rev 
8955)
@@ -23,6 +23,8 @@
 
   this->propGrid = new wxPropertyGrid( this, wxID_ANY, wxDefaultPosition, 
wxDefaultSize, wxPG_DEFAULT_STYLE|wxPG_SPLITTER_AUTO_CENTER);
 
+  this->propGrid->Connect( wxEVT_PG_CHANGED, wxPropertyGridEventHandler( 
PhysicsPage::OnPropertyChanged), NULL, this);
+
   this->propManager = new PropertyManager(this->propGrid);
 
   unsigned int paramCount = engine->GetParamCount();
@@ -42,10 +44,25 @@
 PhysicsPage::~PhysicsPage()
 {
   delete this->propManager;
-  this->grid->Destroy();
+  this->propGrid->Destroy();
 }
 
 
////////////////////////////////////////////////////////////////////////////////
 void PhysicsPage::Apply()
 {
 }
+
+////////////////////////////////////////////////////////////////////////////////
+// On property changed event callback
+void PhysicsPage::OnPropertyChanged(wxPropertyGridEvent &event)
+{
+  wxPGProperty *wxprop = event.GetProperty();
+
+  if (!wxprop)
+    return;
+
+  Property *prop = (Property*)(wxprop->GetClientData());
+
+  if (prop)
+    prop->Changed();
+}

Modified: code/gazebo/trunk/server/wx/PhysicsPage.hh
===================================================================
--- code/gazebo/trunk/server/wx/PhysicsPage.hh  2010-11-03 22:51:07 UTC (rev 
8954)
+++ code/gazebo/trunk/server/wx/PhysicsPage.hh  2010-11-03 23:25:46 UTC (rev 
8955)
@@ -17,7 +17,6 @@
 
     public: virtual void Apply();
 
-    /// \brief On property changed event callback
     private: void OnPropertyChanged(wxPropertyGridEvent &event);
 
     private: wxPropertyGrid *propGrid;

Modified: code/gazebo/trunk/server/wx/Properties.cc
===================================================================
--- code/gazebo/trunk/server/wx/Properties.cc   2010-11-03 22:51:07 UTC (rev 
8954)
+++ code/gazebo/trunk/server/wx/Properties.cc   2010-11-03 23:25:46 UTC (rev 
8955)
@@ -50,9 +50,9 @@
 
 
////////////////////////////////////////////////////////////////////////////////
 // Constructor
-PropertyManager::PropertyManager()
+PropertyManager::PropertyManager(wxPropertyGrid *g)
+  : grid(g)
 {
-  this->grid->Connect( wxEVT_PG_CHANGED, wxPropertyGridEventHandler( 
PropertyManager::OnPropertyChanged), NULL, this);
 }
 
 
////////////////////////////////////////////////////////////////////////////////
@@ -70,26 +70,11 @@
 // Add a property
 void PropertyManager::AddProperty(Param *p)
 {
-  Property *prop = PropertyFactory::CreateProperty( param, this->grid );
+  Property *prop = PropertyFactory::CreateProperty( p, this->grid );
   this->properties.push_back( prop );
 }
 
 
////////////////////////////////////////////////////////////////////////////////
-// On property changed event callback
-void PropertyManager::OnPropertyChanged(wxPropertyGridEvent &event)
-{
-  wxPGProperty *wxprop = event.GetProperty();
-
-  if (!wxprop)
-    return;
-
-  Property *prop = (Property*)(wxprop->GetClientData());
-
-  if (prop)
-    prop->Changed();
-}
-
-////////////////////////////////////////////////////////////////////////////////
 // Constructor
 Property::Property(Param *p, wxPropertyGrid *grid)
   : param(p), grid(grid), property(NULL)
@@ -282,7 +267,7 @@
   this->property->SetValueFromString( 
       wxString::FromAscii(param->GetAsString().c_str()) );
 
-  Param<Quatern> *pv = (ParamT<Quatern>*)pv;
+  ParamT<Quatern> *pv = (ParamT<Quatern>*)this->param;
   Vector3 rpy = (**pv).GetAsEuler();
 
   this->roll = this->grid->AppendIn( this->property, new wxFloatProperty( 
wxT("Roll"), wxT("Roll"), rpy.x) ); 

Modified: code/gazebo/trunk/server/wx/Properties.hh
===================================================================
--- code/gazebo/trunk/server/wx/Properties.hh   2010-11-03 22:51:07 UTC (rev 
8954)
+++ code/gazebo/trunk/server/wx/Properties.hh   2010-11-03 23:25:46 UTC (rev 
8955)
@@ -1,6 +1,8 @@
 #ifndef PROPERTIES_HH
 #define PROPERTIES_HH
 
+#include <wx/wx.h>
+
 #include "Param.hh"
 #include "StaticPluginRegister.hh"
 
@@ -27,9 +29,12 @@
 
   class PropertyManager
   {
-    public: PropertyManager();
+    public: PropertyManager(wxPropertyGrid *g);
     public: virtual ~PropertyManager();
 
+    public: void AddProperty(Param *p);
+
+
     private: wxPropertyGrid *grid;
     private: std::list<Property*> properties;
   };
@@ -128,7 +133,7 @@
     public: virtual ~TimeProperty();
 
     private: wxPGProperty *sec;
-    private: wxPGProperty *ms;
+    private: wxPGProperty *msec;
   };
 
   class ColorProperty : public Property


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

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to