pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src/editor editor.cxx,1.18,1.19 editorobj


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/editor editor.cxx,1.18,1.19 editorobj.cxx,1.3,1.4 editorobj.hxx,1.10,1.11 entrance_window.cxx,1.2,1.3 groundpiece_window.cxx,1.6,1.7 property_window.cxx,1.7,1.8 property_window.hxx,1.3,1.4
Date: 3 Jul 2002 17:14:27 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/editor
In directory dark:/tmp/cvs-serv17562/src/editor

Modified Files:
        editor.cxx editorobj.cxx editorobj.hxx entrance_window.cxx 
        groundpiece_window.cxx property_window.cxx property_window.hxx 
Log Message:
- some cleanup
- added object valid checks for GUI

Index: editor.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor.cxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- editor.cxx  2 Jul 2002 13:36:06 -0000       1.18
+++ editor.cxx  3 Jul 2002 17:14:25 -0000       1.19
@@ -77,7 +77,7 @@
   gui   = new CL_GUIManager (style_manager);
 
   action_window = new ActionWindow (gui, object_manager->get_actions ());
-  property_window = new Pingus::Editor::PropertyWindow (gui);
+  property_window = new Pingus::Editor::PropertyWindow (this);
   level_property_window = new Pingus::Editor::LevelPropertyWindow (gui, 
object_manager);
 
   view = new EditorView (0, 0, CL_Display::get_width (), 
CL_Display::get_height (), 0, 0);

Index: editorobj.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editorobj.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- editorobj.cxx       1 Jul 2002 09:09:31 -0000       1.3
+++ editorobj.cxx       3 Jul 2002 17:14:25 -0000       1.4
@@ -36,7 +36,7 @@
 }
 
 Pingus::Editor::PropertyFrame*
-EditorObj::get_gui_dialog (CL_Component*)
+EditorObj::get_gui_dialog (Editor*)
 {
   return 0;
 }

Index: editorobj.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editorobj.hxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- editorobj.hxx       2 Jul 2002 13:36:06 -0000       1.10
+++ editorobj.hxx       3 Jul 2002 17:14:25 -0000       1.11
@@ -116,7 +116,7 @@
       responsible for deleting the object after usage. The
       CL_Component* should/must be a CL_Frame so that it can get
       embedded in the properties window */
-  virtual Pingus::Editor::PropertyFrame* get_gui_dialog (CL_Component* parent);
+  virtual Pingus::Editor::PropertyFrame* get_gui_dialog (Editor* parent);
 };
 
 #endif

Index: entrance_window.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/entrance_window.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- entrance_window.cxx 1 Jul 2002 09:09:31 -0000       1.2
+++ entrance_window.cxx 3 Jul 2002 17:14:25 -0000       1.3
@@ -17,6 +17,9 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include "editor.hxx"
+#include "object_manager.hxx"
+
 #include "plfobj.hxx"
 #include "../string_converter.hxx"
 #include "entrance_window.hxx"
@@ -65,14 +68,21 @@
 
 EntranceWindow::~EntranceWindow ()
 {
-  if (direction_left.is_checked ())
-    entrance->direction = EntranceData::LEFT;
-  else if (direction_misc.is_checked ())
-    entrance->direction = EntranceData::MISC;
-  else if (direction_right.is_checked ())
-    entrance->direction = EntranceData::RIGHT;
+  if (EditorObj::get_editor ()->get_object_manager ()->has_object (entrance))
+    {
+      if (direction_left.is_checked ())
+       entrance->direction = EntranceData::LEFT;
+      else if (direction_misc.is_checked ())
+       entrance->direction = EntranceData::MISC;
+      else if (direction_right.is_checked ())
+       entrance->direction = EntranceData::RIGHT;
 
-  from_string(release_rate_input.get_text (), entrance->release_rate);
+      from_string(release_rate_input.get_text (), entrance->release_rate);
+    }
+  else
+    {
+      std::cout << "EntranceWindow::~EntranceWindow (): object disapeared" << 
std::endl;
+    }
 }
 
 /* EOF */

