]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Constructor/constructor.cpp
estoy completando un poco todo esto para ponerme a implementar el guardar y cargar...
[z.facultad/75.42/plaqui.git] / Constructor / constructor.cpp
index af1263ba7b031b84b3f0f8215ab50e590c650d40..7553c9126bb2cc77895064bc6db79abd94cf845e 100644 (file)
@@ -176,17 +176,19 @@ void Constructor::on_item_drop_drag_received(const Glib::RefPtr<Gdk::DragContext
                if ((selection_data->length >= 0) && (selection_data->format == 8))     {
                        CItem *a;
                        if (strcmp((const char *)selection_data->data, "item_codo.png")==0) 
                if ((selection_data->length >= 0) && (selection_data->format == 8))     {
                        CItem *a;
                        if (strcmp((const char *)selection_data->data, "item_codo.png")==0) 
-                               a = new Splitter();//Gtk::manage( new Splitter() );
+                               a = new Splitter();
                                        else    if (strcmp((const char *)selection_data->data, "item_canio.png")==0) 
                                        else    if (strcmp((const char *)selection_data->data, "item_canio.png")==0) 
-                                               a = new Conduct();//Gtk::manage( new Conduct() );
+                                               a = new Conduct();
                                                        else if (strcmp((const char *)selection_data->data, "item_y.png")==0) 
                                                        else if (strcmp((const char *)selection_data->data, "item_y.png")==0) 
-                                                               a = new Union();//Gtk::manage( new Union() );
+                                                               a = new Union();
                                                                        else if (strcmp((const char *)selection_data->data, "item_tanque.png")==0) 
                                                                        else if (strcmp((const char *)selection_data->data, "item_tanque.png")==0) 
-                                                                               a = new Cistern();//Gtk::manage( new Cistern() );
+                                                                               a = new Cistern();
                                                                                        else
                                                                                        else
-                                                                                               a = new CItem();//Gtk::manage( new CItem((const char *)selection_data->data) );
+                                                                                               a = new CItem();
                        //Seteo el ID del item
                        //Seteo el ID del item
+                       Glib::ustring name("item");
                        a->set_id(++id);                
                        a->set_id(++id);                
+                       a->set_name( name );
                        if ( can_drop(a, i*32, j*32) ) {
                                workplace->put(*a, i*32, j*32);
                                //Apunto al workplace
                        if ( can_drop(a, i*32, j*32) ) {
                                workplace->put(*a, i*32, j*32);
                                //Apunto al workplace