]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
agrego las compuertas pero todavia no hacen nada, ademas tengo un conflicto con el...
authorNicolás Dimov <ndimov@gmail.com>
Thu, 13 Nov 2003 17:57:15 +0000 (17:57 +0000)
committerNicolás Dimov <ndimov@gmail.com>
Thu, 13 Nov 2003 17:57:15 +0000 (17:57 +0000)
34 files changed:
Constructor/and.cpp [new file with mode: 0644]
Constructor/and.h [new file with mode: 0644]
Constructor/and.o [new file with mode: 0644]
Constructor/and_e.png [new file with mode: 0644]
Constructor/and_n.png [new file with mode: 0644]
Constructor/and_o.png [new file with mode: 0644]
Constructor/and_s.png [new file with mode: 0644]
Constructor/cistern.cpp
Constructor/cistern.h
Constructor/cisternptywnd.cpp
Constructor/cisternptywnd.h
Constructor/conduct.cpp
Constructor/constructor.cpp
Constructor/constructor.glade
Constructor/constructor.h
Constructor/not.cpp [new file with mode: 0644]
Constructor/not.h [new file with mode: 0644]
Constructor/not.o [new file with mode: 0644]
Constructor/not_e.png [new file with mode: 0644]
Constructor/not_n.png [new file with mode: 0644]
Constructor/not_o.png [new file with mode: 0644]
Constructor/not_s.png [new file with mode: 0644]
Constructor/or.cpp [new file with mode: 0644]
Constructor/or.h [new file with mode: 0644]
Constructor/or.o [new file with mode: 0644]
Constructor/or_e.png [new file with mode: 0644]
Constructor/or_n.png [new file with mode: 0644]
Constructor/or_o.png [new file with mode: 0644]
Constructor/or_s.png [new file with mode: 0644]
Constructor/propertywnd.h
Constructor/pump.cpp
Constructor/pump.h
Constructor/pumpptywnd.cpp
Constructor/pumpptywnd.h

diff --git a/Constructor/and.cpp b/Constructor/and.cpp
new file mode 100644 (file)
index 0000000..debe5f5
--- /dev/null
@@ -0,0 +1,110 @@
+#include "and.h"
+
+And::And()
+{
+       imageN = Gdk::Pixbuf::create_from_file("and_n.png");
+       imageS = Gdk::Pixbuf::create_from_file("and_s.png");
+       imageE = Gdk::Pixbuf::create_from_file("and_e.png");
+       imageO = Gdk::Pixbuf::create_from_file("and_o.png");
+       null = Gdk::Pixbuf::create_from_file("null.png");
+       imgActual = 0;
+       image = imageE;
+       set_size_request(image->get_width(), image->get_height());
+       name = "and";
+}
+
+And::~And()
+{
+}
+
+bool And::on_button_press_event(GdkEventButton *event)
+{
+       if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 1))
+               combo_entry->set_text(name);
+       
+       if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 2)){
+               image = null;   
+               image->render_to_drawable(get_window(),get_style()->get_black_gc(),0,0,0,0,image->get_width(),image->get_height(),Gdk::RGB_DITHER_NONE,0,0);
+               imgActual++;
+               switch (imgActual) {
+                       case 1:
+                               image = imageS;
+                               break;
+                       case 2:
+                               image = imageO;
+                               break;
+                       case 3:
+                               image = imageN;
+                               break;
+                       default: 
+                               imgActual = 0;
+                               image = imageE;                 
+               }
+               set_size_request(image->get_width(),image->get_height());
+               image->render_to_drawable(get_window(),get_style()->get_black_gc(),0,0,0,0,image->get_width(),image->get_height(),Gdk::RGB_DITHER_NONE,0,0);
+       }
+       if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 3)){
+               menu_popup.popup(event->button, event->time);
+                return true; //It has been handled.
+       }
+       return true;
+}
+void And::on_menu_popup_rotar()
+{
+       GdkEventButton event; 
+       event.type = GDK_BUTTON_PRESS;
+       event.button = 2;
+       And::on_button_press_event(&event);
+}
+
+void And::save(FILE *archivo)
+{
+
+}
+
+
+// CAMBIAR TODO ESTO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+bool And::check_connection()
+{
+       switch (get_img_actual()) {
+                       case 0:
+                               if ( is_other_connection_area( get_position_x()-5, get_position_y()+16) && 
+                                        is_other_connection_area( get_position_x()+get_image()->get_width()-16, +get_position_y()+get_image()->get_height() + 5) )
+                                       return true;                            
+                               break;  
+                       case 1:
+                               if ( is_other_connection_area( get_position_x()+get_image()->get_width() - 16, get_position_y() -5) && 
+                                        is_other_connection_area( get_position_x()-5, get_position_y()+get_image()->get_height()-16) )
+                                       return true;
+                               break;
+                       case 2:
+                               if ( is_other_connection_area( get_position_x() + 16, get_position_y() -5) &&
+                                        is_other_connection_area( get_position_x()+get_image()->get_width()+5, get_position_y()+get_image()->get_height()-16) )
+                                       return true;
+                               break;
+                       case 3:
+                               if ( is_other_connection_area( get_position_x()+get_image()->get_width()+5, get_position_y() +16) &&
+                                        is_other_connection_area( get_position_x() + 16, get_position_y()+get_image()->get_height() + 5) )
+                                       return true;
+       }
+       return false;
+}
+
+bool And::is_connection_area(int _a, int _b)
+{
+       switch (imgActual) {
+               case 0: if ( ( (_a <= x+10)&&(_a > x) && (_b <=y+22)&&(_b>=y+10) ) ||
+                                                ( (_a <= x+image->get_width()-10)&&(_a>=x+image->get_width()-22)&&(_b<=y+image->get_height()-1)&&(_b>=y+image->get_height()-10) ) )
+                                               return true;
+               case 1: if ( ( (_a <= x+image->get_width()-10)&&(_a >= x+image->get_width()-22) && (_b <=y+10)&&(_b > y) ) ||
+                                                ( (_a <= x+10)&&(_a > x)&&(_b<=y+image->get_height()-10)&&(_b>=y+image->get_height()-22) ) )
+                                               return true;
+               case 2: if ( ( (_a <= x+22)&&(_a >= x+10) && (_b <=y+10)&&(_b > y) ) ||
+                                                ( (_a <= x+image->get_width()-1)&&(_a>=x+image->get_width()-10)&&(_b<=y+image->get_height()-10)&&(_b>=y+image->get_height()-22) ) )
+                                               return true;
+               case 3: if ( ( (_a <= x+image->get_width()-1)&&(_a >= x+image->get_width()-10) && (_b <=y+22)&&(_b>=y+10) ) ||
+                                                ( (_a <= x+22)&&(_a>=x+10)&&(_b<=y+image->get_height()-1)&&(_b>=y+image->get_height()-10) ) )
+                                               return true;
+       }
+       return false;
+}
diff --git a/Constructor/and.h b/Constructor/and.h
new file mode 100644 (file)
index 0000000..cca48a1
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef _AND_H_
+#define _AND_H_
+
+#include "item.h"
+
+class And : public CItem {
+       public:
+               And();
+               virtual ~And();
+               virtual bool on_button_press_event(GdkEventButton *event);
+               virtual void on_menu_popup_rotar();
+               virtual void save(FILE *archivo);
+               virtual bool check_connection();
+               virtual bool is_connection_area(int _a, int _b);
+       private:
+               Glib::RefPtr<Gdk::Pixbuf> imageN; // 0 
+               Glib::RefPtr<Gdk::Pixbuf> imageS; // 1
+               Glib::RefPtr<Gdk::Pixbuf> imageE; // 2
+               Glib::RefPtr<Gdk::Pixbuf> imageO; // 3
+               Glib::RefPtr<Gdk::Pixbuf> null; 
+};
+#endif
diff --git a/Constructor/and.o b/Constructor/and.o
new file mode 100644 (file)
index 0000000..bdfe85c
Binary files /dev/null and b/Constructor/and.o differ
diff --git a/Constructor/and_e.png b/Constructor/and_e.png
new file mode 100644 (file)
index 0000000..0ae0826
Binary files /dev/null and b/Constructor/and_e.png differ
diff --git a/Constructor/and_n.png b/Constructor/and_n.png
new file mode 100644 (file)
index 0000000..8abc931
Binary files /dev/null and b/Constructor/and_n.png differ
diff --git a/Constructor/and_o.png b/Constructor/and_o.png
new file mode 100644 (file)
index 0000000..dcd5136
Binary files /dev/null and b/Constructor/and_o.png differ
diff --git a/Constructor/and_s.png b/Constructor/and_s.png
new file mode 100644 (file)
index 0000000..bbb3bf9
Binary files /dev/null and b/Constructor/and_s.png differ
index 02bbbcb36339c294e6e11330f0f5ced3f7a08581..88eae2de4e82aaa32b97502637bdd159ce99fcce 100644 (file)
@@ -77,9 +77,9 @@ void Cistern::set_capacidad(double _cap)
        capacidad = _cap;
 }
 
