]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
-ahi borre lo que se me escapo
authorNicolás Dimov <ndimov@gmail.com>
Thu, 13 Nov 2003 20:03:12 +0000 (20:03 +0000)
committerNicolás Dimov <ndimov@gmail.com>
Thu, 13 Nov 2003 20:03:12 +0000 (20:03 +0000)
Constructor/and.o [deleted file]
Constructor/constructor.glade
Constructor/item.cpp
Constructor/item.h
Constructor/itemptywnd.cpp
Constructor/itemptywnd.h
Constructor/not.o [deleted file]
Constructor/or.o [deleted file]
Constructor/union.cpp

diff --git a/Constructor/and.o b/Constructor/and.o
deleted file mode 100644 (file)
index bdfe85c..0000000
Binary files a/Constructor/and.o and /dev/null differ
index 4d57058d228435ff91e3319a042ae17a61017ccd..81fb82d6b403b0c9ba4dfdfc46935d8edf4d45fa 100644 (file)
 </widget>
 
 <widget class="GtkDialog" id="item_pty_wnd">
-  <property name="width_request">287</property>
-  <property name="height_request">103</property>
+  <property name="width_request">269</property>
+  <property name="height_request">131</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>
        <widget class="GtkTable" id="table1">
          <property name="visible">True</property>
-         <property name="n_rows">2</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="y_options"></property>
            </packing>
          </child>
+
+         <child>
+           <widget class="GtkLabel" id="lb_type">
+             <property name="label" translatable="yes">Tipo de Conexión</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">2</property>
+             <property name="bottom_attach">3</property>
+             <property name="x_options"></property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkHBox" id="hbox9">
+             <property name="visible">True</property>
+             <property name="homogeneous">False</property>
+             <property name="spacing">0</property>
+
+             <child>
+               <widget class="GtkRadioButton" id="rd_btn_union">
+                 <property name="can_focus">True</property>
+                 <property name="label" translatable="yes">Unión</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_division">
+                 <property name="can_focus">True</property>
+                 <property name="label" translatable="yes">División</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_union</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">2</property>
+             <property name="bottom_attach">3</property>
+             <property name="x_options">fill</property>
+             <property name="y_options">fill</property>
+           </packing>
+         </child>
        </widget>
        <packing>
          <property name="padding">10</property>
index 5eb572146cd34ccc52e0b0e7e9ee3eb365810d43..c08f894c7d1d6d354f50d623d3d54d288863854e 100644 (file)
@@ -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);
index 5b8b5836436cad54784d6da9d2095d7c29e4bcc1..cf9b714436478a46d6b8d92711b00abed1e99132 100644 (file)
@@ -46,6 +46,7 @@ public:
        WorkPlace *workplace;
        Gtk::Entry *combo_entry;
        std::list<CItem *> *listaItems;
+       bool is_union;
 protected:
        int imgActual;
        int ID, conector_in, conector_out; 
index be27282c8bccf5d18486918b599f67d09963bc38..44d7392aa06d107cdd4f557203d423fffa790f7e 100644 (file)
@@ -5,6 +5,12 @@ ItemPtyWnd::ItemPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade:
 {
        refGlade->get_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;
+}
index d6fd3262182efbc2de0a63736354c58bdbffe260..6f82c2226ab445a3d76e731e1b229b142f22f359 100644 (file)
@@ -8,11 +8,15 @@ class ItemPtyWnd : public PropertyWnd {
                ItemPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& 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 (file)
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 (file)
index 6ff0b0c..0000000
Binary files a/Constructor/or.o and /dev/null differ
index f5b6d98e94ac4914f16ec048ae2f081e3e4806d8..d0955bbd2e31c565b06e73b216a46fe99768e923 100644 (file)
@@ -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\t<tipo>union</tipo>\n";
+       else c_type = "\t\t<tipo>division</tipo>\n";
        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_caudal,"\t\t<caudal>%.2f</caudal>\n", caudal_max);
        sprintf(c_img,"\t\t<orientacion>%d</orientacion>\n",imgActual);
        Glib::ustring dato;
-       dato = "\t<union nombre=\""+name+"\" id=\"";
+       dato = "\t<empalme nombre=\""+name+"\" id=\"";
        dato += c_id;
        dato += "\">\n";
+       dato += c_type;
        dato += c_caudal;
        dato += c_img;
        dato += c_x; 
        dato += c_y;
-       dato += "\t</union>\n";
+       dato += "\t</empalme>\n";
        fprintf(archivo,dato.c_str());  
 }