]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
agrege todos los items con sus respectivas ventanas pero falta arreglar el tema del...
authorNicolás Dimov <ndimov@gmail.com>
Tue, 11 Nov 2003 20:37:30 +0000 (20:37 +0000)
committerNicolás Dimov <ndimov@gmail.com>
Tue, 11 Nov 2003 20:37:30 +0000 (20:37 +0000)
23 files changed:
Constructor/bomba_null.png [new file with mode: 0644]
Constructor/cistern.cpp
Constructor/conduct.cpp
Constructor/constructor.cpp
Constructor/constructor.glade
Constructor/constructor.h
Constructor/exclusa.cpp [new file with mode: 0644]
Constructor/exclusa.h [new file with mode: 0644]
Constructor/exclusaptywnd.cpp [new file with mode: 0644]
Constructor/exclusaptywnd.h [new file with mode: 0644]
Constructor/ico_bomba.png [new file with mode: 0644]
Constructor/ico_canio.png
Constructor/ico_codo.png
Constructor/ico_exclusa.png [new file with mode: 0644]
Constructor/ico_tanque.png
Constructor/ico_y.png
Constructor/propertywnd.h
Constructor/pump.cpp [new file with mode: 0644]
Constructor/pump.h [new file with mode: 0644]
Constructor/pumpptywnd.cpp [new file with mode: 0644]
Constructor/pumpptywnd.h [new file with mode: 0644]
Constructor/splitter.cpp
Constructor/union.cpp

diff --git a/Constructor/bomba_null.png b/Constructor/bomba_null.png
new file mode 100644 (file)
index 0000000..39e5761
Binary files /dev/null and b/Constructor/bomba_null.png differ
index fe0e5dd1a5ccb42ebaaa79b5f7df5679f49fc83d..71d8cceb92fac1d70a6d1641fadb31019e0b4f19 100644 (file)
@@ -14,6 +14,7 @@ Cistern::Cistern()
        ref->get_widget_derived("cistern_pty_wnd",cistern_pty_wnd);
        cistern_pty_wnd->cistern = this;
        cistern_pty_wnd->set_title("Propiedades del Tanque");   
        ref->get_widget_derived("cistern_pty_wnd",cistern_pty_wnd);
        cistern_pty_wnd->cistern = this;
        cistern_pty_wnd->set_title("Propiedades del Tanque");   
+       name = "tanque";
 }
 
 Cistern::~Cistern()
 }
 
 Cistern::~Cistern()
@@ -117,11 +118,13 @@ bool Cistern::check_connection()
 {
        switch (get_img_actual()) {
                case 0:
 {
        switch (get_img_actual()) {
                case 0:
-                       if ( is_other_occupied_area( get_position_x()+get_image()->get_width()+10 , get_position_y()+get_image()->get_height() -10) )
+                       if ( is_other_occupied_area( get_position_x()+get_image()->get_width()+10 , get_position_y()+get_image()->get_height() -10) &&
+                                is_other_occupied_area( get_position_x() + 10, get_position_y() - 10) ) 
                                return true;                            
                        break;
                case 1:
                                return true;                            
                        break;
                case 1:
-                       if ( is_other_occupied_area( get_position_x() -10, get_position_y()+get_image()->get_height()-10) )
+                       if ( is_other_occupied_area( get_position_x() -10, get_position_y()+get_image()->get_height()-10) &&
+                                is_other_occupied_area( get_position_x()+get_image()->get_width() - 10, get_position_y() - 10) )
                                return true;
        }
        return false;
                                return true;
        }
        return false;
index 2a582fb9f82fc8c432276bbc97063a4aa284c74c..e02cae00284e0a096ef27d9fdee2294ac16daf8e 100644 (file)
@@ -9,6 +9,7 @@ Conduct::Conduct()
        image = imageN;
        set_size_request(image->get_width(), image->get_height());
        property_wnd->set_title("Propiedades del Tubo");
        image = imageN;
        set_size_request(image->get_width(), image->get_height());
        property_wnd->set_title("Propiedades del Tubo");
+       name="tubo";
 }
 
 Conduct::~Conduct()
 }
 
 Conduct::~Conduct()