-double Cistern::get_capacidad()
+void Cistern::set_liquid_color(Gdk::Color _color)
 {
-       return capacidad;
+       liquid_color = _color;
 }
 
 void Cistern::set_contenido_inicial(double _ini)
@@ -87,14 +87,27 @@ void Cistern::set_contenido_inicial(double _ini)
        contenido_inicial = _ini;
 }
 
+double Cistern::get_capacidad()
+{
+       return capacidad;
+}
+
 double Cistern::get_contenido_inicial()
 {
        return contenido_inicial;
 }
 
+Gdk::Color Cistern::get_liquid_color()
+{
+       return liquid_color;
+}
+
 void Cistern::save(FILE *archivo)
 {
-       char c_id[50], c_cap[50], c_x[50], c_y[50], c_img[50], c_ini[50];
+       char c_id[50], c_cap[50], c_x[50], c_y[50], c_img[50], c_ini[50], c_red[50], c_green[50], c_blue[50];
+       sprintf(c_red,"\t\t\t<rojo>%d</rojo>\n",liquid_color.get_red());
+       sprintf(c_green,"\t\t\t<verde>%d</verde>\n",liquid_color.get_green());
+       sprintf(c_blue,"\t\t\t<azul>%d</azul>\n",liquid_color.get_blue());
        sprintf(c_x,"\t\t<x>%d</x>\n",x);
        sprintf(c_y,"\t\t<y>%d</y>\n",y);
        sprintf(c_id,"%d",ID);
@@ -107,6 +120,11 @@ void Cistern::save(FILE *archivo)
        dato += "\">\n";
        dato += c_cap;
        dato += c_ini;
+       dato += "\t<color>\n";
+       dato += c_red;
+       dato += c_green;
+       dato += c_blue;
+       dato += "\t</color>\n";
        dato += c_img;
        dato += c_x; 
        dato += c_y;
index c2d0f3ccd4f4c9c9869ee1fdce967cdba054104b..006555495a1ec4ada7039fba5c7863ff5da624f1 100644 (file)
@@ -15,8 +15,10 @@ class Cistern : public CItem {
                virtual void on_menu_popup_propiedades();
                void set_capacidad(double _cap);
                void set_contenido_inicial(double _ini);
+               void set_liquid_color(Gdk::Color _color);
                double get_contenido_inicial();
                double get_capacidad();
+               Gdk::Color get_liquid_color();
                virtual void save(FILE *archivo);
                virtual bool check_connection();
                virtual bool is_connection_area(int _a, int _b);
@@ -25,6 +27,7 @@ class Cistern : public CItem {
                Glib::RefPtr<Gdk::Pixbuf> imageE; // 0 
                Glib::RefPtr<Gdk::Pixbuf> imageO; // 1
                Glib::RefPtr<Gdk::Pixbuf> null; 
+               Gdk::Color liquid_color;
                CisternPtyWnd *cistern_pty_wnd;
 };
 #endif
index dcd475886a17ba02019e7fc034c3d4de513f4e64..e5ca32d1f744359fc1df70aec548bb906970dbf1 100644 (file)
@@ -6,6 +6,15 @@ CisternPtyWnd::CisternPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::
        refGlade->get_widget("spin_capacidad", spin_capacidad);
        refGlade->get_widget("spin_inicial", spin_inicial);
        refGlade->get_widget("txt_cistern_name", txt_cistern_name);
+       refGlade->get_widget("btn_select_color", btn_select_color);             
+       Glib::RefPtr<Gnome::Glade::Xml> ref = Gnome::Glade::Xml::create("constructor.glade", "color_select_dlg");
+       ref->get_widget("color_select_dlg",color_select_dlg);
+       ref->get_widget("dlg_select_color_cancel",dlg_select_color_cancel);
+       ref->get_widget("dlg_select_color_ok",dlg_select_color_ok);
+       
+       btn_select_color->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_btn_select_color_clicked));
+       dlg_select_color_cancel->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_dlg_select_color_cancel_clicked));
+       dlg_select_color_ok->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_dlg_select_color_ok_clicked));
 }
 
 CisternPtyWnd::~CisternPtyWnd()
@@ -14,9 +23,7 @@ CisternPtyWnd::~CisternPtyWnd()
  
 void CisternPtyWnd::on_btn_accept_clicked()
 {
-       cistern->set_capacidad( spin_capacidad->get_value() );
-       cistern->set_contenido_inicial( spin_inicial->get_value() );
-       cistern->set_name( txt_cistern_name->get_text() );
+       CisternPtyWnd::on_btn_apply_clicked();
        hide();
 }
 
@@ -25,4 +32,22 @@ void CisternPtyWnd::on_btn_apply_clicked()
        cistern->set_capacidad( spin_capacidad->get_value() );
        cistern->set_contenido_inicial( spin_inicial->get_value() );
        cistern->set_name( txt_cistern_name->get_text() );
+       color_select_dlg->get_colorsel()->set_current_color(cistern->get_liquid_color());
+}
+
+void CisternPtyWnd::on_btn_select_color_clicked()
+{
+       color_select_dlg->get_colorsel()->set_current_color(cistern->get_liquid_color());
+       color_select_dlg->show();
+}
+
+void CisternPtyWnd::on_dlg_select_color_cancel_clicked()
+{
+       color_select_dlg->hide();
+}
+
+void CisternPtyWnd::on_dlg_select_color_ok_clicked()
+{
+       cistern->set_liquid_color( color_select_dlg->get_colorsel()->get_current_color() );
+       color_select_dlg->hide();
 }
index 16e51adb967a157d2e99b63d68b498301e998063..81af75c70ac6b813c986e3db45d3cb71291277cd 100644 (file)
@@ -11,9 +11,14 @@ class CisternPtyWnd : public PropertyWnd {
                virtual ~CisternPtyWnd();
                Cistern *cistern;
                Gtk::SpinButton *spin_inicial, *spin_capacidad;
+               Gtk::Button  *btn_select_color, *dlg_select_color_ok, *dlg_select_color_cancel;
                Gtk::Entry *txt_cistern_name;
+               Gtk::ColorSelectionDialog *color_select_dlg;
                virtual void on_btn_accept_clicked();
                virtual void on_btn_apply_clicked();
+               virtual void on_btn_select_color_clicked();
+               virtual void on_dlg_select_color_cancel_clicked();
+               virtual void on_dlg_select_color_ok_clicked();
 };
 
 #endif
index 1a75aef33bfeab6c0d0a8f72b19201e2b68ad131..9b2e31fcbf459580c20a609a546259930f9382f8 100644 (file)
@@ -94,11 +94,10 @@ bool Conduct::check_connection()
                                if ( is_other_connection_area( get_position_x()+16, get_position_y()-5) && 
                                         is_other_connection_area( get_position_x()+16, get_position_y()+get_image()->get_height() +5) )
                                        return true;                            
-                               break;
                        case 1:
                                if ( is_other_connection_area( get_position_x()-5, get_position_y()+16) && 
                                         is_other_connection_area( get_position_x()+get_image()->get_width()+5, get_position_y()+16) )
-                               return true;
+                                       return true;
        }
        return false;
 }
index 81a9c37c25590078ba96ca0b4df6da436cc0a5d3..0278ec0bf2c1b16f7096ff7d06e93f8a1fcf5a9d 100644 (file)
@@ -12,6 +12,9 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
        ico_tanque  = Gdk::Pixbuf::create_from_file("tanque_e.png");
        ico_exclusa = Gdk::Pixbuf::create_from_file("exclusa_h.png");
        ico_bomba = Gdk::Pixbuf::create_from_file("bomba_e.png");
+       ico_and = Gdk::Pixbuf::create_from_file("and_e.png");
+       ico_or = Gdk::Pixbuf::create_from_file("or_e.png");
+       ico_not = Gdk::Pixbuf::create_from_file("not_e.png");
        
        refGlade->get_widget("btn_canio", btn_canio);
        refGlade->get_widget("btn_codo", btn_codo);
@@ -19,6 +22,9 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
        refGlade->get_widget("btn_tanque",btn_tanque);
        refGlade->get_widget("btn_bomba", btn_bomba);
        refGlade->get_widget("btn_exclusa", btn_exclusa);
+       refGlade->get_widget("btn_and", btn_and);
+       refGlade->get_widget("btn_or", btn_or);
+       refGlade->get_widget("btn_not", btn_not);
        refGlade->get_widget("main_menu_quit",main_menu_quit);
        refGlade->get_widget("main_menu_save",main_menu_save);
        refGlade->get_widget("edit_menu_del",edit_menu_del);
