From: Nicolás Dimov Date: Thu, 13 Nov 2003 20:03:12 +0000 (+0000) Subject: -ahi borre lo que se me escapo X-Git-Tag: svn_import~298 X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/commitdiff_plain/3a8788fb198a1e0590823745f39fbff81056db09?ds=sidebyside;hp=29e4030c485d49ae79d491e7d0297899b9df6f73 -ahi borre lo que se me escapo --- diff --git a/Constructor/and.o b/Constructor/and.o deleted file mode 100644 index bdfe85c..0000000 Binary files a/Constructor/and.o and /dev/null differ diff --git a/Constructor/constructor.glade b/Constructor/constructor.glade index 4d57058..81fb82d 100644 --- a/Constructor/constructor.glade +++ b/Constructor/constructor.glade @@ -896,8 +896,8 @@ - 287 - 103 + 269 + 131 Propiedades del GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER @@ -964,7 +964,7 @@ True - 2 + 3 2 True 0 @@ -1059,6 +1059,80 @@ + + + + Tipo de Conexión + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 1 + 2 + 3 + + + + + + + + True + False + 0 + + + + True + Unión + True + GTK_RELIEF_NORMAL + False + False + True + + + 0 + False + False + + + + + + True + División + True + GTK_RELIEF_NORMAL + False + False + True + rd_btn_union + + + 0 + False + False + + + + + 1 + 2 + 2 + 3 + fill + fill + + 10 diff --git a/Constructor/item.cpp b/Constructor/item.cpp index 5eb5721..c08f894 100644 --- a/Constructor/item.cpp +++ b/Constructor/item.cpp @@ -13,6 +13,7 @@ CItem::CItem() ref = Gnome::Glade::Xml::create("constructor.glade", "item_pty_wnd"); ref->get_widget_derived("item_pty_wnd",property_wnd); caudal_max = 0.0; + is_union = true; property_wnd->item = this; menu_image_propiedades.set(Gtk::Stock::PREFERENCES, Gtk::ICON_SIZE_MENU); menu_image_delete.set(Gtk::Stock::CANCEL, Gtk::ICON_SIZE_MENU); diff --git a/Constructor/item.h b/Constructor/item.h index 5b8b583..cf9b714 100644 --- a/Constructor/item.h +++ b/Constructor/item.h @@ -46,6 +46,7 @@ public: WorkPlace *workplace; Gtk::Entry *combo_entry; std::list *listaItems; + bool is_union; protected: int imgActual; int ID, conector_in, conector_out; diff --git a/Constructor/itemptywnd.cpp b/Constructor/itemptywnd.cpp index be27282..44d7392 100644 --- a/Constructor/itemptywnd.cpp +++ b/Constructor/itemptywnd.cpp @@ -5,6 +5,12 @@ ItemPtyWnd::ItemPtyWnd(BaseObjectType* cobject, const Glib::RefPtrget_widget("spin_caudal", spin_caudal); refGlade->get_widget("txt_item_name",txt_item_name); + refGlade->get_widget("rd_btn_division", rd_btn_division); + refGlade->get_widget("rd_btn_union", rd_btn_union); + refGlade->get_widget("lb_type", lb_type); + + rd_btn_division->signal_clicked().connect(SigC::slot(*this,&ItemPtyWnd::on_rd_btn_division_clicked)); + rd_btn_union->signal_clicked().connect(SigC::slot(*this,&ItemPtyWnd::on_rd_btn_union_clicked)); } ItemPtyWnd::~ItemPtyWnd() @@ -28,3 +34,13 @@ void ItemPtyWnd::on_btn_cancel_clicked() { hide(); } + +void ItemPtyWnd::on_rd_btn_union_clicked() +{ + item->is_union = true; +} + +void ItemPtyWnd::on_rd_btn_division_clicked() +{ + item->is_union = false; +} diff --git a/Constructor/itemptywnd.h b/Constructor/itemptywnd.h index d6fd326..6f82c22 100644 --- a/Constructor/itemptywnd.h +++ b/Constructor/itemptywnd.h @@ -8,11 +8,15 @@ class ItemPtyWnd : public PropertyWnd { ItemPtyWnd(BaseObjectType* cobject, const Glib::RefPtr& refGlade); virtual ~ItemPtyWnd(); Gtk::SpinButton *spin_caudal; + Gtk::RadioButton *rd_btn_union, *rd_btn_division; + Gtk::Label *lb_type; Gtk::Entry *txt_item_name; protected: virtual void on_btn_cancel_clicked(); virtual void on_btn_accept_clicked(); virtual void on_btn_apply_clicked(); + virtual void on_rd_btn_union_clicked(); + virtual void on_rd_btn_division_clicked(); }; diff --git a/Constructor/not.o b/Constructor/not.o deleted file mode 100644 index 4491cbc..0000000 Binary files a/Constructor/not.o and /dev/null differ diff --git a/Constructor/or.o b/Constructor/or.o deleted file mode 100644 index 6ff0b0c..0000000 Binary files a/Constructor/or.o and /dev/null differ diff --git a/Constructor/union.cpp b/Constructor/union.cpp index f5b6d98..d0955bb 100644 --- a/Constructor/union.cpp +++ b/Constructor/union.cpp @@ -11,6 +11,9 @@ Union::Union() image = imageN; set_size_request(image->get_width(), image->get_height()); property_wnd->set_title("Propiedades del Empalme"); + property_wnd->rd_btn_division->property_visible() = true; + property_wnd->rd_btn_union->property_visible() = true; + property_wnd->lb_type->property_visible() = true; name = "union"; } @@ -52,6 +55,7 @@ bool Union::on_button_press_event(GdkEventButton *event) if ((event->type == GDK_2BUTTON_PRESS) && ( event->button == 1)){ property_wnd->spin_caudal->set_value( caudal_max ); property_wnd->txt_item_name->set_text( name ); + if (is_union) property_wnd->rd_btn_union->set_active(true); property_wnd->show(); } return true; @@ -76,20 +80,24 @@ void Union::on_menu_popup_propiedades() void Union::save(FILE *archivo) { char c_id[50], c_caudal[50], c_x[50], c_y[50], c_img[50]; + Glib::ustring c_type; + if ( is_union ) c_type = "\t\tunion\n"; + else c_type = "\t\tdivision\n"; sprintf(c_x,"\t\t%d\n",x); sprintf(c_y,"\t\t%d\n",y); sprintf(c_id,"%d",ID); sprintf(c_caudal,"\t\t%.2f\n", caudal_max); sprintf(c_img,"\t\t%d\n",imgActual); Glib::ustring dato; - dato = "\t\n"; + dato += c_type; dato += c_caudal; dato += c_img; dato += c_x; dato += c_y; - dato += "\t\n"; + dato += "\t\n"; fprintf(archivo,dato.c_str()); }