index aa27c5361b28980dbb5af3de4b721c9b4cdd74aa..81a9c37c25590078ba96ca0b4df6da436cc0a5d3 100644 (file)
@@ -10,11 +10,15 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
        ico_y     = Gdk::Pixbuf::create_from_file("y_n.png");
        ico_codo  = Gdk::Pixbuf::create_from_file("codo_o.png");
        ico_tanque  = Gdk::Pixbuf::create_from_file("tanque_e.png");
        ico_y     = Gdk::Pixbuf::create_from_file("y_n.png");
        ico_codo  = Gdk::Pixbuf::create_from_file("codo_o.png");
        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");
        
        refGlade->get_widget("btn_canio", btn_canio);
        refGlade->get_widget("btn_codo", btn_codo);
        refGlade->get_widget("btn_y", btn_y);
        refGlade->get_widget("btn_tanque",btn_tanque);
        
        refGlade->get_widget("btn_canio", btn_canio);
        refGlade->get_widget("btn_codo", btn_codo);
        refGlade->get_widget("btn_y", btn_y);
        refGlade->get_widget("btn_tanque",btn_tanque);
+       refGlade->get_widget("btn_bomba", btn_bomba);
+       refGlade->get_widget("btn_exclusa", btn_exclusa);
        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);
        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);
@@ -38,8 +42,12 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
        btn_y->drag_source_set(listTargets);
        btn_codo->drag_source_set(listTargets);
        btn_tanque->drag_source_set(listTargets);
        btn_y->drag_source_set(listTargets);
        btn_codo->drag_source_set(listTargets);
        btn_tanque->drag_source_set(listTargets);
+       btn_bomba->drag_source_set(listTargets);
+       btn_exclusa->drag_source_set(listTargets);
        
        btn_canio->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_canio_drag_get));
        
        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));
+       btn_exclusa->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_exclusa_drag_get));
        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_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));
@@ -61,6 +69,8 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
        btn_y->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_y_drag_begin));
        btn_codo->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_codo_drag_begin));
        btn_tanque->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_tanque_drag_begin));
        btn_y->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_y_drag_begin));
        btn_codo->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_codo_drag_begin));
        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));
 
        workplace->drag_dest_set(listTargets);
        workplace->signal_drag_data_received().connect( SigC::slot(*this, &Constructor::on_item_drop_drag_received) );  
 
        workplace->drag_dest_set(listTargets);
        workplace->signal_drag_data_received().connect( SigC::slot(*this, &Constructor::on_item_drop_drag_received) );  
@@ -83,22 +93,32 @@ Constructor::~Constructor()
 
 void Constructor::on_btn_canio_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time)
 {
 
 void Constructor::on_btn_canio_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*)"item_canio.png", 14);
+       gtk_selection_data_set (selection_data, selection_data->target, 8, (const guchar*)"canio_n.png", 14);
 }
 
 void Constructor::on_btn_y_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time)
 {
 }
 
 void Constructor::on_btn_y_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*)"item_y.png",10);
+       gtk_selection_data_set(selection_data, selection_data->target, 8,(const guchar*)"y_n.png",10);
 }
 
 void Constructor::on_btn_codo_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time)
 {
 }
 
 void Constructor::on_btn_codo_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*)"item_codo.png",13);
+       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)
 {
 }
 
 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*)"item_tanque.png",15);
+       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_main_menu_quit()
 }
 
 void Constructor::on_main_menu_quit()
@@ -171,6 +191,16 @@ void Constructor::on_tanque_drag_begin(const Glib::RefPtr<Gdk::DragContext>& con
        context->set_icon(ico_tanque, 5, 5); 
 }
 
        context->set_icon(ico_tanque, 5, 5); 
 }
 
