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 Makefile.am,1.16,1.17 action_w


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/editor Makefile.am,1.16,1.17 action_window.cxx,1.2,1.3 action_window.hxx,1.2,1.3 editor.cxx,1.8,1.9 editor.hxx,1.3,1.4 editor_event.cxx,1.12,1.13 editor_event.hxx,1.5,1.6 editor_groundpiece_obj.cxx,1.5,1.6 editor_groundpiece_obj.hxx,1.4,1.5 editorobj.cxx,1.1,1.2 editorobj.hxx,1.4,1.5 groundpiece_window.cxx,1.1,1.2 groundpiece_window.hxx,1.1,1.2 panel_icons.cxx,1.2,1.3
Date: 29 Jun 2002 11:54:24 -0000

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

Modified Files:
        Makefile.am action_window.cxx action_window.hxx editor.cxx 
        editor.hxx editor_event.cxx editor_event.hxx 
        editor_groundpiece_obj.cxx editor_groundpiece_obj.hxx 
        editorobj.cxx editorobj.hxx groundpiece_window.cxx 
        groundpiece_window.hxx panel_icons.cxx 
Log Message:
- some more gui stuff

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/Makefile.am,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- Makefile.am 28 Jun 2002 22:21:59 -0000      1.16
+++ Makefile.am 29 Jun 2002 11:54:22 -0000      1.17
@@ -36,6 +36,7 @@
 editor_view.cxx                    plfobj.cxx            thumb_cache.cxx \
 editorobj.cxx              rect_editorobj.cxx    weather_obj.cxx \
     scroll_map.cxx \
-  sprite_editorobj.cxx editorobj_group.hxx editorobj_group.cxx
+  sprite_editorobj.cxx editorobj_group.hxx editorobj_group.cxx \
+groundpiece_window.hxx groundpiece_window.cxx
 
 # EOF #

Index: action_window.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/action_window.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- action_window.cxx   29 Jun 2002 09:44:56 -0000      1.2
+++ action_window.cxx   29 Jun 2002 11:54:22 -0000      1.3
@@ -20,23 +20,26 @@
 #include "../string_converter.hxx"
 #include "action_window.hxx"
 
-/**********************
+/***************************
   Actions
- ----------------------
-  Basher      20 [+][-]
-  Bridger     20 [+][-]
-  Digger      20 [+][-]
+ ---------------------------
+  [x] Basher      20 [+][-]
+  [ ] Bridger     20 [+][-]
+  [x] Digger      20 [+][-]
   [...]
- ----------------------
- [ok]          [cancel]
- **********************/
+ ---------------------------
+ [    ok     ]  [  cancel  ]
+****************************/
 
 ActionWindow::ActionWindow (CL_Component* arg_parent, std::vector<ActionData>* 
arg_actions)
   : parent (arg_parent), actions (arg_actions)
 {
   window = new CL_Window (CL_Rect(0, 0,
-                                 200, (actions->size() * 20) + 80), "Pingus 
Actions", parent);
-
+                                 200, (actions->size() * 20) + 80), "Pingus 
Actions", parent);
+  
+  //window = new CL_Frame (CL_Rect (0, 0, 200, (actions->size() * 20) + 80), 
parent);
+  //window->enable_fill (true);
+  
   int y = 30;
   for (std::vector<ActionData>::iterator i = actions->begin (); i != 
actions->end (); ++i)
     {
@@ -49,29 +52,34 @@
   ok_button = new CL_Button(CL_Rect (10, y, 90, y + 20), "Ok", window);
   cancel_button = new CL_Button(CL_Rect (110, y, 190, y + 20), "Cancel", 
window);
 
-  ok_button->sig_clicked ().connect (this, &ActionWindow::ok_clicked);
-  cancel_button->sig_clicked ().connect (this, &ActionWindow::cancel_clicked);
-
+  ok_button_slot     = ok_button->sig_clicked ().connect (this, 
&ActionWindow::ok_clicked);
+  cancel_button_slot = cancel_button->sig_clicked ().connect (this, 
&ActionWindow::cancel_clicked);
+  
   hide ();
+  //window->run ();
+  window->set_position(100, 100);
 }
 
 void
 ActionWindow::show ()
 {
-  parent->add_child (window);
+  std::cout << "show" << std::endl;
+  read_data ();
+  window->show (true);
 }
 
 void
 ActionWindow::hide ()
 {
-  parent->remove_child (window);
+  std::cout << "hide" << std::endl;
+  window->show (false);
 }
 
 void 
 ActionWindow::ok_clicked ()
 {
   std::cout << "OK Clicked" << std::endl;
-  sync_with_data ();
+  write_data ();
   hide ();
 }
 
@@ -83,10 +91,15 @@
 }
 
 void
