]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
agrego una barrita de estado para ver los datos con mas comodidad, se pueden hacer...
authorNicolás Dimov <ndimov@gmail.com>
Thu, 27 Nov 2003 16:17:19 +0000 (16:17 +0000)
committerNicolás Dimov <ndimov@gmail.com>
Thu, 27 Nov 2003 16:17:19 +0000 (16:17 +0000)
13 files changed:
Constructor/dialogs/constructor.glade
Constructor/include/constructor.h
Constructor/include/item.h
Constructor/src/and.cpp
Constructor/src/cistern.cpp
Constructor/src/conduct.cpp
Constructor/src/constructor.cpp
Constructor/src/exclusa.cpp
Constructor/src/not.cpp
Constructor/src/or.cpp
Constructor/src/pump.cpp
Constructor/src/splitter.cpp
Constructor/src/union.cpp

index 43279fa79b7c8772509eff49c3c1958db4f855fc..86e551b0256deca55b057c0d2d55dd82b9ec8ccf 100644 (file)
@@ -4,8 +4,8 @@
 <glade-interface>
 
 <widget class="GtkWindow" id="wnd_constructor">
-  <property name="width_request">738</property>
-  <property name="height_request">689</property>
+  <property name="width_request">799</property>
+  <property name="height_request">742</property>
   <property name="visible">True</property>
   <property name="title" translatable="yes">Constuctor</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
       </child>
 
       <child>
-       <widget class="GtkStatusbar" id="statusbar1">
+       <widget class="GtkStatusbar" id="status_bar">
          <property name="visible">True</property>
          <property name="has_resize_grip">True</property>
        </widget>
index a9c1cbf1571afe48992b475473c6c62a94266168..702e79647158ace61f373fbf1f9d385db5a2862d 100644 (file)
@@ -45,6 +45,7 @@ class Constructor : public Gtk::Window {
        Gtk::Combo *combo_entry;
        Gtk::Dialog *dlg_connect;
        Gtk::Label *dlg_label;
+       Gtk::Statusbar *status_bar;
        Glib::RefPtr<Gdk::Pixbuf> ico_canio, ico_y, ico_codo, ico_tanque, ico_bomba, ico_exclusa, ico_drain, ico_and, ico_or, ico_not;
        Glib::RefPtr<Gdk::Pixbuf> ico_last;
        std::list<Gtk::TargetEntry> listTargets;
index bae7d225077db2fd304cda3abc389a43fbfdcf5a..845bd64e6df0548f107c23b981f99d10e4218edd 100644 (file)
@@ -136,6 +136,9 @@ public:
        ///Puntero al cuadro de texto de la ventana principal
        Gtk::Combo *combo_entry;
        
+       ///Puntero a la barra de estado
+       Gtk::Statusbar *status_bar;
+       
        ///Puntero a la lista de items
        std::list<CItem *> *listaItems;
        
index ccaf8973c3bb0a99d9f26a83b7e6391d7cf81e61..327e7c28e8d2d01ebb6701e197b640d094b92a60 100644 (file)
@@ -148,7 +148,7 @@ bool And::check_connection()
                }
                i++;
        }
-       return true;
+       return true; //out_connected;
 }
 
 ConnectorType And::detect_click_position(int _a, int _b)
index aebd35d5796fa4c2b0b08924de333885ccf6f1b1..e7e104d139dc32ee72ac4f8344747dad2b8d9c0a 100644 (file)
@@ -7,7 +7,8 @@ Cistern::Cistern(int orientacion)
        in_y = y+16;
        out_x = x + 48;
        out_y = y + 64;
-       capacidad = 100;
+       capacidad = 100.0;
+       contenido_inicial = 0;
        imageE = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-constructor/pixmaps/tanque_e.png");
        imageO = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-constructor/pixmaps/tanque_o.png");
        null = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-constructor/pixmaps/tanque_null.png");
@@ -66,6 +67,15 @@ bool Cistern::on_button_press_event(GdkEventButton *event)
                        }
                        CItem::gate_id = -1;
                }
+               char f[10], g[10];
+               Glib::ustring text;
+               sprintf(f,"%.1f  ",capacidad);
+               sprintf(g,"%.1f",contenido_inicial);
+               text = name+"  Capacidad: ";
+               text += f;
+               text += "Contenido Inicial: ";
+               text += g;
+               status_bar->push ( text, 0);            
        }
        
        if ((event->type == GDK_BUTTON_PRESS) && ( event->button ==2)){
index 769e94397e855125a6674c955e1ede48fd9b029e..f58d6c032f47a5af33d991b2586f01a56dec6e83 100644 (file)
@@ -37,6 +37,12 @@ bool Conduct::on_button_press_event(GdkEventButton *event)
                WorkPlace::pointed = ID;
                combo_entry->get_entry()->set_text (name);
                workplace->queue_draw();
+               char f[10];
+               Glib::ustring text;
+               sprintf(f,"%.1f",caudal_max);
+               text = name+"  Caudal Maximo: ";
+               text += f;
+               status_bar->push ( text, 0);
        }
        
        if ((event->type == GDK_BUTTON_PRESS) && ( event->button ==2)){
index e6f413e9fcf647ea12c36ce113be02571f7d25b4..a7e44aa6846217a34d88ae2a0fbdc02dd1bf339c 100644 (file)
@@ -46,6 +46,7 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
        refGlade->get_widget("quick_btn_open", quick_btn_open);
        refGlade->get_widget("edit_menu_delete_all", edit_menu_delete_all);
        refGlade->get_widget("btn_find", btn_find);
+       refGlade->get_widget("status_bar", status_bar);
        
        refGlade->get_widget_derived("workplace", workplace);  //fixed
        
@@ -288,6 +289,8 @@ void Constructor::on_load_from_xml()
                                        current->listaItems = &listaItems;
                                        //Apunto a la lista de items logicos
                                        current->lista_logic_Items = &lista_logic_Items;
+                                       //Apunto a la barra de estado
+                                       current->status_bar = status_bar;
                                        // Conecto las señales
                                        current->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_item_drag_data_get));
                                        current->signal_drag_begin().connect(SigC::bind( SigC::slot(*this, &Constructor::on_item_drag_begin), current));
