X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/31b3e321726d5c3fe720dd216687d3138523714f..6983220ff84632481c1628720fe15b8f3ac1c9cb:/Constructor/drain.cpp?ds=sidebyside diff --git a/Constructor/drain.cpp b/Constructor/drain.cpp index e1f0792..3625677 100644 --- a/Constructor/drain.cpp +++ b/Constructor/drain.cpp @@ -83,6 +83,8 @@ void Drain::on_menu_popup_propiedades() void Drain::save(FILE *archivo) { char c_id[50], c_x[50], c_y[50], c_img[50]; + Glib::ustring con0; + con0 = "\t\t\t"+get_other_name(connect_vec[0].id_dest)+"\n"; sprintf(c_x,"\t\t%d\n",x); sprintf(c_y,"\t\t%d\n",y); sprintf(c_id,"%d",ID); @@ -91,6 +93,7 @@ void Drain::save(FILE *archivo) dato = "\t\n"; + dato += "\t\t\n"+con0+"\t\t\n"; dato += c_img; dato += c_x; dato += c_y; @@ -100,21 +103,27 @@ void Drain::save(FILE *archivo) bool Drain::check_connection() { + CItem *_item0; ConnectorType temp; switch (get_img_actual()) { case 0: - temp = is_other_connection_area( get_position_x()+16 , get_position_y() -5); + temp = is_other_connection_area( get_position_x()+16 , get_position_y() -5,& _item0); break; case 1: - temp = is_other_connection_area( get_position_x()+image->get_width() + 5, get_position_y()+16); + temp = is_other_connection_area( get_position_x()+image->get_width() + 5, get_position_y()+16,& _item0); break; case 2: - temp = is_other_connection_area( get_position_x()+16, get_position_y()+image->get_height()+5); + temp = is_other_connection_area( get_position_x()+16, get_position_y()+image->get_height()+5, &_item0); break; case 3: - temp = is_other_connection_area( get_position_x()-5, get_position_y()+16); + temp = is_other_connection_area( get_position_x()-5, get_position_y()+16,& _item0); } - return ( is_connected = (temp == OUT) ); + if ( is_connected = (temp == OUT) ) { + connect_vec[0].id_dest = _item0->get_id(); + return is_connected; + } + std::cout<<"conector dest ="<