@@ -44,6 +50,9 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
        btn_tanque->drag_source_set(listTargets);
        btn_bomba->drag_source_set(listTargets);
        btn_exclusa->drag_source_set(listTargets);
+       btn_and->drag_source_set(listTargets);
+       btn_or->drag_source_set(listTargets);
+       btn_not->drag_source_set(listTargets);
        
        btn_canio->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_canio_drag_get));
        btn_bomba->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_bomba_drag_get));
@@ -51,6 +60,9 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
        btn_y->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_y_drag_get));
        btn_codo->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_codo_drag_get));
        btn_tanque->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_tanque_drag_get));
+       btn_and->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_and_drag_get));
+       btn_or->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_or_drag_get));
+       btn_not->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_not_drag_get));
        btn_check->signal_clicked().connect(SigC::slot(*this,&Constructor::on_btn_check_clicked));
        btn_dlg_close->signal_clicked().connect(SigC::slot(*this,&Constructor::on_btn_dlg_connect_clicked));
        chk_btn_logica->signal_clicked().connect(SigC::slot(*this, &Constructor::on_chk_btn_clicked));
@@ -71,7 +83,9 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
        btn_tanque->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_tanque_drag_begin));
        btn_bomba->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_bomba_drag_begin));
        btn_exclusa->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_exclusa_drag_begin));
-
+       btn_and->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_and_drag_begin));
+       btn_or->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_or_drag_begin));
+       btn_not->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_not_drag_begin));
        workplace->drag_dest_set(listTargets);
        workplace->signal_drag_data_received().connect( SigC::slot(*this, &Constructor::on_item_drop_drag_received) );  
        workplace->listaItems = &listaItems;    
