pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r3132 - trunk/pingus/src/editor


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3132 - trunk/pingus/src/editor
Date: Wed, 12 Sep 2007 05:22:13 +0200

Author: grumbel
Date: 2007-09-12 05:22:12 +0200 (Wed, 12 Sep 2007)
New Revision: 3132

Modified:
   trunk/pingus/src/editor/editor_screen.cpp
   trunk/pingus/src/editor/object_properties.cpp
   trunk/pingus/src/editor/object_properties.hpp
Log:
- added some more object types to the ObjectProperty dialog

Modified: trunk/pingus/src/editor/editor_screen.cpp
===================================================================
--- trunk/pingus/src/editor/editor_screen.cpp   2007-09-12 03:13:30 UTC (rev 
3131)
+++ trunk/pingus/src/editor/editor_screen.cpp   2007-09-12 03:22:12 UTC (rev 
3132)
@@ -67,7 +67,7 @@
 
   object_selector   = new ObjectSelector(this);
 
-  object_properties = new ObjectProperties(this, Rect(Vector2i(0,400), 
Size(240, 200)));
+  object_properties = new ObjectProperties(this, Rect(Vector2i(0,450), 
Size(200, 150)));
   gui_manager->add(object_properties, true);
 
   file_load_dialog = new FileLoadDialog(this, Rect(Vector2i(50, 50), 

Modified: trunk/pingus/src/editor/object_properties.cpp
===================================================================
--- trunk/pingus/src/editor/object_properties.cpp       2007-09-12 03:13:30 UTC 
(rev 3131)
+++ trunk/pingus/src/editor/object_properties.cpp       2007-09-12 03:22:12 UTC 
(rev 3132)
@@ -36,12 +36,12 @@
   : GUI::GroupComponent(rect, false),
     editor(editor_)
 {
-  add(type_label = new Label(Rect(Vector2i(10, 10), Size(120, 20)), 
"Object:"), true);
-  
-  
+  add(type_label = new Label(Rect(Vector2i(4, 4), Size(120, 20)), "Object:"), 
true);
+  add(mesg_label = new Label(Rect(Vector2i(40, rect.get_height()/2- 20), 
Size(120, 20)), "nothing selected"), true);
+    
   // Groundpiece Type
-  add(gptype_label = new Label(Rect(Vector2i(10, 30), Size(120, 20)), 
"GPType:"), true);
-  add(gptype_type  = new Combobox(Rect(Vector2i(60, 30), Size(120, 20))), 
true);
+  add(gptype_label = new Label(Rect(Vector2i(10, 0), Size(90, 20)), 
"GPType:"), true);
+  add(gptype_type  = new Combobox(Rect(Vector2i(100, 0), Size(90, 20))), true);
 
   gptype_type->add(Groundtype::GP_TRANSPARENT, "Transparent");
   gptype_type->add(Groundtype::GP_SOLID,       "Solid");
@@ -54,8 +54,8 @@
 
   
gptype_type->on_select.connect(boost::bind(&ObjectProperties::on_gptype_change, 
this, _1));
   
-  add(entrance_direction_label = new Label(Rect(Vector2i(10, 90), Size(80, 
20)), "Direction"), true);
-  add(entrance_direction = new Combobox(Rect(Vector2i(60, 90), Size(120, 
20))), true);
+  add(entrance_direction_label = new Label(Rect(Vector2i(10, 0), Size(90, 
20)), "Direction:"), true);
+  add(entrance_direction = new Combobox(Rect(Vector2i(100, 0), Size(90, 20))), 
true);
   entrance_direction->add(0, "Right");
   entrance_direction->add(1, "Misc");
   entrance_direction->add(2, "Left");
@@ -64,31 +64,28 @@
   
entrance_direction->on_select.connect(boost::bind(&ObjectProperties::on_entrance_direction_change,
 this, _1));
   
   // Background Stretch
-  add(stretch_x_checkbox = new Checkbox(Rect(Vector2i(10, 60),  Size(80, 20)), 
"Stretch-X"), true);
-  add(stretch_y_checkbox = new Checkbox(Rect(Vector2i(110, 60), Size(80, 20)), 
"Stretch-Y"), true);
+  add(stretch_x_checkbox = new Checkbox(Rect(Vector2i(10, 0),  Size(90, 20)), 
"Stretch-X"), true);
+  add(stretch_y_checkbox = new Checkbox(Rect(Vector2i(100, 0), Size(90, 20)), 
"Stretch-Y"), true);
 
   
stretch_x_checkbox->on_change.connect(boost::bind(&ObjectProperties::on_stretch_x_change,
 this, _1));
   
stretch_y_checkbox->on_change.connect(boost::bind(&ObjectProperties::on_stretch_y_change,
 this, _1));
   
-  add(para_x_label = new Label(Rect(Vector2i(10, 120), Size(80,20)), 
"Para-X"), true);
-  add(para_y_label = new Label(Rect(Vector2i(10, 150), Size(80,20)), 
"Para-Y"), true);
+  add(para_x_label = new Label(Rect(Vector2i(10, 0), Size(90,20)), "Para-X:"), 
true);
+  add(para_y_label = new Label(Rect(Vector2i(10, 0), Size(90,20)), "Para-Y:"), 
true);
 
-  add(para_x_inputbox = new Inputbox(Rect(Vector2i(60, 120), Size(80,20))), 
true);
-  add(para_y_inputbox = new Inputbox(Rect(Vector2i(60, 150), Size(80,20))), 
true);
+  add(para_x_inputbox = new Inputbox(Rect(Vector2i(100, 0), Size(90,20))), 
true);
+  add(para_y_inputbox = new Inputbox(Rect(Vector2i(100, 0), Size(90,20))), 
true);
+  
+  add(scroll_x_label = new Label(Rect(Vector2i(10, 0), Size(90,20)), 
"Scroll-X:"), true);
+  add(scroll_y_label = new Label(Rect(Vector2i(10, 0), Size(90,20)), 
"Scroll-Y:"), true);
 
-  para_x_inputbox->set_text("Hello");
-  para_y_inputbox->set_text("World");
+  add(scroll_x_inputbox = new Inputbox(Rect(Vector2i(100, 0), Size(90,20))), 
true);
+  add(scroll_y_inputbox = new Inputbox(Rect(Vector2i(100, 0), Size(90,20))), 
true);
   
-  if (0)
-    {
-      add(new Label(Rect(Vector2i(  10,  30), Size( 80, 20)), "Type:"), true);
+  add(owner_label    = new Label(Rect(Vector2i(10,0), Size(90,20)), "Owner 
Id:"), true);
+  add(owner_inputbox = new Inputbox(Rect(Vector2i(100,0), Size(90,20))), true);
 
-      add(new Button(Rect(Vector2i( 60,  30), Size( 80, 20)), "Ground"), true);
-      add(new Button(Rect(Vector2i( 60,  50), Size( 80, 20)), "Transparent"), 
true);
-      add(new Button(Rect(Vector2i( 60,  70), Size( 80, 20)), "Solid"), true);
-      add(new Button(Rect(Vector2i(140,  30), Size( 80, 20)), "Bridge"), true);
-      add(new Button(Rect(Vector2i(140,  50), Size( 80, 20)), "Remove"), true);
-    }
+  hide_all();
 }
 
 ObjectProperties::~ObjectProperties()
@@ -130,9 +127,11 @@
 }
 
 void
-ObjectProperties::set_object(LevelObj* obj)
+ObjectProperties::hide_all()
 {
   // Hide everything
+  mesg_label->hide();
+
   gptype_label->hide();
   gptype_type->hide();
   
@@ -148,10 +147,26 @@
   para_y_label->hide();
   para_y_inputbox->hide();
 
+  scroll_x_label->hide();
+  scroll_x_inputbox->hide();
+ 
+  scroll_y_label->hide();
+  scroll_y_inputbox->hide();
+
+  owner_label->hide();
+  owner_inputbox->hide();
+
+}
+
+void
+ObjectProperties::set_object(LevelObj* obj)
+{
+  hide_all();
+
   if (obj)
     {
       unsigned int attr = obj->get_attribs();
-      y_pos = 36;
+      y_pos = 30;
       if (attr & HAS_TYPE)
         {
           place(gptype_label, gptype_type);
@@ -169,9 +184,6 @@
       
       if (attr & HAS_PARALLAX)
         {
-          place(para_x_label, para_x_inputbox);
-          
-          place(para_y_label, para_y_inputbox);
         }
         
       if (attr & HAS_WIDTH)
@@ -180,6 +192,7 @@
         
       if (attr & HAS_OWNER)
         {
+          place(owner_label, owner_inputbox);
         }
         
       if (attr & HAS_COLOR)
@@ -188,10 +201,14 @@
 
       if (attr & HAS_SCROLL)
         {
+          place(scroll_x_label, scroll_x_inputbox);
+          place(scroll_y_label, scroll_y_inputbox);
         }
 
       if (attr & HAS_PARA)
         {
+          place(para_x_label, para_x_inputbox);
+          place(para_y_label, para_y_inputbox);
         }
 
       if (attr & HAS_STRETCH)
@@ -203,6 +220,10 @@
         {
         }
     }
+  else
+    {
+      mesg_label->show();
+    }
 }
 
 void
@@ -219,12 +240,14 @@
   std::string obj_type;
   if (objects.empty())
     {
-      type_label->set_text("Object: [Empty]");
+      type_label->set_text("Object:");
+      mesg_label->set_text("Nothing selected");
       set_object(0);
     }
   else if (objects.size() > 1)
     {
       type_label->set_text("Object: [Group]");
+      mesg_label->set_text("Group not supported");
       set_object(0);
     }
   else

Modified: trunk/pingus/src/editor/object_properties.hpp
===================================================================
--- trunk/pingus/src/editor/object_properties.hpp       2007-09-12 03:13:30 UTC 
(rev 3131)
+++ trunk/pingus/src/editor/object_properties.hpp       2007-09-12 03:22:12 UTC 
(rev 3132)
@@ -38,6 +38,7 @@
   EditorScreen* editor;
   std::vector<LevelObj*> objects;
   Label* type_label;
+  Label* mesg_label;
 
   // Groundpiece Type
   Label*    gptype_label;
@@ -55,6 +56,15 @@
   Label*    para_y_label;
   Inputbox* para_y_inputbox;
 
+  Label*    scroll_x_label;
+  Inputbox* scroll_x_inputbox;
+
+  Label*    scroll_y_label;
+  Inputbox* scroll_y_inputbox;
+
+  Label*    owner_label;
+  Inputbox* owner_inputbox;
+
   int y_pos;
 public:
   ObjectProperties(EditorScreen* editor, const Rect& rect);
@@ -65,6 +75,7 @@
 
   void set_objects(const std::vector<LevelObj*>& objs);
 
+  void hide_all();
   void place(GUI::RectComponent* comp);
   void place(GUI::RectComponent* comp1, GUI::RectComponent* comp2);
 





reply via email to

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