@@ -526,6 +529,8 @@ void Constructor::on_item_drop_drag_received(const Glib::RefPtr<Gdk::DragContext
                                a->list_pointed = &list_pointed;
                                //Apunto a la listaItems.
                                a->listaItems = &listaItems;
+                               //Apunto a la barra de estado
+                               a->status_bar = status_bar;
                                //Apunto a la lista de items logicos
                                a->lista_logic_Items = &lista_logic_Items;
                                //Seteo la posicion del item
index 71475d6f5570741ffaa40ff5bdd522736fbc7ae6..a7c4583c6806b1fb02e8b8ec4cf65dad8c6c8d49 100644 (file)
@@ -60,6 +60,10 @@ bool Exclusa::on_button_press_event(GdkEventButton *event)
                        }
                        CItem::gate_id = -1;
                }
+               Glib::ustring text;
+               if(estado) text = name+"  Estado: ABIERTO";
+               else text = name+"  Estado: CERRADO";
+               status_bar->push ( text, 0);            
        }
        
        if ((event->type == GDK_BUTTON_PRESS) && ( event->button ==2)){
index 562ee4d90fde5ef91b18e4204c3c873761481b29..0d7e409a322b83355afb574e60c58bb92e02e5b1 100644 (file)
@@ -149,9 +149,7 @@ bool Not::check_connection()
                }
                i++;
        }
-
-       //FIXME   la not tiene que tener una sola salida y una sola entrada!!!!!
-       return true;// (cant_in == cant_out );
+       return true;// (in_connected    == out_connected ) ==true;
 }
 
 ConnectorType Not::detect_click_position(int _a, int _b)
index 5c63e70e83dcf0bda62cae601b331c89435f5d14..4fdf2f2ae9636ae09ab0ca269f2c840263b9842e 100644 (file)
@@ -149,8 +149,8 @@ bool Or::check_connection()
                i++;
        }
 
-       //FIXME   la or tiene n entradas y una salida!!!!!!!!!!!!!!!!!!
-       return true;// (cant_in == cant_out );
+       
+       return true;// out_connected;
 }
 
 ConnectorType Or::detect_click_position(int _a, int _b)
index 46bac68ca7f0694d761fc14b8db3f0f8e8f1b377..897ca5039a4aaf99c0c0f4bbf715ceef8f64a256 100644 (file)
@@ -61,6 +61,12 @@ bool Pump::on_button_press_event(GdkEventButton *event)
                        }
                        CItem::gate_id = -1;
                }
+               char f[10];
+               Glib::ustring text;
+               sprintf(f,"%.1f",entrega);
+               text = name+"  Entrega: ";
+               text += f;
+               status_bar->push ( text, 0);
        }
        
        if ((event->type == GDK_BUTTON_PRESS) && ( event->button ==2)){
index ea7f2d41c31896acbc912f531ef330f76c04a3dc..0169d19dca296cf4c595add452ceba0c868afff9 100644 (file)
@@ -45,6 +45,12 @@ bool Splitter::on_button_press_event(GdkEventButton *event)
                combo_entry->get_entry()->set_text (name);
                workplace->queue_draw();
                WorkPlace::pointed = ID;
+               char f[10];
+               Glib::ustring text;
+               sprintf(f,"%.1f",caudal_max);
+               text = name+"  Caudal Maximo: ";
+               text += f;
+               status_bar->push ( text, 0);
        }
        
        if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 2)){
index dfbaa8874c77a9fdab6f43db8782566f1904ac5d..ca617275152a7f438927df79681e851ad5cac7bc 100644 (file)
@@ -50,6 +50,12 @@ bool Union::on_button_press_event(GdkEventButton *event)
                combo_entry->get_entry()->set_text (name);
                workplace->queue_draw();
                WorkPlace::pointed = ID;
+               char f[10];
+               Glib::ustring text;
+               sprintf(f,"%.1f",caudal_max);
+               text = name+"  Caudal Maximo: ";
+               text += f;
+               status_bar->push ( text, 0);
        }
        
        if ((event->type == GDK_BUTTON_PRESS) && (event->button == 2 )){