@@ -81,11 +95,9 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
 Constructor::~Constructor()
 {
        std::list<CItem *>::iterator i = listaItems.begin();
-       std::cout << "ok" << std::endl;
        while ( i != listaItems.end() ){
                CItem *temp = *i;
                listaItems.erase(i);
-               std::cout << "Elimnando ... " << std::endl;
                delete temp;
                i = listaItems.begin();
        }
@@ -121,6 +133,22 @@ void Constructor::on_btn_exclusa_drag_get(const Glib::RefPtr<Gdk::DragContext>&
        gtk_selection_data_set(selection_data, selection_data->target, 8,(const guchar*)"exclusa_h.png",15);
 }
 
+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;
@@ -201,6 +229,21 @@ void Constructor::on_exclusa_drag_begin(const Glib::RefPtr<Gdk::DragContext>& co
        context->set_icon(ico_exclusa, 5, 5); 
 }
 
+void Constructor::on_and_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context)
+{
+       context->set_icon(ico_and, 5, 5); 
+}
+
+void Constructor::on_or_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context)
+{
+       context->set_icon(ico_or, 5, 5); 
+}
+
+void Constructor::on_not_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context)
+{
+       context->set_icon(ico_not, 5, 5); 
+}
+
 void Constructor::on_item_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context, CItem *item)
 {
        context->set_icon(item->get_image(), 5, 5);
@@ -261,7 +304,12 @@ void Constructor::on_item_drop_drag_received(const Glib::RefPtr<Gdk::DragContext
                                                                                                a =new Pump();
                                                                                                        else if (strcmp((const char *)selection_data->data, "exclusa_h.png")==0) 
                                                                                                                a = new Exclusa();
-                                                                                                                       
+                                                                                                                       else if (strcmp((const char *)selection_data->data, "and_e.png")==0) 
+                                                                                                                               a = new And();
+                                                                                                                                       else if (strcmp((const char *)selection_data->data, "or_e.png")==0) 
+                                                                                                                                               a = new Or();
+                                                                                                                                                       else if (strcmp((const char *)selection_data->data, "not_e.png")==0) 
+                                                                                                                                                               a = new Not();  
                
                        char char_id[10];
                        sprintf(char_id," %d",id);
index 28c0ac4b9da1bf02a8cda43790bedbdb57c33694..4d57058d228435ff91e3319a042ae17a61017ccd 100644 (file)
@@ -7,7 +7,7 @@
   <property name="width_request">640</property>
   <property name="height_request">573</property>
   <property name="visible">True</property>
-  <property name="title" translatable="yes">window1</property>
+  <property name="title" translatable="yes">Constuctor</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
   <property name="window_position">GTK_WIN_POS_CENTER</property>
   <property name="modal">False</property>
                    <packing>
                      <property name="padding">0</property>
                      <property name="expand">True</property>
-                     <property name="fill">True</property>
+                     <property name="fill">False</property>
                    </packing>
                  </child>
                </widget>
                  <property name="spacing">5</property>
 
                  <child>
-                   <widget class="GtkButton" id="button2">
+                   <widget class="GtkButton" id="btn_and">
                      <property name="visible">True</property>
                      <property name="can_default">True</property>
                      <property name="can_focus">True</property>
-                     <property name="label" translatable="yes">AND</property>
-                     <property name="use_underline">True</property>
                      <property name="relief">GTK_RELIEF_NORMAL</property>
+
+                     <child>
+                       <widget class="GtkAlignment" id="alignment5">
+                         <property name="visible">True</property>
+                         <property name="xalign">0.5</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xscale">0</property>
+                         <property name="yscale">0</property>
+
+                         <child>
+                           <widget class="GtkHBox" id="hbox6">
+                             <property name="visible">True</property>
+                             <property name="homogeneous">False</property>
+                             <property name="spacing">2</property>
+
+                             <child>
+                               <widget class="GtkImage" id="image14">
+                                 <property name="visible">True</property>
+                                 <property name="pixbuf">and_e.png</property>
+                                 <property name="xalign">0.5</property>
+                                 <property name="yalign">0.5</property>
+                                 <property name="xpad">0</property>
+                                 <property name="ypad">0</property>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">False</property>
+                                 <property name="fill">False</property>
+                               </packing>
+                             </child>
+                           </widget>
+                         </child>
+                       </widget>
+                     </child>
                    </widget>
                  </child>
 
                  <child>
-                   <widget class="GtkButton" id="button3">
+                   <widget class="GtkButton" id="btn_or">
                      <property name="visible">True</property>
                      <property name="can_default">True</property>
                      <property name="can_focus">True</property>
-                     <property name="label" translatable="yes">OR</property>
-                     <property name="use_underline">True</property>
                      <property name="relief">GTK_RELIEF_NORMAL</property>
+
+                     <child>
+                       <widget class="GtkAlignment" id="alignment6">
+                         <property name="visible">True</property>
+                         <property name="xalign">0.5</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xscale">0</property>
+                         <property name="yscale">0</property>
+
+                         <child>
+                           <widget class="GtkHBox" id="hbox7">
+                             <property name="visible">True</property>
+                             <property name="homogeneous">False</property>
+                             <property name="spacing">2</property>
+
+                             <child>
+                               <widget class="GtkImage" id="image15">
+                                 <property name="visible">True</property>
+                                 <property name="pixbuf">or_e.png</property>
+                                 <property name="xalign">0.5</property>
+                                 <property name="yalign">0.5</property>
+                                 <property name="xpad">0</property>
+                                 <property name="ypad">0</property>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">False</property>
+                                 <property name="fill">False</property>
+                               </packing>
+                             </child>
+                           </widget>
+                         </child>
+                       </widget>
+                     </child>
                    </widget>
                  </child>
 
                  <child>
-                   <widget class="GtkButton" id="button4">
+                   <widget class="GtkButton" id="btn_not">
                      <property name="visible">True</property>
                      <property name="can_default">True</property>
                      <property name="can_focus">True</property>
-                     <property name="label" translatable="yes">NOT</property>
-                     <property name="use_underline">True</property>
                      <property name="relief">GTK_RELIEF_NORMAL</property>
+
+                     <child>
+                       <widget class="GtkAlignment" id="alignment7">
+                         <property name="visible">True</property>
+                         <property name="xalign">0.5</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xscale">0</property>
+                         <property name="yscale">0</property>
+
+                         <child>
+                           <widget class="GtkHBox" id="hbox8">
+                             <property name="visible">True</property>
+                             <property name="homogeneous">False</property>
+                             <property name="spacing">2</property>
+
+                             <child>
+                               <widget class="GtkImage" id="image16">
+                                 <property name="visible">True</property>
+                                 <property name="pixbuf">not_e.png</property>
+                                 <property name="xalign">0.5</property>
+                                 <property name="yalign">0.5</property>
+                                 <property name="xpad">0</property>
+                                 <property name="ypad">0</property>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">False</property>
+                                 <property name="fill">False</property>
+                               </packing>
+                             </child>
+                           </widget>
+                         </child>
+                       </widget>
+                     </child>
                    </widget>
                  </child>
                </widget>
 </widget>
 
 <widget class="GtkDialog" id="cistern_pty_wnd">
-  <property name="width_request">289</property>
-  <property name="height_request">143</property>
+  <property name="width_request">272</property>
+  <property name="height_request">182</property>
   <property name="title" translatable="yes">Propiedades del Tanque</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
   <property name="window_position">GTK_WIN_POS_CENTER</property>
       <child>
        <widget class="GtkTable" id="table2">
          <property name="visible">True</property>
-         <property name="n_rows">3</property>
+         <property name="n_rows">4</property>
          <property name="n_columns">2</property>
          <property name="homogeneous">True</property>
          <property name="row_spacing">0</property>
          <property name="column_spacing">0</property>
 
          <child>
-           <widget class="GtkLabel" id="label14">
+           <widget class="GtkEntry" id="txt_cistern_name">
              <property name="visible">True</property>
-             <property name="label" translatable="yes">Contenido Inicial</property>
-             <property name="use_underline">False</property>
-             <property name="use_markup">False</property>
-             <property name="justify">GTK_JUSTIFY_LEFT</property>
+             <property name="can_focus">True</property>
+             <property name="editable">True</property>
+             <property name="visibility">True</property>
+             <property name="max_length">0</property>
+             <property name="text" translatable="yes"></property>
+             <property name="has_frame">True</property>
+             <property name="invisible_char" translatable="yes">*</property>
+             <property name="activates_default">False</property>
+           </widget>
+           <packing>
+             <property name="left_attach">1</property>
+             <property name="right_attach">2</property>
+             <property name="top_attach">2</property>
+             <property name="bottom_attach">3</property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkSpinButton" id="spin_capacidad">
+             <property name="visible">True</property>
+             <property name="can_focus">True</property>
+             <property name="climb_rate">1</property>
+             <property name="digits">1</property>
+             <property name="numeric">False</property>
+             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+             <property name="snap_to_ticks">False</property>
              <property name="wrap">False</property>
-             <property name="selectable">False</property>
-             <property name="xalign">0</property>
-             <property name="yalign">0.5</property>
-             <property name="xpad">0</property>
-             <property name="ypad">0</property>
+             <property name="adjustment">0 0 100 0.1 10 10</property>
            </widget>
            <packing>
-             <property name="left_attach">0</property>
-             <property name="right_attach">1</property>
+             <property name="left_attach">1</property>
+             <property name="right_attach">2</property>
+             <property name="top_attach">1</property>
+             <property name="bottom_attach">2</property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkSpinButton" id="spin_inicial">
+             <property name="visible">True</property>
+             <property name="can_focus">True</property>
+             <property name="climb_rate">1</property>
+             <property name="digits">1</property>
+             <property name="numeric">False</property>
+             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+             <property name="snap_to_ticks">False</property>
+             <property name="wrap">False</property>
+             <property name="adjustment">0 0 100 0.1 10 10</property>
+           </widget>
+           <packing>
+             <property name="left_attach">1</property>
+             <property name="right_attach">2</property>
              <property name="top_attach">0</property>
              <property name="bottom_attach">1</property>
-             <property name="x_options">fill</property>
              <property name="y_options"></property>
            </packing>
          </child>
 
          <child>
-           <widget class="GtkLabel" id="label15">
+           <widget class="GtkButton" id="btn_select_color">
              <property name="visible">True</property>
-             <property name="label" translatable="yes">Capacidad Máxima</property>
-             <property name="use_underline">False</property>
-             <property name="use_markup">False</property>
-             <property name="justify">GTK_JUSTIFY_LEFT</property>
-             <property name="wrap">False</property>
-             <property name="selectable">False</property>
-             <property name="xalign">0</property>
-             <property name="yalign">0.5</property>
-             <property name="xpad">0</property>
-             <property name="ypad">0</property>
+             <property name="label">gtk-select-color</property>
+             <property name="use_stock">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
            </widget>
            <packing>
              <property name="left_attach">0</property>
              <property name="right_attach">1</property>
-             <property name="top_attach">1</property>
-             <property name="bottom_attach">2</property>
-             <property name="x_options">fill</property>
+             <property name="top_attach">3</property>
+             <property name="bottom_attach">4</property>
+             <property name="x_options"></property>
              <property name="y_options"></property>
            </packing>
          </child>
              <property name="right_attach">1</property>
              <property name="top_attach">2</property>
              <property name="bottom_attach">3</property>
-             <property name="x_options">fill</property>
-             <property name="y_options"></property>
-           </packing>
-         </child>
-
-         <child>
-           <widget class="GtkEntry" id="txt_cistern_name">
-             <property name="visible">True</property>
-             <property name="can_focus">True</property>
-             <property name="editable">True</property>
-             <property name="visibility">True</property>
-             <property name="max_length">0</property>
-             <property name="text" translatable="yes"></property>
-             <property name="has_frame">True</property>
-             <property name="invisible_char" translatable="yes">*</property>
-             <property name="activates_default">False</property>
-           </widget>
-           <packing>
-             <property name="left_attach">1</property>
-             <property name="right_attach">2</property>
-             <property name="top_attach">2</property>
-             <property name="bottom_attach">3</property>
+             <property name="x_options"></property>
              <property name="y_options"></property>
            </packing>
          </child>
 
          <child>
-           <widget class="GtkSpinButton" id="spin_capacidad">
+           <widget class="GtkLabel" id="label15">
              <property name="visible">True</property>
-             <property name="can_focus">True</property>
-             <property name="climb_rate">1</property>
-             <property name="digits">1</property>
-             <property name="numeric">False</property>
-             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
-             <property name="snap_to_ticks">False</property>
+             <property name="label" translatable="yes">Capacidad Máxima</property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_LEFT</property>
              <property name="wrap">False</property>
-             <property name="adjustment">0 0 100 0.1 10 10</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
            </widget>
            <packing>
-             <property name="left_attach">1</property>
-             <property name="right_attach">2</property>
+             <property name="left_attach">0</property>
+             <property name="right_attach">1</property>
              <property name="top_attach">1</property>
              <property name="bottom_attach">2</property>
+             <property name="x_options"></property>
              <property name="y_options"></property>
            </packing>
          </child>
 
          <child>
-           <widget class="GtkSpinButton" id="spin_inicial">
+           <widget class="GtkLabel" id="label14">
              <property name="visible">True</property>
-             <property name="can_focus">True</property>
-             <property name="climb_rate">1</property>
-             <property name="digits">1</property>
-             <property name="numeric">False</property>
-             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
-             <property name="snap_to_ticks">False</property>
+             <property name="label" translatable="yes">Contenido Inicial</property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_LEFT</property>
              <property name="wrap">False</property>
-             <property name="adjustment">0 0 100 0.1 10 10</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
            </widget>
            <packing>
-             <property name="left_attach">1</property>
-             <property name="right_attach">2</property>
+             <property name="left_attach">0</property>
+             <property name="right_attach">1</property>
              <property name="top_attach">0</property>
              <property name="bottom_attach">1</property>
+             <property name="x_options"></property>
              <property name="y_options"></property>
            </packing>
          </child>
 </widget>
 
 <widget class="GtkDialog" id="item_pty_wnd">
+  <property name="width_request">287</property>
+  <property name="height_request">103</property>
   <property name="title" translatable="yes">Propiedades del </property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
   <property name="window_position">GTK_WIN_POS_CENTER</property>
       <child internal-child="action_area">
        <widget class="GtkHButtonBox" id="dialog-action_area2">
          <property name="visible">True</property>
-         <property name="layout_style">GTK_BUTTONBOX_END</property>
+         <property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
 
          <child>
            <widget class="GtkButton" id="btn_cancel">
          </child>
 
          <child>
-           <widget class="GtkLabel" id="lbl_property">
+           <widget class="GtkEntry" id="txt_item_name">
              <property name="visible">True</property>
-             <property name="label" translatable="yes">Flujo Máximo</property>
-             <property name="use_underline">False</property>
-             <property name="use_markup">False</property>
-             <property name="justify">GTK_JUSTIFY_CENTER</property>
-             <property name="wrap">False</property>
-             <property name="selectable">False</property>
-             <property name="xalign">0</property>
-             <property name="yalign">0.5</property>
-             <property name="xpad">0</property>
-             <property name="ypad">0</property>
+             <property name="can_focus">True</property>
+             <property name="editable">True</property>
+             <property name="visibility">True</property>
+             <property name="max_length">0</property>
+             <property name="text" translatable="yes"></property>
+             <property name="has_frame">True</property>
+             <property name="invisible_char" translatable="yes">*</property>
+             <property name="activates_default">False</property>
            </widget>
            <packing>
-             <property name="left_attach">0</property>
-             <property name="right_attach">1</property>
-             <property name="top_attach">0</property>
-             <property name="bottom_attach">1</property>
-             <property name="x_options">fill</property>
+             <property name="left_attach">1</property>
+             <property name="right_attach">2</property>
+             <property name="top_attach">1</property>
+             <property name="bottom_attach">2</property>
              <property name="y_options"></property>
            </packing>
          </child>
              <property name="right_attach">1</property>
              <property name="top_attach">1</property>
              <property name="bottom_attach">2</property>
-             <property name="x_options">fill</property>
+             <property name="x_options"></property>
              <property name="y_options"></property>
            </packing>
          </child>
 
          <child>
-           <widget class="GtkEntry" id="txt_item_name">
+           <widget class="GtkLabel" id="lbl_property">
              <property name="visible">True</property>
-             <property name="can_focus">True</property>
-             <property name="editable">True</property>
-             <property name="visibility">True</property>
-             <property name="max_length">0</property>
-             <property name="text" translatable="yes"></property>
-             <property name="has_frame">True</property>
-             <property name="invisible_char" translatable="yes">*</property>
-             <property name="activates_default">False</property>
+             <property name="label" translatable="yes">Flujo Máximo</property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_CENTER</property>
+             <property name="wrap">False</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
            </widget>
            <packing>
-             <property name="left_attach">1</property>
-             <property name="right_attach">2</property>
-             <property name="top_attach">1</property>
-             <property name="bottom_attach">2</property>
+             <property name="left_attach">0</property>
+             <property name="right_attach">1</property>
+             <property name="top_attach">0</property>
+             <property name="bottom_attach">1</property>
+             <property name="x_options"></property>
              <property name="y_options"></property>
            </packing>
          </child>
 </widget>
 
 <widget class="GtkDialog" id="exclusa_pty_wnd">
-  <property name="width_request">273</property>
+  <property name="width_request">267</property>
   <property name="height_request">143</property>
   <property name="title" translatable="yes">Propiedades de la Exclusa</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
          <property name="column_spacing">0</property>
 
          <child>
-           <widget class="GtkLabel" id="label22">
-             <property name="visible">True</property>
-             <property name="label" translatable="yes">Capacidad Máxima</property>
-             <property name="use_underline">False</property>
-             <property name="use_markup">False</property>
-             <property name="justify">GTK_JUSTIFY_LEFT</property>
-             <property name="wrap">False</property>
-             <property name="selectable">False</property>
-             <property name="xalign">0</property>
-             <property name="yalign">0.5</property>
-             <property name="xpad">0</property>
-             <property name="ypad">0</property>
-           </widget>
-           <packing>
-             <property name="left_attach">0</property>
-             <property name="right_attach">1</property>
-             <property name="top_attach">1</property>
-             <property name="bottom_attach">2</property>
-             <property name="x_options">fill</property>
-             <property name="y_options"></property>
-           </packing>
-         </child>
-
-         <child>
-           <widget class="GtkLabel" id="label23">
-             <property name="visible">True</property>
-             <property name="label" translatable="yes">Estado</property>
-             <property name="use_underline">False</property>
-             <property name="use_markup">False</property>
-             <property name="justify">GTK_JUSTIFY_LEFT</property>
-             <property name="wrap">False</property>
-             <property name="selectable">False</property>
-             <property name="xalign">0</property>
-             <property name="yalign">0.5</property>
-             <property name="xpad">0</property>
-             <property name="ypad">0</property>
-           </widget>
-           <packing>
-             <property name="left_attach">0</property>
-             <property name="right_attach">1</property>
-             <property name="top_attach">0</property>
-             <property name="bottom_attach">1</property>
-             <property name="x_options">fill</property>
-             <property name="y_options"></property>
-           </packing>
-         </child>
-
-         <child>
-           <widget class="GtkHBox" id="hbox5">
+           <widget class="GtkHBox" id="hbox5">
              <property name="visible">True</property>
              <property name="homogeneous">False</property>
              <property name="spacing">0</property>
            </packing>
          </child>
 
+         <child>
+           <widget class="GtkLabel" id="label23">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">Estado</property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_LEFT</property>
+             <property name="wrap">False</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
+           </widget>
+           <packing>
+             <property name="left_attach">0</property>
+             <property name="right_attach">1</property>
+             <property name="top_attach">0</property>
+             <property name="bottom_attach">1</property>
+             <property name="x_options"></property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkLabel" id="label22">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">Nombre</property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_LEFT</property>
+             <property name="wrap">False</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
+           </widget>
+           <packing>
+             <property name="left_attach">0</property>
+             <property name="right_attach">1</property>
+             <property name="top_attach">1</property>
+             <property name="bottom_attach">2</property>
+             <property name="x_options"></property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
          <child>
            <widget class="GtkEntry" id="txt_exclusa_name">
              <property name="visible">True</property>
   </child>
 </widget>
 
+<widget class="GtkColorSelectionDialog" id="color_select_dlg">
+  <property name="title" translatable="yes">Seleccionar Color</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_CENTER</property>
+  <property name="modal">False</property>
+  <property name="resizable">False</property>
+  <property name="destroy_with_parent">False</property>
+
+  <child internal-child="cancel_button">
+    <widget class="GtkButton" id="dlg_select_color_cancel">
+      <property name="visible">True</property>
+      <property name="can_default">True</property>
+      <property name="can_focus">True</property>
+      <property name="relief">GTK_RELIEF_NORMAL</property>
+    </widget>
+  </child>
+
+  <child internal-child="ok_button">
+    <widget class="GtkButton" id="dlg_select_color_ok">
+      <property name="visible">True</property>
+      <property name="can_default">True</property>
+      <property name="can_focus">True</property>
+      <property name="relief">GTK_RELIEF_NORMAL</property>
+    </widget>
+  </child>
+
+  <child internal-child="help_button">
+    <widget class="GtkButton" id="help_button1">
+      <property name="visible">True</property>
+      <property name="can_default">True</property>
+      <property name="can_focus">True</property>
+      <property name="label">gtk-help</property>
+      <property name="use_stock">True</property>
+      <property name="relief">GTK_RELIEF_NORMAL</property>
+    </widget>
+  </child>
+
+  <child internal-child="color_selection">
+    <widget class="GtkColorSelection" id="color_selection1">
+      <property name="visible">True</property>
+      <property name="has_opacity_control">False</property>
+      <property name="has_palette">False</property>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkDialog" id="pump_pty_wnd">
+  <property name="width_request">291</property>
+  <property name="height_request">152</property>
+  <property name="title" translatable="yes">Propiedades de la Bomba</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_CENTER</property>
+  <property name="modal">False</property>
+  <property name="resizable">False</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="vbox4">
+      <property name="width_request">320</property>
+      <property name="height_request">158</property>
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+       <widget class="GtkHButtonBox" id="hbuttonbox2">
+         <property name="visible">True</property>
+         <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+         <child>
+           <widget class="GtkButton" id="btn_cancel">
+             <property name="visible">True</property>
+             <property name="can_default">True</property>
+             <property name="can_focus">True</property>
+             <property name="label">gtk-cancel</property>
+             <property name="use_stock">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
+             <property name="response_id">-6</property>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkButton" id="btn_apply">
+             <property name="visible">True</property>
+             <property name="can_default">True</property>
+             <property name="can_focus">True</property>
+             <property name="label">gtk-apply</property>
+             <property name="use_stock">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
+             <property name="response_id">-10</property>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkButton" id="btn_accept">
+             <property name="visible">True</property>
+             <property name="can_default">True</property>
+             <property name="can_focus">True</property>
+             <property name="label">gtk-ok</property>
+             <property name="use_stock">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
+             <property name="response_id">-5</property>
+           </widget>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">True</property>
+         <property name="pack_type">GTK_PACK_END</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkTable" id="table4">
+         <property name="visible">True</property>
+         <property name="n_rows">3</property>
+         <property name="n_columns">2</property>
+         <property name="homogeneous">True</property>
+         <property name="row_spacing">0</property>
+         <property name="column_spacing">0</property>
+
+         <child>
+           <widget class="GtkSpinButton" id="spin_fluid">
+             <property name="visible">True</property>
+             <property name="can_focus">True</property>
+             <property name="climb_rate">1</property>
+             <property name="digits">1</property>
+             <property name="numeric">False</property>
+             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+             <property name="snap_to_ticks">False</property>
+             <property name="wrap">False</property>
+             <property name="adjustment">0 0 100 0.1 10 10</property>
+           </widget>
+           <packing>
+             <property name="left_attach">1</property>
+             <property name="right_attach">2</property>
+             <property name="top_attach">0</property>
+             <property name="bottom_attach">1</property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkButton" id="btn_select_color">
+             <property name="visible">True</property>
+             <property name="label">gtk-select-color</property>
+             <property name="use_stock">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
+           </widget>
+           <packing>
+             <property name="left_attach">0</property>
+             <property name="right_attach">1</property>
+             <property name="top_attach">2</property>
+             <property name="bottom_attach">3</property>
+             <property name="x_options">expand</property>
+             <property name="y_options">expand</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkLabel" id="label26">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">Nombre</property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_LEFT</property>
+             <property name="wrap">False</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
+           </widget>
+           <packing>
+             <property name="left_attach">0</property>
+             <property name="right_attach">1</property>
+             <property name="top_attach">1</property>
+             <property name="bottom_attach">2</property>
+             <property name="x_options"></property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkLabel" id="label25">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">Flujo Máximo</property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_CENTER</property>
+             <property name="wrap">False</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
+           </widget>
+           <packing>
+             <property name="left_attach">0</property>
+             <property name="right_attach">1</property>
+             <property name="top_attach">0</property>
+             <property name="bottom_attach">1</property>
+             <property name="x_options"></property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkEntry" id="txt_pump_name">
+             <property name="visible">True</property>
+             <property name="can_focus">True</property>
+             <property name="editable">True</property>
+             <property name="visibility">True</property>
+             <property name="max_length">0</property>
+             <property name="text" translatable="yes"></property>
+             <property name="has_frame">True</property>
+             <property name="invisible_char" translatable="yes">*</property>
+             <property name="activates_default">False</property>
+           </widget>
+           <packing>
+             <property name="left_attach">1</property>
+             <property name="right_attach">2</property>
+             <property name="top_attach">1</property>
+             <property name="bottom_attach">2</property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">10</property>
+         <property name="expand">True</property>
+         <property name="fill">False</property>
+         <property name="pack_type">GTK_PACK_END</property>
+       </packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
 </glade-interface>
index 12e171217f435bd798da545356111e99d360ac68..b9297fb77b039ececdd90ae460a07c1eb428da9c 100644 (file)
@@ -21,6 +21,9 @@
 #include "cistern.h"
 #include "exclusa.h"
 #include "pump.h"
+#include "and.h"
+#include "or.h"
+#include "not.h"
 
 class Constructor : public Gtk::Window {
        public: 
@@ -31,14 +34,15 @@ class Constructor : public Gtk::Window {
        protected: 
        int id;
                // / defino los elementos de la ventana.
-       Gtk::Button *btn_canio, *btn_codo, *btn_y, *btn_tanque, *btn_bomba, *btn_exclusa, *btn_file_ok, *btn_file_cancel, *btn_check, *btn_dlg_close;
+       Gtk::Button *btn_canio, *btn_codo, *btn_y, *btn_tanque, *btn_bomba, *btn_exclusa, *btn_file_ok, *btn_file_cancel, *btn_check, *btn_dlg_close,
+                                               *btn_and, *btn_or, *btn_not;
        Gtk::ImageMenuItem *main_menu_quit, *edit_menu_del, *main_menu_save;
        Gtk::CheckButton *chk_btn_logica;
        Gtk::FileSelection *file_selection;
        Gtk::Entry *combo_entry;
        Gtk::Dialog *dlg_connect;
        Gtk::Label *dlg_label;
-       Glib::RefPtr<Gdk::Pixbuf> ico_canio, ico_y, ico_codo, ico_tanque, ico_bomba, ico_exclusa;
+       Glib::RefPtr<Gdk::Pixbuf> ico_canio, ico_y, ico_codo, ico_tanque, ico_bomba, ico_exclusa, ico_and, ico_or, ico_not;
        Glib::RefPtr<Gdk::Pixbuf> ico_last;
        std::list<Gtk::TargetEntry> listTargets;
        std::list<CItem *> listaItems;
@@ -53,6 +57,9 @@ class Constructor : public Gtk::Window {
        virtual void on_btn_tanque_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
        virtual void on_btn_bomba_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
        virtual void on_btn_exclusa_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
+       virtual void on_btn_and_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
+       virtual void on_btn_or_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
+       virtual void on_btn_not_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
        virtual void on_main_menu_quit();
        virtual void on_main_menu_save();
        virtual void on_edit_menu_del();
@@ -69,6 +76,9 @@ class Constructor : public Gtk::Window {
        virtual void on_tanque_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
        virtual void on_bomba_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
        virtual void on_exclusa_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
+       virtual void on_and_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
+       virtual void on_or_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
+       virtual void on_not_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
        
        virtual void on_item_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context, CItem *);
        virtual void on_item_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
diff --git a/Constructor/not.cpp b/Constructor/not.cpp
new file mode 100644 (file)
index 0000000..1107030
--- /dev/null
@@ -0,0 +1,110 @@
+#include "not.h"
+
+Not::Not()
+{
+       imageN = Gdk::Pixbuf::create_from_file("not_n.png");
+       imageS = Gdk::Pixbuf::create_from_file("not_s.png");
+       imageE = Gdk::Pixbuf::create_from_file("not_e.png");
+       imageO = Gdk::Pixbuf::create_from_file("not_o.png");
+       null = Gdk::Pixbuf::create_from_file("null.png");
+       imgActual = 0;
+       image = imageE;
+       set_size_request(image->get_width(), image->get_height());
+       name = "not";
+}
+
+Not::~Not()
+{
+}
+
+bool Not::on_button_press_event(GdkEventButton *event)
+{
+       if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 1))
+               combo_entry->set_text(name);
+       
+       if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 2)){
+               image = null;   
+               image->render_to_drawable(get_window(),get_style()->get_black_gc(),0,0,0,0,image->get_width(),image->get_height(),Gdk::RGB_DITHER_NONE,0,0);
+               imgActual++;
+               switch (imgActual) {
+                       case 1:
+                               image = imageS;
+                               break;
+                       case 2:
+                               image = imageO;
+                               break;
+                       case 3:
+                               image = imageN;
+                               break;
+                       default: 
+                               imgActual = 0;
+                               image = imageE;                 
+               }
+               set_size_request(image->get_width(),image->get_height());
+               image->render_to_drawable(get_window(),get_style()->get_black_gc(),0,0,0,0,image->get_width(),image->get_height(),Gdk::RGB_DITHER_NONE,0,0);
+       }
+       if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 3)){
+               menu_popup.popup(event->button, event->time);
+                return true; //It has been handled.
+       }
+       return true;
+}
+void Not::on_menu_popup_rotar()
+{
+       GdkEventButton event; 
+       event.type = GDK_BUTTON_PRESS;
+       event.button = 2;
+       Not::on_button_press_event(&event);
+}
+
+void Not::save(FILE *archivo)
+{
+
+}
+
+
+// CAMBIAR TODO ESTO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+bool Not::check_connection()
+{
+       switch (get_img_actual()) {
+                       case 0:
+                               if ( is_other_connection_area( get_position_x()-5, get_position_y()+16) && 
+                                        is_other_connection_area( get_position_x()+get_image()->get_width()-16, +get_position_y()+get_image()->get_height() + 5) )
+                                       return true;                            
+                               break;  
+                       case 1:
+                               if ( is_other_connection_area( get_position_x()+get_image()->get_width() - 16, get_position_y() -5) && 
+                                        is_other_connection_area( get_position_x()-5, get_position_y()+get_image()->get_height()-16) )
+                                       return true;
+                               break;
+                       case 2:
+                               if ( is_other_connection_area( get_position_x() + 16, get_position_y() -5) &&
+                                        is_other_connection_area( get_position_x()+get_image()->get_width()+5, get_position_y()+get_image()->get_height()-16) )
+                                       return true;
+                               break;
+                       case 3:
+                               if ( is_other_connection_area( get_position_x()+get_image()->get_width()+5, get_position_y() +16) &&
+                                        is_other_connection_area( get_position_x() + 16, get_position_y()+get_image()->get_height() + 5) )
+                                       return true;
+       }
+       return false;
+}
+
+bool Not::is_connection_area(int _a, int _b)
+{
+       switch (imgActual) {
+               case 0: if ( ( (_a <= x+10)&&(_a > x) && (_b <=y+22)&&(_b>=y+10) ) ||
+                                                ( (_a <= x+image->get_width()-10)&&(_a>=x+image->get_width()-22)&&(_b<=y+image->get_height()-1)&&(_b>=y+image->get_height()-10) ) )
+                                               return true;
+               case 1: if ( ( (_a <= x+image->get_width()-10)&&(_a >= x+image->get_width()-22) && (_b <=y+10)&&(_b > y) ) ||
+                                                ( (_a <= x+10)&&(_a > x)&&(_b<=y+image->get_height()-10)&&(_b>=y+image->get_height()-22) ) )
+                                               return true;
+               case 2: if ( ( (_a <= x+22)&&(_a >= x+10) && (_b <=y+10)&&(_b > y) ) ||
+                                                ( (_a <= x+image->get_width()-1)&&(_a>=x+image->get_width()-10)&&(_b<=y+image->get_height()-10)&&(_b>=y+image->get_height()-22) ) )
+                                               return true;
+               case 3: if ( ( (_a <= x+image->get_width()-1)&&(_a >= x+image->get_width()-10) && (_b <=y+22)&&(_b>=y+10) ) ||
+                                                ( (_a <= x+22)&&(_a>=x+10)&&(_b<=y+image->get_height()-1)&&(_b>=y+image->get_height()-10) ) )
+                                               return true;
+       }
+       return false;
+}
diff --git a/Constructor/not.h b/Constructor/not.h
new file mode 100644 (file)
index 0000000..dd572fe
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef _NOT_H_
+#define _NOT_H_
+
+#include "item.h"
+
+class Not : public CItem {
+       public:
+               Not();
+               virtual ~Not();
+               virtual bool on_button_press_event(GdkEventButton *event);
+               virtual void on_menu_popup_rotar();
+               virtual void save(FILE *archivo);
+               virtual bool check_connection();
+               virtual bool is_connection_area(int _a, int _b);
+       private:
+               Glib::RefPtr<Gdk::Pixbuf> imageN; // 0 
+               Glib::RefPtr<Gdk::Pixbuf> imageS; // 1
+               Glib::RefPtr<Gdk::Pixbuf> imageE; // 2
+               Glib::RefPtr<Gdk::Pixbuf> imageO; // 3
+               Glib::RefPtr<Gdk::Pixbuf> null; 
+};
+#endif
diff --git a/Constructor/not.o b/Constructor/not.o
new file mode 100644 (file)
index 0000000..4491cbc
Binary files /dev/null and b/Constructor/not.o differ
diff --git a/Constructor/not_e.png b/Constructor/not_e.png
new file mode 100644 (file)
index 0000000..ce39789
Binary files /dev/null and b/Constructor/not_e.png differ
diff --git a/Constructor/not_n.png b/Constructor/not_n.png
new file mode 100644 (file)
index 0000000..3b51716
Binary files /dev/null and b/Constructor/not_n.png differ
diff --git a/Constructor/not_o.png b/Constructor/not_o.png
new file mode 100644 (file)
index 0000000..7ee2125
Binary files /dev/null and b/Constructor/not_o.png differ
diff --git a/Constructor/not_s.png b/Constructor/not_s.png
new file mode 100644 (file)
index 0000000..cc8e708
Binary files /dev/null and b/Constructor/not_s.png differ
diff --git a/Constructor/or.cpp b/Constructor/or.cpp
new file mode 100644 (file)
index 0000000..d68dc6d
--- /dev/null
@@ -0,0 +1,110 @@
+#include "or.h"
+
+Or::Or()
+{
+       imageN = Gdk::Pixbuf::create_from_file("or_n.png");
+       imageS = Gdk::Pixbuf::create_from_file("or_s.png");
+       imageE = Gdk::Pixbuf::create_from_file("or_e.png");
+       imageO = Gdk::Pixbuf::create_from_file("or_o.png");
+       null = Gdk::Pixbuf::create_from_file("null.png");
+       imgActual = 0;
+       image = imageE;
+       set_size_request(image->get_width(), image->get_height());
+       name = "or";
+}
+
+Or::~Or()
+{
+}
+
+bool Or::on_button_press_event(GdkEventButton *event)
+{
+       if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 1))
+               combo_entry->set_text(name);
+       
+       if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 2)){
+               image = null;   
+               image->render_to_drawable(get_window(),get_style()->get_black_gc(),0,0,0,0,image->get_width(),image->get_height(),Gdk::RGB_DITHER_NONE,0,0);
+               imgActual++;
+               switch (imgActual) {
+                       case 1:
+                               image = imageS;
+                               break;
+                       case 2:
+                               image = imageO;
+                               break;
+                       case 3:
+                               image = imageN;
+                               break;
+                       default: 
+                               imgActual = 0;
+                               image = imageE;                 
+               }
+               set_size_request(image->get_width(),image->get_height());
+               image->render_to_drawable(get_window(),get_style()->get_black_gc(),0,0,0,0,image->get_width(),image->get_height(),Gdk::RGB_DITHER_NONE,0,0);
+       }
+       if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 3)){
+               menu_popup.popup(event->button, event->time);
+                return true; //It has been handled.
+       }
+       return true;
+}
+void Or::on_menu_popup_rotar()
+{
+       GdkEventButton event; 
+       event.type = GDK_BUTTON_PRESS;
+       event.button = 2;
+       Or::on_button_press_event(&event);
+}
+
+void Or::save(FILE *archivo)
+{
+
+}
+
+
+// CAMBIAR TODO ESTO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+bool Or::check_connection()
+{
+       switch (get_img_actual()) {
+                       case 0:
+                               if ( is_other_connection_area( get_position_x()-5, get_position_y()+16) && 
+                                        is_other_connection_area( get_position_x()+get_image()->get_width()-16, +get_position_y()+get_image()->get_height() + 5) )
+                                       return true;                            
+                               break;  
+                       case 1:
+                               if ( is_other_connection_area( get_position_x()+get_image()->get_width() - 16, get_position_y() -5) && 
+                                        is_other_connection_area( get_position_x()-5, get_position_y()+get_image()->get_height()-16) )
+                                       return true;
+                               break;
+                       case 2:
+                               if ( is_other_connection_area( get_position_x() + 16, get_position_y() -5) &&
+                                        is_other_connection_area( get_position_x()+get_image()->get_width()+5, get_position_y()+get_image()->get_height()-16) )
+                                       return true;
+                               break;
+                       case 3:
+                               if ( is_other_connection_area( get_position_x()+get_image()->get_width()+5, get_position_y() +16) &&
+                                        is_other_connection_area( get_position_x() + 16, get_position_y()+get_image()->get_height() + 5) )
+                                       return true;
+       }
+       return false;
+}
+
+bool Or::is_connection_area(int _a, int _b)
+{
+       switch (imgActual) {
+               case 0: if ( ( (_a <= x+10)&&(_a > x) && (_b <=y+22)&&(_b>=y+10) ) ||
+                                                ( (_a <= x+image->get_width()-10)&&(_a>=x+image->get_width()-22)&&(_b<=y+image->get_height()-1)&&(_b>=y+image->get_height()-10) ) )
+                                               return true;
+               case 1: if ( ( (_a <= x+image->get_width()-10)&&(_a >= x+image->get_width()-22) && (_b <=y+10)&&(_b > y) ) ||
+                                                ( (_a <= x+10)&&(_a > x)&&(_b<=y+image->get_height()-10)&&(_b>=y+image->get_height()-22) ) )
+                                               return true;
+               case 2: if ( ( (_a <= x+22)&&(_a >= x+10) && (_b <=y+10)&&(_b > y) ) ||
+                                                ( (_a <= x+image->get_width()-1)&&(_a>=x+image->get_width()-10)&&(_b<=y+image->get_height()-10)&&(_b>=y+image->get_height()-22) ) )
+                                               return true;
+               case 3: if ( ( (_a <= x+image->get_width()-1)&&(_a >= x+image->get_width()-10) && (_b <=y+22)&&(_b>=y+10) ) ||
+                                                ( (_a <= x+22)&&(_a>=x+10)&&(_b<=y+image->get_height()-1)&&(_b>=y+image->get_height()-10) ) )
+                                               return true;
+       }
+       return false;
+}
diff --git a/Constructor/or.h b/Constructor/or.h
new file mode 100644 (file)
index 0000000..b0de3da
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef _OR_H_
+#define _OR_H_
+
+#include "item.h"
+
+class Or : public CItem {
+       public:
+               Or();
+               virtual ~Or();
+               virtual bool on_button_press_event(GdkEventButton *event);
+               virtual void on_menu_popup_rotar();
+               virtual void save(FILE *archivo);
+               virtual bool check_connection();
+               virtual bool is_connection_area(int _a, int _b);
+       private:
+               Glib::RefPtr<Gdk::Pixbuf> imageN; // 0 
+               Glib::RefPtr<Gdk::Pixbuf> imageS; // 1
+               Glib::RefPtr<Gdk::Pixbuf> imageE; // 2
+               Glib::RefPtr<Gdk::Pixbuf> imageO; // 3
+               Glib::RefPtr<Gdk::Pixbuf> null; 
+};
+#endif
diff --git a/Constructor/or.o b/Constructor/or.o
new file mode 100644 (file)
index 0000000..6ff0b0c
Binary files /dev/null and b/Constructor/or.o differ
diff --git a/Constructor/or_e.png b/Constructor/or_e.png
new file mode 100644 (file)
index 0000000..d177791
Binary files /dev/null and b/Constructor/or_e.png differ
diff --git a/Constructor/or_n.png b/Constructor/or_n.png
new file mode 100644 (file)
index 0000000..cdf6610
Binary files /dev/null and b/Constructor/or_n.png differ
diff --git a/Constructor/or_o.png b/Constructor/or_o.png
new file mode 100644 (file)
index 0000000..d86a398
Binary files /dev/null and b/Constructor/or_o.png differ
diff --git a/Constructor/or_s.png b/Constructor/or_s.png
new file mode 100644 (file)
index 0000000..82eff98
Binary files /dev/null and b/Constructor/or_s.png differ
index 3c5062cf5c9b2f7004d6e8d832203178a045e3bc..383552b3809b2ede30b0974e979614ea53fef75a 100644 (file)
@@ -5,6 +5,8 @@
 #include <gtkmm/button.h>
 #include <gtkmm/spinbutton.h>
 #include <gtkmm/entry.h>
