</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>
{
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()
{
hide();
}
+
+void ItemPtyWnd::on_rd_btn_union_clicked()
+{
+ item->is_union = true;
+}
+
+void ItemPtyWnd::on_rd_btn_division_clicked()
+{
+ item->is_union = false;
+}
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";
}
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;
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());
}