+ gtk_selection_data_set(selection_data, selection_data->target, 8 ,(const guchar*)"codo_o.png",13);
+}
+
+void Constructor::on_btn_tanque_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time)
+{
+ gtk_selection_data_set(selection_data, selection_data->target, 8,(const guchar*)"tanque_e.png",15);
+}
+
+void Constructor::on_btn_bomba_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time)
+{
+ gtk_selection_data_set(selection_data, selection_data->target, 8,(const guchar*)"bomba_e.png",15);
+}
+
+void Constructor::on_btn_exclusa_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time)
+{
+ gtk_selection_data_set(selection_data, selection_data->target, 8,(const guchar*)"exclusa_h.png",15);
+}
+
+void Constructor::on_btn_drain_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time)
+{
+ gtk_selection_data_set(selection_data, selection_data->target, 8,(const guchar*)"drain_n.png",11);
+}
+
+void Constructor::on_btn_and_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time)
+{
+ gtk_selection_data_set(selection_data, selection_data->target, 8,(const guchar*)"and_e.png",9);
+}
+
+void Constructor::on_btn_or_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time)
+{
+ gtk_selection_data_set(selection_data, selection_data->target, 8,(const guchar*)"or_e.png",8);
+}
+
+void Constructor::on_btn_not_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time)
+{
+ gtk_selection_data_set(selection_data, selection_data->target, 8,(const guchar*)"not_e.png",9);
+}
+
+
+void Constructor::on_main_menu_quit()
+{
+ delete this;
+ Gtk::Main::quit();
+ //hide();
+}
+
+void Constructor::on_main_menu_save()
+{
+ file_selection->show();
+}
+
+void Constructor::on_edit_menu_del()
+{ // OJO que borra al primero que encuentra con el mismo nombre!!!
+ std::list<CItem *>::iterator i = listaItems.begin();
+ Glib::ustring pointed = combo_entry->get_text();
+ while ( i != listaItems.end() ){
+ CItem *temp = *i;
+ if ( temp->get_name() == pointed ){
+ workplace->delete_item(temp->get_id());
+ break;
+ }
+ i++;
+ }
+}
+
+void Constructor::on_chk_btn_clicked()
+{
+ logica = !logica;
+}
+
+void Constructor::on_btn_file_ok_clicked()
+{
+ std::list<CItem *>::iterator i = listaItems.begin();
+ std::string file_name = file_selection->get_filename();
+ if ( (archivo = fopen( file_name.c_str(), "w+")) != NULL ){
+ fprintf(archivo, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n");
+ fprintf (archivo,"<planta>\n");
+ while ( i != listaItems.end() ){
+ CItem *temp = *i;
+ temp->save(archivo);
+ i++;
+ }
+ fprintf(archivo,"</planta>\n");
+ } else
+ std::cout<<"NO SE ABRIO EL ARCHIVO"<<std::endl;
+ fclose(archivo);
+ file_selection->hide();
+}
+
+void Constructor::on_btn_file_cancel_clicked()
+{
+ file_selection->hide();
+}
+
+void Constructor::on_btn_dlg_connect_clicked()
+{
+ dlg_connect->hide();