+#include <gtkmm/colorselection.h>
+#include <gdkmm.h>
 #include <libglademm.h>
 
 class CItem;
index 719a1f9c83a84967b69731da8f58e43abce8cd4d..c2f2edb22f8b187769f0d02ad2a709db515823fb 100644 (file)
@@ -10,10 +10,9 @@ Pump::Pump()
        image = imageE;
        set_size_request(image->get_width(), image->get_height());
 
-       Glib::RefPtr<Gnome::Glade::Xml> ref = Gnome::Glade::Xml::create("constructor.glade", "item_pty_wnd");
-       ref->get_widget_derived("item_pty_wnd",pump_pty_wnd);
+       Glib::RefPtr<Gnome::Glade::Xml> ref = Gnome::Glade::Xml::create("constructor.glade", "pump_pty_wnd");
+       ref->get_widget_derived("pump_pty_wnd",pump_pty_wnd);
        pump_pty_wnd->pump = this;
-       pump_pty_wnd->set_title("Propiedades de la Bomba");     
        name = "bomba";
 }
 
@@ -48,8 +47,8 @@ bool Pump::on_button_press_event(GdkEventButton *event)
        }
        
        if ((event->type == GDK_2BUTTON_PRESS) && (event->button ==1)){
-               pump_pty_wnd->spin_caudal->set_value( entrega );
-               pump_pty_wnd->txt_item_name->set_text( name );
+               pump_pty_wnd->spin_fluid->set_value( entrega );
+               pump_pty_wnd->txt_pump_name->set_text( name );
                pump_pty_wnd->show();
        }               
        return true;