Index: groundpiece_window.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/groundpiece_window.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- groundpiece_window.cxx      3 Jul 2002 09:53:32 -0000       1.6
+++ groundpiece_window.cxx      3 Jul 2002 17:14:25 -0000       1.7
@@ -17,6 +17,8 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include "editor.hxx"
+#include "object_manager.hxx"
 #include "groundpiece_window.hxx"
 
 /************************
@@ -92,19 +94,24 @@
 void
 GroundpieceWindow::write_data ()
 {
-  std::cout << "FIXME: GroundpieceWindow::write_data (): this will crash if 
the object gets deleted" << std::endl;
-
-  if (ground_radiobutton.is_checked ())
-    data->gptype = GroundpieceData::GP_GROUND;
-  else if (transparent_radiobutton.is_checked ())
-    data->gptype = GroundpieceData::GP_TRANSPARENT;
-  else if (solid_radiobutton.is_checked ())
-    data->gptype = GroundpieceData::GP_SOLID;
-  else if (bridge_radiobutton.is_checked ())
-    data->gptype = GroundpieceData::GP_BRIDGE;
+  if (EditorObj::get_editor ()->get_object_manager ()->has_object (data))
+    {
+      if (ground_radiobutton.is_checked ())
+       data->gptype = GroundpieceData::GP_GROUND;
+      else if (transparent_radiobutton.is_checked ())
+       data->gptype = GroundpieceData::GP_TRANSPARENT;
+      else if (solid_radiobutton.is_checked ())
+       data->gptype = GroundpieceData::GP_SOLID;
+      else if (bridge_radiobutton.is_checked ())
+       data->gptype = GroundpieceData::GP_BRIDGE;
+      else
+       {
+         std::cout << "Unhandled" << std::endl;
+       }
+    }
   else
     {
-      std::cout << "Unhandled" << std::endl;
+      std::cout << "GroundpieceWindow::write_data (): object disapeared" << 
std::endl;
     }
 }
 

Index: property_window.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/property_window.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- property_window.cxx 2 Jul 2002 13:36:07 -0000       1.7
+++ property_window.cxx 3 Jul 2002 17:14:25 -0000       1.8
@@ -17,14 +17,16 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include "editor.hxx"
 #include "editorobj.hxx"
 #include "property_frame.hxx"
 #include "property_window.hxx"
 
 using namespace Pingus::Editor;
 
-PropertyWindow::PropertyWindow (CL_Component* parent)
-  : CL_Window (CL_Rect (0, 0, 200, 200), "Object Properties", parent),
+PropertyWindow::PropertyWindow (::Editor* parent)
+  : CL_Window (CL_Rect (0, 0, 200, 200), "Object Properties", 
parent->get_gui_manager ()),
+    editor (parent),
     current_frame (0), label (CL_Point (50, 0), "no properties available", 
get_client_area ())
 {
   label.show (true);
@@ -45,7 +47,7 @@
   if (obj)
     {
       // We are responsible to delete comp
-      Pingus::Editor::PropertyFrame* comp = obj->get_gui_dialog 
(get_client_area ());
+      Pingus::Editor::PropertyFrame* comp = obj->get_gui_dialog (editor);
    
       if (comp)
        {

Index: property_window.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/property_window.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- property_window.hxx 1 Jul 2002 16:31:40 -0000       1.3
+++ property_window.hxx 3 Jul 2002 17:14:25 -0000       1.4
@@ -22,6 +22,7 @@
 
 #include <ClanLib/gui.h>
 
+class Editor;
 class EditorObj;
 
 namespace Pingus
@@ -31,11 +32,12 @@
     class PropertyWindow : public CL_Window
     {
     private:
+      ::Editor* editor;
       CL_Component* current_frame;
       CL_Label label;
       
     public:
-      PropertyWindow (CL_Component* parent);
+      PropertyWindow (::Editor* parent);
 
       void update_frame (EditorObj*);
     };




reply via email to

[Prev in Thread] Current Thread [Next in Thread]