-ActionWindow::sync_with_data ()
+ActionWindow::read_data ()
 {
-  // Sync the level data with the data from the window
-  std::cout << "Syncing data" << std::endl;
+  std::cout << "Reading data" << std::endl;
+}
+
+void
+ActionWindow::write_data ()
+{
+  std::cout << "Writing data" << std::endl;
 }
 
 /* EOF */

Index: action_window.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/action_window.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- action_window.hxx   29 Jun 2002 09:44:56 -0000      1.2
+++ action_window.hxx   29 Jun 2002 11:54:22 -0000      1.3
@@ -36,6 +36,8 @@
   CL_Button* ok_button;
   CL_Button* cancel_button;
 
+  CL_Slot ok_button_slot;
+  CL_Slot cancel_button_slot;
 public:
   ActionWindow (CL_Component* parent, std::vector<ActionData>*); 
 
@@ -45,7 +47,8 @@
   void show ();
   void hide ();
 private:
-  void sync_with_data ();
+  void read_data ();
+  void write_data ();
 };
 
 #endif

Index: editor.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- editor.cxx  29 Jun 2002 09:44:56 -0000      1.8
+++ editor.cxx  29 Jun 2002 11:54:22 -0000      1.9
@@ -548,4 +548,10 @@
 }
 */
 
+CL_GUIManager*
+Editor::get_gui_manager ()
+{
+  return gui;
+}
+
 /* EOF */

Index: editor.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- editor.hxx  29 Jun 2002 09:44:56 -0000      1.3
+++ editor.hxx  29 Jun 2002 11:54:22 -0000      1.4
@@ -106,6 +106,8 @@
   ObjectManager* get_object_manager() { return object_manager; }
   std::string save_tmp_level ();
   EditorEvent* get_event() { return event; }
+
+  CL_GUIManager* get_gui_manager ();
 };
 
 #endif

Index: editor_event.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor_event.cxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- editor_event.cxx    29 Jun 2002 09:44:56 -0000      1.12
+++ editor_event.cxx    29 Jun 2002 11:54:22 -0000      1.13
@@ -829,4 +829,26 @@
   editor->action_window->show ();
 }
 
+void
+EditorEvent::editor_show_object_properties ()
+{
+  if (object_manager->current_objs.size() == 1)
+    {
+      boost::shared_ptr<EditorObj>  obj = *object_manager->current_objs.begin 
();
+      CL_Component* comp = obj->get_gui_dialog (editor->get_gui_manager ());
+      if (comp)
+       {
+         std::cout << "Got gui" << std::endl;
+       }
+      else
+       {
+         std::cout << "GUI for object not available: " << comp << std::endl;
+       }
+    }
+  else
+    {
+      std::cout << "EditorEvent::editor_show_object_properties (): error: 
multiple objects selected" << std::endl;
+    }
+}
+
 /* EOF */

Index: editor_event.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor_event.hxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- editor_event.hxx    29 Jun 2002 09:44:56 -0000      1.5
+++ editor_event.hxx    29 Jun 2002 11:54:22 -0000      1.6
@@ -75,7 +75,11 @@
   void editor_export_object_group_from_selection ();
   void editor_import_object_group ();
 
+  /** Display the configuration window for the actions */
   void editor_show_actions_window ();
+  
+  /** Display the propertie dialog for the current object */
+  void editor_show_object_properties ();
 
   /** Decrease the owner number or another value specific to the
       current object */

Index: editor_groundpiece_obj.cxx
===================================================================
RCS file: 
/usr/local/cvsroot/Games/Pingus/src/editor/editor_groundpiece_obj.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- editor_groundpiece_obj.cxx  26 Jun 2002 12:04:24 -0000      1.5
+++ editor_groundpiece_obj.cxx  29 Jun 2002 11:54:22 -0000      1.6
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include "../boost/smart_ptr.hpp"
 #include "../pingus_resource.hxx"
+#include "groundpiece_window.hxx"
 #include "editor_groundpiece_obj.hxx"
 
 using namespace Pingus;
@@ -94,6 +95,12 @@
 
   pos.x -= sprite.get_width ()/2;
   pos.y -= sprite.get_height ()/2;
+}
+
+CL_Component*
+EditorGroundpieceObj::get_gui_dialog(CL_Component* parent)
+{
+  return new Pingus::Editor::GroundpieceWindow (parent, this);
 }
 
 /* EOF */

Index: editor_groundpiece_obj.hxx
===================================================================
RCS file: 
/usr/local/cvsroot/Games/Pingus/src/editor/editor_groundpiece_obj.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- editor_groundpiece_obj.hxx  25 Jun 2002 21:31:40 -0000      1.4
+++ editor_groundpiece_obj.hxx  29 Jun 2002 11:54:22 -0000      1.5
@@ -45,6 +45,8 @@
   void write_xml(std::ostream& xml) { GroundpieceData::write_xml (xml); }
   boost::shared_ptr<EditorObj> duplicate();
   std::string status_line();