@@ -76,14 +75,27 @@ void Pump::set_entrega(double _ent)
        entrega = _ent;
 }
 
+void Pump::set_liquid_color(Gdk::Color _color)
+{
+       liquid_color = _color;
+}
+
 double Pump::get_entrega()
 {
        return entrega;
 }
 
+Gdk::Color Pump::get_liquid_color()
+{
+       return liquid_color;
+}
+
 void Pump::save(FILE *archivo)
 {
-       char c_id[50], c_entrega[50], c_x[50], c_y[50], c_img[50];
+       char c_id[50], c_entrega[50], c_x[50], c_y[50], c_img[50], c_red[50], c_green[50], c_blue[50];
+       sprintf(c_red,"\t\t\t<rojo>%d</rojo>\n",liquid_color.get_red());
+       sprintf(c_green,"\t\t\t<verde>%d</verde>\n",liquid_color.get_green());
+       sprintf(c_blue,"\t\t\t<azul>%d</azul>\n",liquid_color.get_blue());
        sprintf(c_x,"\t\t<x>%d</x>\n",x);
        sprintf(c_y,"\t\t<y>%d</y>\n",y);
        sprintf(c_id,"%d",ID);
@@ -94,6 +106,11 @@ void Pump::save(FILE *archivo)
        dato += c_id;
        dato += "\">\n";
        dato += c_entrega;
+       dato += "\t<color>\n";
+       dato += c_red;
+       dato += c_green;
+       dato += c_blue;
+       dato += "\t</color>\n";
        dato += c_img;
        dato += c_x; 
        dato += c_y;
index 17a47488fbaafa6c78b4c7737e53ff9cc9356694..0fd2d077faf8416ddff99bb9b0befe6586666a18 100644 (file)
@@ -14,7 +14,9 @@ class Pump : public CItem {
                virtual void on_menu_popup_rotar();
                virtual void on_menu_popup_propiedades();
                void set_entrega(double _cap);
+               void set_liquid_color(Gdk::Color _color);
                double get_entrega();
+               Gdk::Color get_liquid_color();
                virtual void save(FILE *archivo);
                virtual bool check_connection();
                virtual bool is_connection_area(int _a, int _b);
@@ -23,6 +25,7 @@ class Pump : public CItem {
                Glib::RefPtr<Gdk::Pixbuf> imageE; // 0 
                Glib::RefPtr<Gdk::Pixbuf> imageO; // 1
                Glib::RefPtr<Gdk::Pixbuf> null; 
+               Gdk::Color liquid_color;
                PumpPtyWnd *pump_pty_wnd;
 };
 #endif
index 7b150d14b2ab183e610ea9eb410f85ffe86f60bf..d4510f348e5783af3f371ca4353557f0388dfe44 100644 (file)
@@ -1,11 +1,20 @@
 #include "pumpptywnd.h"
 #include "pump.h"
 
-PumpPtyWnd::PumpPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade):ItemPtyWnd(cobject, refGlade)
+PumpPtyWnd::PumpPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade):PropertyWnd(cobject, refGlade)
 {
-       refGlade->get_widget("lbl_property", lbl_property);
-       refGlade->get_widget("txt_item_name", txt_item_name);
-       lbl_property->set_text("Entrega Maxima");
+       refGlade->get_widget("btn_select_color",btn_select_color);
+       refGlade->get_widget("spin_fluid",spin_fluid);
+       refGlade->get_widget("txt_pump_name",txt_pump_name);
+       
+       Glib::RefPtr<Gnome::Glade::Xml> ref = Gnome::Glade::Xml::create("constructor.glade", "color_select_dlg");
+       ref->get_widget("color_select_dlg",color_select_dlg);
+       ref->get_widget("dlg_select_color_cancel",dlg_select_color_cancel);
+       ref->get_widget("dlg_select_color_ok",dlg_select_color_ok);
+
+       btn_select_color->signal_clicked().connect(SigC::slot(*this,&PumpPtyWnd::on_btn_select_color_clicked));
+       dlg_select_color_cancel->signal_clicked().connect(SigC::slot(*this,&PumpPtyWnd::on_dlg_select_color_cancel_clicked));
+       dlg_select_color_ok->signal_clicked().connect(SigC::slot(*this,&PumpPtyWnd::on_dlg_select_color_ok_clicked));
 }
 
 PumpPtyWnd::~PumpPtyWnd()
