X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/2695534342641710721ae3d842915094b384f9db..07f4e929e15451f6af8ec4d941bcee6742917d0d:/Constructor/constructor.cpp?ds=sidebyside diff --git a/Constructor/constructor.cpp b/Constructor/constructor.cpp index e2fddbf..7553c91 100644 --- a/Constructor/constructor.cpp +++ b/Constructor/constructor.cpp @@ -7,10 +7,10 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtrget_widget("btn_canio", btn_canio); refGlade->get_widget("btn_codo", btn_codo); @@ -92,6 +92,7 @@ void Constructor::on_btn_tanque_drag_get(const Glib::RefPtr& c void Constructor::on_main_menu_quit() { + delete this; Gtk::Main::quit(); //hide(); } @@ -175,17 +176,19 @@ void Constructor::on_item_drop_drag_received(const Glib::RefPtrlength >= 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) - a = new Conduct();//Gtk::manage( new Conduct() ); + a = new Conduct(); 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) - a = new Cistern();//Gtk::manage( new Cistern() ); + a = new Cistern(); else - a = new CItem();//Gtk::manage( new CItem((const char *)selection_data->data) ); + a = new CItem(); //Seteo el ID del item + Glib::ustring name("item"); 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