+void Constructor::on_bomba_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context)
+{
+       context->set_icon(ico_bomba, 5, 5); 
+}
+
+void Constructor::on_exclusa_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context)
+{
+       context->set_icon(ico_exclusa, 5, 5); 
+}
+
 void Constructor::on_item_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context, CItem *item)
 {
        context->set_icon(item->get_image(), 5, 5);
 void Constructor::on_item_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context, CItem *item)
 {
        context->set_icon(item->get_image(), 5, 5);
@@ -219,22 +249,24 @@ void Constructor::on_item_drop_drag_received(const Glib::RefPtr<Gdk::DragContext
                // El Drag es desde la barra de tareas
                if ((selection_data->length >= 0) && (selection_data->format == 8))     {
                        CItem *a;
                // El Drag es desde la barra de tareas
                if ((selection_data->length >= 0) && (selection_data->format == 8))     {
                        CItem *a;
-                       if (strcmp((const char *)selection_data->data, "item_codo.png")==0) 
+                       if (strcmp((const char *)selection_data->data, "codo_o.png")==0) 
                                a = new Splitter();
                                a = new Splitter();
-                                       else    if (strcmp((const char *)selection_data->data, "item_canio.png")==0) 
+                                       else    if (strcmp((const char *)selection_data->data, "canio_n.png")==0) 
                                                a = new Conduct();
                                                a = new Conduct();
-                                                       else if (strcmp((const char *)selection_data->data, "item_y.png")==0) 
+                                                       else if (strcmp((const char *)selection_data->data, "y_n.png")==0) 
                                                                a = new Union();
                                                                a = new Union();
-                                                                       else if (strcmp((const char *)selection_data->data, "item_tanque.png")==0) 
+                                                                       else if (strcmp((const char *)selection_data->data, "tanque_e.png")==0) 
                                                                                a = new Cistern();
                                                                                a = new Cistern();
-
-                       //Seteo el ID del item
-                       Glib::ustring name("item");
-                       // FIXME
+                                                                                       else if (strcmp((const char *)selection_data->data, "bomba_e.png")==0) 
+                                                                                               a =new Pump();
+                                                                                                       else if (strcmp((const char *)selection_data->data, "exclusa_h.png")==0) 
+                                                                                                               a = new Exclusa();
+                                                                                                                       
+               
                        char char_id[10];
                        sprintf(char_id," %d",id);
                        a->set_id(++id);                
                        char char_id[10];
                        sprintf(char_id," %d",id);
                        a->set_id(++id);                
-                       a->set_name( name+char_id );
+                       a->set_name( a->get_name()+char_id );
                        if ( can_drop(a, i*32, j*32) ) {
                                workplace->put(*a, i*32, j*32);
                                //Apunto al workplace
                        if ( can_drop(a, i*32, j*32) ) {
                                workplace->put(*a, i*32, j*32);
                                //Apunto al workplace
@@ -249,7 +281,6 @@ void Constructor::on_item_drop_drag_received(const Glib::RefPtr<Gdk::DragContext
                                a->drag_source_set(listTargets);
                                // Conecto las señales
                                a->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_item_drag_data_get));
                                a->drag_source_set(listTargets);
                                // Conecto las señales
                                a->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_item_drag_data_get));
-
                                // Utilizo el SigC::bind para que el callback on_drag_begin acepte un
                                // parametro extra, en este caso un CItem *. Esto se hace para
                                // que cuando el usuario quiera mover un item, saber que item es
                                // Utilizo el SigC::bind para que el callback on_drag_begin acepte un
                                // parametro extra, en este caso un CItem *. Esto se hace para
                                // que cuando el usuario quiera mover un item, saber que item es
index ffbab647f9adcecbc413f8d81b15023a10b8401e..28c0ac4b9da1bf02a8cda43790bedbdb57c33694 100644 (file)
@@ -5,7 +5,7 @@
 
 <widget class="GtkWindow" id="wnd_constructor">
   <property name="width_request">640</property>
 
 <widget class="GtkWindow" id="wnd_constructor">
   <property name="width_request">640</property>
-  <property name="height_request">480</property>
+  <property name="height_request">573</property>
   <property name="visible">True</property>
   <property name="title" translatable="yes">window1</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
   <property name="visible">True</property>
   <property name="title" translatable="yes">window1</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
                          </child>
                        </widget>
                      </child>
                          </child>
                        </widget>
                      </child>
+
+                     <child>
+                       <widget class="GtkButton" id="btn_bomba">
+                         <property name="visible">True</property>
+                         <property name="can_default">True</property>
+                         <property name="can_focus">True</property>
+                         <property name="relief">GTK_RELIEF_NORMAL</property>
+
+                         <child>
+                           <widget class="GtkAlignment" id="alignment3">
+                             <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="hbox3">
+                                 <property name="visible">True</property>
+                                 <property name="homogeneous">False</property>
+                                 <property name="spacing">2</property>
+
+                                 <child>
+                                   <widget class="GtkImage" id="image12">
+                                     <property name="visible">True</property>
+                                     <property name="pixbuf">ico_bomba.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="btn_exclusa">
+                         <property name="visible">True</property>
+                         <property name="can_default">True</property>
+                         <property name="can_focus">True</property>
+                         <property name="relief">GTK_RELIEF_NORMAL</property>
+
+                         <child>
+                           <widget class="GtkAlignment" id="alignment4">
+                             <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="hbox4">
+                                 <property name="visible">True</property>
+                                 <property name="homogeneous">False</property>
+                                 <property name="spacing">2</property>
+
+                                 <child>
+                                   <widget class="GtkImage" id="image13">
+                                     <property name="visible">True</property>
+                                     <property name="pixbuf">ico_exclusa.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>
                    <packing>
                      <property name="padding">0</property>
                    </widget>
                    <packing>
                      <property name="padding">0</property>
          </child>
 
          <child>
          </child>
 
          <child>
-           <widget class="GtkLabel" id="label11">
+           <widget class="GtkLabel" id="lbl_property">
              <property name="visible">True</property>
              <property name="label" translatable="yes">Flujo Máximo</property>
              <property name="use_underline">False</property>
              <property name="visible">True</property>
              <property name="label" translatable="yes">Flujo Máximo</property>
              <property name="use_underline">False</property>
   </child>
 </widget>
 
   </child>
 </widget>
 
+<widget class="GtkDialog" id="exclusa_pty_wnd">
+  <property name="width_request">273</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="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="vbox3">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+       <widget class="GtkHButtonBox" id="hbuttonbox1">
+         <property name="visible">True</property>
+         <property name="layout_style">GTK_BUTTONBOX_SPREAD</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="table3">
+         <property name="visible">True</property>
+         <property name="n_rows">2</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="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">
+             <property name="visible">True</property>
+             <property name="homogeneous">False</property>
+             <property name="spacing">0</property>
+
+             <child>
+               <widget class="GtkRadioButton" id="rd_btn_open">
+                 <property name="visible">True</property>
+                 <property name="can_focus">True</property>
+                 <property name="label" translatable="yes">Abierto</property>
+                 <property name="use_underline">True</property>
+                 <property name="relief">GTK_RELIEF_NORMAL</property>
+                 <property name="active">False</property>
+                 <property name="inconsistent">False</property>
+                 <property name="draw_indicator">True</property>
+               </widget>
+               <packing>
+                 <property name="padding">0</property>
+                 <property name="expand">False</property>
+                 <property name="fill">False</property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkRadioButton" id="rd_btn_close">
+                 <property name="visible">True</property>
+                 <property name="can_focus">True</property>
+                 <property name="label" translatable="yes">Cerrado</property>
+                 <property name="use_underline">True</property>
+                 <property name="relief">GTK_RELIEF_NORMAL</property>
+                 <property name="active">False</property>
+                 <property name="inconsistent">False</property>
+                 <property name="draw_indicator">True</property>
+                 <property name="group">rd_btn_open</property>
+               </widget>
+               <packing>
+                 <property name="padding">0</property>
+                 <property name="expand">False</property>
+                 <property name="fill">False</property>
+               </packing>
+             </child>
+           </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">fill</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkEntry" id="txt_exclusa_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">0</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>
 </glade-interface>
index 55d3149b4be0c492d65c580020bf777d3daafbbd..12e171217f435bd798da545356111e99d360ac68 100644 (file)
@@ -19,6 +19,8 @@
 #include "conduct.h"
 #include "union.h"
 #include "cistern.h"
 #include "conduct.h"
 #include "union.h"
 #include "cistern.h"
+#include "exclusa.h"
+#include "pump.h"
 
 class Constructor : public Gtk::Window {
        public: 
 
 class Constructor : public Gtk::Window {
        public: 
@@ -29,14 +31,14 @@ class Constructor : public Gtk::Window {
        protected: 
        int id;
                // / defino los elementos de la ventana.
        protected: 
        int id;
                // / defino los elementos de la ventana.
-       Gtk::Button *btn_canio, *btn_codo, *btn_y, *btn_tanque, *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;
        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;
        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;
+       Glib::RefPtr<Gdk::Pixbuf> ico_canio, ico_y, ico_codo, ico_tanque, ico_bomba, ico_exclusa;
        Glib::RefPtr<Gdk::Pixbuf> ico_last;
        std::list<Gtk::TargetEntry> listTargets;
        std::list<CItem *> listaItems;
        Glib::RefPtr<Gdk::Pixbuf> ico_last;
        std::list<Gtk::TargetEntry> listTargets;
        std::list<CItem *> listaItems;
@@ -49,6 +51,8 @@ class Constructor : public Gtk::Window {
        virtual void on_btn_y_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
        virtual void on_btn_codo_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
        virtual void on_btn_tanque_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
        virtual void on_btn_y_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
        virtual void on_btn_codo_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
        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_main_menu_quit();
        virtual void on_main_menu_save();
        virtual void on_edit_menu_del();
        virtual void on_main_menu_quit();
        virtual void on_main_menu_save();
        virtual void on_edit_menu_del();
@@ -63,6 +67,8 @@ class Constructor : public Gtk::Window {
        virtual void on_y_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
        virtual void on_codo_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
        virtual void on_tanque_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
        virtual void on_y_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
        virtual void on_codo_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
        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_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);
        
        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/exclusa.cpp b/Constructor/exclusa.cpp
new file mode 100644 (file)
index 0000000..516f689
--- /dev/null
@@ -0,0 +1,121 @@
+#include "exclusa.h"
+#include "exclusaptywnd.h"
+
+Exclusa::Exclusa()
+{
+       imageN = Gdk::Pixbuf::create_from_file("exclusa_h.png");
+       imageS = Gdk::Pixbuf::create_from_file("exclusa_s.png");
+       null = Gdk::Pixbuf::create_from_file("null.png");
+       imgActual = 0;
+       image = imageN;
+       set_size_request(image->get_width(), image->get_height());
+       
+       Glib::RefPtr<Gnome::Glade::Xml> ref = Gnome::Glade::Xml::create("constructor.glade", "exclusa_pty_wnd");
+       ref->get_widget_derived("exclusa_pty_wnd",exclusa_pty_wnd);
+       exclusa_pty_wnd->exclusa = this;
+       name = "exclusa";
+}
+
+Exclusa::~Exclusa()
+{
+}
+
+bool Exclusa::on_button_press_event(GdkEventButton *event)
+{
+       int w, h;
+       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;
+                       default: 
+                               imgActual = 0;
+                               image = imageN;                 
+               }
+               get_size_request(w, h);
+               set_size_request(h, w);         
+               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.
+       }
+       
+       if ((event->type == GDK_2BUTTON_PRESS) && (event->button ==1)){
+               exclusa_pty_wnd->txt_exclusa_name->set_text( name);
+               if (estado) exclusa_pty_wnd->rd_btn_open->set_active(true);
+               exclusa_pty_wnd->show();
+       }
+       return true;
+}
+
+void Exclusa::on_menu_popup_rotar()
+{
+       GdkEventButton event; 
+               event.type = GDK_BUTTON_PRESS;
+               event.button = 2;
+       Exclusa::on_button_press_event(&event);
+}
+
+void Exclusa::on_menu_popup_propiedades()
+{
+       GdkEventButton event;
+       event.type = GDK_2BUTTON_PRESS;
+       event.button = 1;
+       Exclusa::on_button_press_event(&event);
+}
+
+void Exclusa::save(FILE *archivo)
+{
+       char c_id[50], c_est[50], c_x[50], c_y[50], c_img[50];
+       int est;
+       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);
+       if (estado) est = 1;
+       else est = 0;
+       sprintf(c_est,"\t\t<estado>%d</estado>\n", est);
+       sprintf(c_img,"\t\t<orientacion>%d</orientacion>\n",imgActual);
+       Glib::ustring dato;
+       dato = "\t<exclusa nombre=\""+name+"\" id=\"";
+       dato += c_id;
+       dato += "\">\n";
+       dato += c_img;
+       dato += c_est;
+       dato += c_x; 
+       dato += c_y;
+       dato += "\t</exclusa>\n";
+       fprintf(archivo,dato.c_str());  
+}
+
+bool Exclusa::check_connection()
+{
+       switch (get_img_actual()) {
+                       case 0:
+                               if ( is_other_occupied_area( get_position_x()+get_image()->get_width()/2, get_position_y()+get_image()->get_height()+10) && 
+                                        is_other_occupied_area( get_position_x()+get_image()->get_width()/2, get_position_y() - 10) )
+                                       return true;                            
+                               break;
+                       case 1:
+                               if ( is_other_occupied_area( get_position_x()-10, get_position_y()+get_image()->get_height()/2) && 
+                                        is_other_occupied_area( get_position_x()+get_image()->get_width()+10, get_position_y()+get_image()->get_height()/2) )
+                               return true;
+       }
+       return false;
+}
+
+void Exclusa::set_estado(bool _state)
+{
+       estado = _state;
+}
+
+bool Exclusa::get_estado()
+{
+       return estado;
+}
diff --git a/Constructor/exclusa.h b/Constructor/exclusa.h
new file mode 100644 (file)
index 0000000..31e21a4
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef _EXCLUSA_H_
+#define _EXCLUSA_H_
+
+#include "item.h"
+
+class ExclusaPtyWnd;
+
+class Exclusa : public CItem {
+       public:
+               Exclusa();
+               virtual ~Exclusa();
+               virtual bool on_button_press_event(GdkEventButton *event);
+               virtual void on_menu_popup_rotar();
+               virtual void on_menu_popup_propiedades();
+               virtual void save(FILE *archivo);
+               virtual bool check_connection();
+               void set_estado(bool _state);
+               bool get_estado();
+       private:
+               Glib::RefPtr<Gdk::Pixbuf> imageN; // 0 
+               Glib::RefPtr<Gdk::Pixbuf> imageS; // 1
+               Glib::RefPtr<Gdk::Pixbuf> null; 
+               ExclusaPtyWnd *exclusa_pty_wnd;
+               bool estado;
+};
+#endif
diff --git a/Constructor/exclusaptywnd.cpp b/Constructor/exclusaptywnd.cpp
new file mode 100644 (file)
index 0000000..f1c6025
--- /dev/null
@@ -0,0 +1,38 @@
+#include "exclusaptywnd.h"
+#include "exclusa.h"
+
+ExclusaPtyWnd::ExclusaPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade):PropertyWnd(cobject, refGlade)
+{
+       refGlade->get_widget("rd_btn_close", rd_btn_close);
+       refGlade->get_widget("rd_btn_open", rd_btn_open);
+       rd_btn_close->set_group(group);
+       rd_btn_open->set_group(group);
+       rd_btn_close->signal_clicked().connect(SigC::slot(*this,&ExclusaPtyWnd::on_rd_btn_close_clicked));
+       rd_btn_open->signal_clicked().connect(SigC::slot(*this,&ExclusaPtyWnd::on_rd_btn_open_clicked));
+       refGlade->get_widget("txt_exclusa_name", txt_exclusa_name);
+}
+
+ExclusaPtyWnd::~ExclusaPtyWnd()
+{
+}
+void ExclusaPtyWnd::on_btn_accept_clicked()
+{
+       exclusa->set_name( txt_exclusa_name->get_text() );
+       hide();
+}
+
+void ExclusaPtyWnd::on_btn_apply_clicked()
+{
+       exclusa->set_name( txt_exclusa_name->get_text() );
+}
+
+void ExclusaPtyWnd::on_rd_btn_close_clicked()
+{
+       exclusa->set_estado(false);
+}
+
+void ExclusaPtyWnd::on_rd_btn_open_clicked()
+{
+       exclusa->set_estado(true);
+}
diff --git a/Constructor/exclusaptywnd.h b/Constructor/exclusaptywnd.h
new file mode 100644 (file)
index 0000000..11419ff
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef _EXCLUSAPTYWND_H_
+#define _EXCLUSAPTYWND_H_
+
+#include "propertywnd.h"
+
+class Exclusa;
+
+class ExclusaPtyWnd : public PropertyWnd {
+       public: 
+               ExclusaPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
+               virtual ~ExclusaPtyWnd();
+               Exclusa *exclusa;
+               Gtk::Entry *txt_exclusa_name;
+               Gtk::RadioButton *rd_btn_close, *rd_btn_open;
+               Gtk::RadioButton::Group group;
+               virtual void on_btn_accept_clicked();
+               virtual void on_btn_apply_clicked();
+               virtual void on_rd_btn_close_clicked();
+               virtual void on_rd_btn_open_clicked();
+};
+
+#endif
diff --git a/Constructor/ico_bomba.png b/Constructor/ico_bomba.png
new file mode 100644 (file)
index 0000000..83224ba
Binary files /dev/null and b/Constructor/ico_bomba.png differ
index 8bcc89d3369277c52d50599476e97ec152accf66..ad590a0f07fa8b3d3fb16f55430b51cd28f8db1b 100644 (file)
Binary files a/Constructor/ico_canio.png and b/Constructor/ico_canio.png differ
index 7e40501131e02d743322277f088fc7e2461ac381..cc9962f0d5b5e7f932c2e4fa8d9e21aa56ecd225 100644 (file)
Binary files a/Constructor/ico_codo.png and b/Constructor/ico_codo.png differ
diff --git a/Constructor/ico_exclusa.png b/Constructor/ico_exclusa.png
new file mode 100644 (file)
index 0000000..9ea656a
Binary files /dev/null and b/Constructor/ico_exclusa.png differ
index 17bdf6bd76ec05a7793d0a6b63db76e60d8ccec2..405ed8b509853d32e0c945535e57e8da9a2c85a1 100644 (file)
Binary files a/Constructor/ico_tanque.png and b/Constructor/ico_tanque.png differ
index bcc082cfe64abf8cb71003abe562ea2a0b32ffa9..1b685d585af4d8568fdbcae4d1c7b3ce9d09c80b 100644 (file)
Binary files a/Constructor/ico_y.png and b/Constructor/ico_y.png differ
index fa488af8510448c06060da99b3e9a4ee7b8d3621..3c5062cf5c9b2f7004d6e8d832203178a045e3bc 100644 (file)
@@ -14,7 +14,6 @@ class PropertyWnd : public Gtk::Window{
                PropertyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
                virtual ~PropertyWnd();
                CItem *item;            
                PropertyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
                virtual ~PropertyWnd();
                CItem *item;            
-       protected:
                Gtk::Button *btn_cancel, *btn_accept, *btn_apply;
                virtual void on_btn_cancel_clicked();
                virtual void on_btn_accept_clicked();
                Gtk::Button *btn_cancel, *btn_accept, *btn_apply;
                virtual void on_btn_cancel_clicked();
                virtual void on_btn_accept_clicked();
diff --git a/Constructor/pump.cpp b/Constructor/pump.cpp
new file mode 100644 (file)
index 0000000..51993a2
--- /dev/null
@@ -0,0 +1,116 @@
+#include "pump.h"
+#include "pumpptywnd.h"
+
+Pump::Pump()
+{
+       imageE = Gdk::Pixbuf::create_from_file("bomba_e.png");
+       imageO = Gdk::Pixbuf::create_from_file("bomba_o.png");
+       null = Gdk::Pixbuf::create_from_file("bomba_null.png");
+       imgActual = 0;
+       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);
+       pump_pty_wnd->pump = this;
+       pump_pty_wnd->set_title("Propiedades de la Bomba");     
+       name = "bomba";
+}
+
+Pump::~Pump()
+{
+}
+
+bool Pump::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 = imageO;
+                               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.
+       }
+       
+       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->show();
+       }               
+       return true;
+}
+
+void Pump::on_menu_popup_rotar()
+{
+       GdkEventButton event; 
+               event.type = GDK_BUTTON_PRESS;
+               event.button = 2;
+       Pump::on_button_press_event(&event);
+}
+
+void Pump::on_menu_popup_propiedades()
+{
+       GdkEventButton event; 
+               event.type = GDK_2BUTTON_PRESS;
+               event.button = 1;
+       Pump::on_button_press_event(&event);
+}
+
+void Pump::set_entrega(double _ent)
+{
+       entrega = _ent;
+}
+
+double Pump::get_entrega()
+{
+       return entrega;
+}
+
+void Pump::save(FILE *archivo)
+{
+       char c_id[50], c_entrega[50], c_x[50], c_y[50], c_img[50];
+       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);
+       sprintf(c_entrega,"\t\t<entrega>%.2f</entrega>\n", entrega);
+       sprintf(c_img,"\t\t<orientacion>%d</orientacion>\n",imgActual);
+       Glib::ustring dato;
+       dato = "\t<bomba nombre=\""+name+"\" id=\"";
+       dato += c_id;
+       dato += "\">\n";
+       dato += c_entrega;
+       dato += c_img;
+       dato += c_x; 
+       dato += c_y;
+       dato += "\t</entrega>\n";
+       fprintf(archivo,dato.c_str());  
+}
+
+bool Pump::check_connection()
+{
+       switch (get_img_actual()) {
+               case 0:
+                       if ( is_other_occupied_area( get_position_x()+get_image()->get_width()+10 , get_position_y()+get_image()->get_height() +10) )
+                               return true;                            
+                       break;
+               case 1:
+                       if ( is_other_occupied_area( get_position_x() -10, get_position_y() -10) )
+                               return true;
+       }
+       return false;
+}
diff --git a/Constructor/pump.h b/Constructor/pump.h
new file mode 100644 (file)
index 0000000..6c47b1a
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef _PUMP_H_
+#define _PUMP_H_
+
+#include <iostream>
+#include "item.h"
+
+class PumpPtyWnd;
+       
+class Pump : public CItem {
+       public:
+               Pump();
+               virtual ~Pump();
+               virtual bool on_button_press_event(GdkEventButton *event);
+               virtual void on_menu_popup_rotar();
+               virtual void on_menu_popup_propiedades();
+               void set_entrega(double _cap);
+               double get_entrega();
+               virtual void save(FILE *archivo);
+               virtual bool check_connection();
+       protected:
+               double entrega;
+               Glib::RefPtr<Gdk::Pixbuf> imageE; // 0 
+               Glib::RefPtr<Gdk::Pixbuf> imageO; // 1
+               Glib::RefPtr<Gdk::Pixbuf> null; 
+               PumpPtyWnd *pump_pty_wnd;
+};
+#endif
diff --git a/Constructor/pumpptywnd.cpp b/Constructor/pumpptywnd.cpp
new file mode 100644 (file)
index 0000000..7b150d1
--- /dev/null
@@ -0,0 +1,26 @@
+#include "pumpptywnd.h"
+#include "pump.h"
+
+PumpPtyWnd::PumpPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade):ItemPtyWnd(cobject, refGlade)
+{
+       refGlade->get_widget("lbl_property", lbl_property);
+       refGlade->get_widget("txt_item_name", txt_item_name);
+       lbl_property->set_text("Entrega Maxima");
+}
+
+PumpPtyWnd::~PumpPtyWnd()
+{
+}
+void PumpPtyWnd::on_btn_accept_clicked()
+{
+       pump->set_entrega( spin_caudal->get_value() );
+       pump->set_name( txt_item_name->get_text() );
+       hide();
+}
+
+void PumpPtyWnd::on_btn_apply_clicked()
+{
+       pump->set_entrega( spin_caudal->get_value() );
+       pump->set_name( txt_item_name->get_text() );
+}
diff --git a/Constructor/pumpptywnd.h b/Constructor/pumpptywnd.h
new file mode 100644 (file)
index 0000000..502240b
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef _PUMPPTYWND_H_
+#define _PUMPPTYWND_H_
+
+#include "itemptywnd.h"
+
+class Pump;
+
+class PumpPtyWnd : public ItemPtyWnd {
+       public: 
+               PumpPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
+               virtual ~PumpPtyWnd();
+               Pump *pump;
+               Gtk::Label *lbl_property;
+               virtual void on_btn_accept_clicked();
+               virtual void on_btn_apply_clicked();
+};
+
+#endif
index 5e61abd60397e88b97e506e76c74d995cf3788fd..3e17b496007fdad123f6be4913a093bfc8517137 100644 (file)
@@ -11,6 +11,7 @@ Splitter::Splitter()
        image = imageO;
        set_size_request(image->get_width(), image->get_height());
        property_wnd->set_title("Propiedades del Codo");        
        image = imageO;
        set_size_request(image->get_width(), image->get_height());
        property_wnd->set_title("Propiedades del Codo");        
+       name = "codo";
 }
 
 Splitter::~Splitter()
 }
 
 Splitter::~Splitter()
index 3de8b900fc3eee1d20a5f41059a2e606bd74392c..cb0a6c4aee0ff893460832bd0dff4ef5a939ab00 100644 (file)
@@ -11,6 +11,7 @@ Union::Union()
        image = imageN;
        set_size_request(image->get_width(), image->get_height());
        property_wnd->set_title("Propiedades del Empalme");
        image = imageN;
        set_size_request(image->get_width(), image->get_height());
        property_wnd->set_title("Propiedades del Empalme");
+       name = "union";
 }
 
 Union::~Union()
 }
 
 Union::~Union()