@@ -14,13 +23,31 @@ PumpPtyWnd::~PumpPtyWnd()
  
 void PumpPtyWnd::on_btn_accept_clicked()
 {
-       pump->set_entrega( spin_caudal->get_value() );
-       pump->set_name( txt_item_name->get_text() );
+       PumpPtyWnd::on_btn_apply_clicked();
        hide();
 }
 
 void PumpPtyWnd::on_btn_apply_clicked()
 {
-       pump->set_entrega( spin_caudal->get_value() );
-       pump->set_name( txt_item_name->get_text() );
+       pump->set_entrega( spin_fluid->get_value() );
+       pump->set_name( txt_pump_name->get_text() );
+       color_select_dlg->get_colorsel()->set_current_color(pump->get_liquid_color());
+}
+
+void PumpPtyWnd::on_btn_select_color_clicked()
+{
+       // poner un preview del color seleccionado
+       color_select_dlg->get_colorsel()->set_current_color(pump->get_liquid_color());
+       color_select_dlg->show();
+}
+
+void PumpPtyWnd::on_dlg_select_color_cancel_clicked()
+{
+       color_select_dlg->hide();
+}
+
+void PumpPtyWnd::on_dlg_select_color_ok_clicked()
+{
+       pump->set_liquid_color( color_select_dlg->get_colorsel()->get_current_color() );
+       color_select_dlg->hide();
 }
index 502240baf0842f3547479124f4713eacae4d5722..5ad59ab11eea1dcb8a45d8c905b5faf6c1176581 100644 (file)
@@ -1,18 +1,24 @@
 #ifndef _PUMPPTYWND_H_
 #define _PUMPPTYWND_H_
 
-#include "itemptywnd.h"
+#include "propertywnd.h"
 
 class Pump;
 
-class PumpPtyWnd : public ItemPtyWnd {
+class PumpPtyWnd : public PropertyWnd{
        public: 
                PumpPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
                virtual ~PumpPtyWnd();
                Pump *pump;
-               Gtk::Label *lbl_property;
+               Gtk::SpinButton *spin_fluid;
+               Gtk::Entry *txt_pump_name;
+               Gtk::Button *btn_select_color, *dlg_select_color_cancel, *dlg_select_color_ok;
+               Gtk::ColorSelectionDialog *color_select_dlg;
                virtual void on_btn_accept_clicked();
                virtual void on_btn_apply_clicked();
+               virtual void on_btn_select_color_clicked();
+               virtual void on_dlg_select_color_cancel_clicked();
+               virtual void on_dlg_select_color_ok_clicked();  
 };
 
 #endif