+
+  CL_Component* get_gui_dialog(CL_Component* parent);
 };
 
 #endif

Index: editorobj.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editorobj.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- editorobj.cxx       12 Jun 2002 19:11:31 -0000      1.1
+++ editorobj.cxx       29 Jun 2002 11:54:22 -0000      1.2
@@ -35,4 +35,10 @@
   return "EditorObj::status_line(): Not implemented";
 }
 
+CL_Component*
+EditorObj::get_gui_dialog (CL_Component*)
+{
+  return 0;
+}
+
 /* EOF */

Index: editorobj.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editorobj.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- editorobj.hxx       25 Jun 2002 21:31:40 -0000      1.4
+++ editorobj.hxx       29 Jun 2002 11:54:22 -0000      1.5
@@ -28,6 +28,7 @@
 class CL_Rect;
 class CL_Vector;
 class EditorView;
+class CL_Component;
 class Editor;
 
 namespace boost {
@@ -107,6 +108,9 @@
   /** Duplicate the given editor object and return a the copied
       object */
   virtual boost::shared_ptr<EditorObj> duplicate() =0;
+
+  /** */
+  virtual CL_Component* get_gui_dialog (CL_Component* parent);
 };
 
 #endif

Index: groundpiece_window.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/groundpiece_window.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- groundpiece_window.cxx      28 Jun 2002 22:21:59 -0000      1.1
+++ groundpiece_window.cxx      29 Jun 2002 11:54:22 -0000      1.2
@@ -29,4 +29,22 @@
  [ok] [cancel]
 *************************/
 
+using namespace Pingus::Editor;
+
+GroundpieceWindow::GroundpieceWindow (CL_Component* parent,  
EditorGroundpieceObj* data)
+  : CL_Window (CL_Rect (0, 0, 200, 300), "Groundpiece Properties", parent),
+    convert_to_hotspot_button (CL_Rect (10, 30, 190, 30 + 20), "Convert to 
HotSpot", this),
+
+    groundtype_label (CL_Rect (10, 60, 90, 60 + 20), "Groundtype", this),
+    groundtype_listbox (CL_Rect (110, 60, 190, 60 + 60), this),
+
+    ok_button (CL_Rect (10, 150, 90, 150 + 20), "Ok", this),
+    cancel_button (CL_Rect (110, 150, 190, 150 + 20), "Cancel", this)
+{
+  groundtype_listbox.insert_item ("ground");
+  groundtype_listbox.insert_item ("transparent");
+  groundtype_listbox.insert_item ("bridge");
+  groundtype_listbox.insert_item ("solid");
+}
+
 /* EOF */

Index: groundpiece_window.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/groundpiece_window.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- groundpiece_window.hxx      28 Jun 2002 22:21:59 -0000      1.1
+++ groundpiece_window.hxx      29 Jun 2002 11:54:22 -0000      1.2
@@ -20,15 +20,30 @@
 #ifndef HEADER_PINGUS_EDITOR_GROUNDPIECE_WINDOW_HXX
 #define HEADER_PINGUS_EDITOR_GROUNDPIECE_WINDOW_HXX
 
+#include <ClanLib/gui.h>
+#include "editor_groundpiece_obj.hxx"
+
 namespace Pingus
 {
   namespace Editor
   {
-    class GroundpieceWindow
+    class GroundpieceWindow : public CL_Window
     {
     private:
+      GroundpieceData* data;
+
+      CL_Button convert_to_hotspot_button;
+
+      CL_Label  groundtype_label;
+      CL_ListBox groundtype_listbox;
+
+      CL_Button ok_button;
+      CL_Button cancel_button;
       
+      CL_Slot ok_button_slot;
+      CL_Slot cancel_button_slot;
     public:
+      GroundpieceWindow (CL_Component* parent,  EditorGroundpieceObj* data);
     };
   }
 }

Index: panel_icons.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/panel_icons.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- panel_icons.cxx     29 Jun 2002 09:44:56 -0000      1.2
+++ panel_icons.cxx     29 Jun 2002 11:54:22 -0000      1.3
@@ -100,14 +100,13 @@
 void
 PanelIconPreferences::on_click()
 {
-  std::cout << "Preferences not implemented" << std::endl;
 }
 
 void 
 PanelIconEdit::on_click()
 {
-  // std::cout << "Edit not implemented" << std::endl;
-  editor->edit_current_objs();
+  std::cout << "Preferences not implemented" << std::endl;
+  editor->get_event ()->editor_show_object_properties ();
 }
 
 PanelIconRun::PanelIconRun()




reply via email to

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