From: Nicolás Dimov Date: Thu, 27 Nov 2003 16:17:19 +0000 (+0000) Subject: agrego una barrita de estado para ver los datos con mas comodidad, se pueden hacer... X-Git-Tag: svn_import~169 X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/commitdiff_plain/663eccb7e27110aba6c79648c38254a7a5737bca agrego una barrita de estado para ver los datos con mas comodidad, se pueden hacer mas cosas con eso pero no se me ocurren --- diff --git a/Constructor/dialogs/constructor.glade b/Constructor/dialogs/constructor.glade index 43279fa..86e551b 100644 --- a/Constructor/dialogs/constructor.glade +++ b/Constructor/dialogs/constructor.glade @@ -4,8 +4,8 @@ - 738 - 689 + 799 + 742 True Constuctor GTK_WINDOW_TOPLEVEL @@ -731,7 +731,7 @@ - + True True diff --git a/Constructor/include/constructor.h b/Constructor/include/constructor.h index a9c1cbf..702e796 100644 --- a/Constructor/include/constructor.h +++ b/Constructor/include/constructor.h @@ -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 ico_canio, ico_y, ico_codo, ico_tanque, ico_bomba, ico_exclusa, ico_drain, ico_and, ico_or, ico_not; Glib::RefPtr ico_last; std::list listTargets; diff --git a/Constructor/include/item.h b/Constructor/include/item.h index bae7d22..845bd64 100644 --- a/Constructor/include/item.h +++ b/Constructor/include/item.h @@ -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 *listaItems; diff --git a/Constructor/src/and.cpp b/Constructor/src/and.cpp index ccaf897..327e7c2 100644 --- a/Constructor/src/and.cpp +++ b/Constructor/src/and.cpp @@ -148,7 +148,7 @@ bool And::check_connection() } i++; } - return true; + return true; //out_connected; } ConnectorType And::detect_click_position(int _a, int _b) diff --git a/Constructor/src/cistern.cpp b/Constructor/src/cistern.cpp index aebd35d..e7e104d 100644 --- a/Constructor/src/cistern.cpp +++ b/Constructor/src/cistern.cpp @@ -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)){ diff --git a/Constructor/src/conduct.cpp b/Constructor/src/conduct.cpp index 769e943..f58d6c0 100644 --- a/Constructor/src/conduct.cpp +++ b/Constructor/src/conduct.cpp @@ -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)){ diff --git a/Constructor/src/constructor.cpp b/Constructor/src/constructor.cpp index e6f413e..a7e44aa 100644 --- a/Constructor/src/constructor.cpp +++ b/Constructor/src/constructor.cpp @@ -46,6 +46,7 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtrget_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::RefPtrlist_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 diff --git a/Constructor/src/exclusa.cpp b/Constructor/src/exclusa.cpp index 71475d6..a7c4583 100644 --- a/Constructor/src/exclusa.cpp +++ b/Constructor/src/exclusa.cpp @@ -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)){ diff --git a/Constructor/src/not.cpp b/Constructor/src/not.cpp index 562ee4d..0d7e409 100644 --- a/Constructor/src/not.cpp +++ b/Constructor/src/not.cpp @@ -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) diff --git a/Constructor/src/or.cpp b/Constructor/src/or.cpp index 5c63e70..4fdf2f2 100644 --- a/Constructor/src/or.cpp +++ b/Constructor/src/or.cpp @@ -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) diff --git a/Constructor/src/pump.cpp b/Constructor/src/pump.cpp index 46bac68..897ca50 100644 --- a/Constructor/src/pump.cpp +++ b/Constructor/src/pump.cpp @@ -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)){ diff --git a/Constructor/src/splitter.cpp b/Constructor/src/splitter.cpp index ea7f2d4..0169d19 100644 --- a/Constructor/src/splitter.cpp +++ b/Constructor/src/splitter.cpp @@ -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)){ diff --git a/Constructor/src/union.cpp b/Constructor/src/union.cpp index dfbaa88..ca61727 100644 --- a/Constructor/src/union.cpp +++ b/Constructor/src/union.cpp @@ -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 )){