]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
seagregan propiedades al tanque
authorNicolás Dimov <ndimov@gmail.com>
Mon, 1 Dec 2003 13:55:32 +0000 (13:55 +0000)
committerNicolás Dimov <ndimov@gmail.com>
Mon, 1 Dec 2003 13:55:32 +0000 (13:55 +0000)
Constructor/dialogs/constructor.glade
Constructor/include/cistern.h
Constructor/include/cisternptywnd.h
Constructor/src/cistern.cpp
Constructor/src/cisternptywnd.cpp

index fd44f2f2c3694550dd01cd9d02654a19f38c074c..6c2ca14410ec421892dc53b75ca4bcf0a41a9da0 100644 (file)
 
 <widget class="GtkDialog" id="cistern_pty_wnd">
   <property name="width_request">304</property>
-  <property name="height_request">182</property>
+  <property name="height_request">269</property>
   <property name="title" translatable="yes">Propiedades del Tanque</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
   <property name="window_position">GTK_WIN_POS_CENTER</property>
       <child>
        <widget class="GtkTable" id="table2">
          <property name="visible">True</property>
-         <property name="n_rows">4</property>
+         <property name="n_rows">6</property>
          <property name="n_columns">2</property>
          <property name="homogeneous">True</property>
          <property name="row_spacing">0</property>
            </packing>
          </child>
 
-         <child>
-           <widget class="GtkButton" id="btn_select_color">
-             <property name="visible">True</property>
-             <property name="label">gtk-select-color</property>
-             <property name="use_stock">True</property>
-             <property name="relief">GTK_RELIEF_NORMAL</property>
-           </widget>
-           <packing>
-             <property name="left_attach">0</property>
-             <property name="right_attach">1</property>
-             <property name="top_attach">3</property>
-             <property name="bottom_attach">4</property>
-             <property name="x_options"></property>
-             <property name="y_options"></property>
-           </packing>
-         </child>
-
          <child>
            <widget class="GtkLabel" id="label19">
              <property name="visible">True</property>
            </packing>
          </child>
 
+         <child>
+           <widget class="GtkButton" id="btn_select_color">
+             <property name="visible">True</property>
+             <property name="label">gtk-select-color</property>
+             <property name="use_stock">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
+           </widget>
+           <packing>
+             <property name="left_attach">0</property>
+             <property name="right_attach">1</property>
+             <property name="top_attach">5</property>
+             <property name="bottom_attach">6</property>
+             <property name="x_options"></property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
          <child>
            <widget class="GtkDrawingArea" id="color_preview">
              <property name="visible">True</property>
            <packing>
              <property name="left_attach">1</property>
              <property name="right_attach">2</property>
-             <property name="top_attach">3</property>
-             <property name="bottom_attach">4</property>
+             <property name="top_attach">5</property>
+             <property name="bottom_attach">6</property>
              <property name="x_options">fill</property>
              <property name="y_options">fill</property>
            </packing>
          </child>
+
+         <child>
+           <widget class="GtkLabel" id="label29">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">Alarma Superior ( % )</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">3</property>
+             <property name="bottom_attach">4</property>
+             <property name="x_options"></property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkLabel" id="label30">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">Alarma Inferiror ( %) </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">4</property>
+             <property name="bottom_attach">5</property>
+             <property name="x_options"></property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkSpinButton" id="spin_flot_sup">
+             <property name="visible">True</property>
+             <property name="can_focus">True</property>
+             <property name="climb_rate">1</property>
+             <property name="digits">0</property>
+             <property name="numeric">False</property>
+             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+             <property name="snap_to_ticks">False</property>
+             <property name="wrap">False</property>
+             <property name="adjustment">100 0 100 1 10 10</property>
+           </widget>
+           <packing>
+             <property name="left_attach">1</property>
+             <property name="right_attach">2</property>
+             <property name="top_attach">3</property>
+             <property name="bottom_attach">4</property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkSpinButton" id="spin_flot_inf">
+             <property name="visible">True</property>
+             <property name="can_focus">True</property>
+             <property name="climb_rate">1</property>
+             <property name="digits">0</property>
+             <property name="numeric">False</property>
+             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+             <property name="snap_to_ticks">False</property>
+             <property name="wrap">False</property>
+             <property name="adjustment">0 0 100 1 10 10</property>
+           </widget>
+           <packing>
+             <property name="left_attach">1</property>
+             <property name="right_attach">2</property>
+             <property name="top_attach">4</property>
+             <property name="bottom_attach">5</property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
        </widget>
        <packing>
          <property name="padding">0</property>
index b2a4baf43ce95c182581428b6b4d99ef2db72914..3dc8d8ca42568ac530011b96553484f285c2cecf 100644 (file)
@@ -25,8 +25,12 @@ class Cistern : public CItem {
                void set_capacidad(double _cap);
                void set_contenido_inicial(double _ini);
                void set_liquid_color(Gdk::Color _color);
+               void set_flotante_sup (double _s);
+               void set_flotante_inf(double _i);
                double get_contenido_inicial();
                double get_capacidad();
+               double get_flotante_sup();
+               double get_flotante_inf();
                Gdk::Color get_liquid_color();
                /**El item se guarda en formato xml en el archivo pasado por parametro
                */
@@ -62,7 +66,7 @@ class Cistern : public CItem {
        protected:
                /**Atributos que definen su comportamiento
                */
-               double capacidad, contenido_inicial;
+               double capacidad, contenido_inicial, flotante_sup, flotante_inf;
                /**Color del liquido almacenado
                */
                Gdk::Color liquid_color;
index b8c91f8bf4aeda262c3472cefe409836f3bb9e6d..e04d7037fa9681cc3184f5c0bf7b4cba9ab95033 100644 (file)
@@ -21,7 +21,7 @@ class CisternPtyWnd : public PropertyWnd {
                Cistern *cistern;
        
                ///Objetos de la ventana.
-               Gtk::SpinButton *spin_inicial, *spin_capacidad;
+               Gtk::SpinButton *spin_inicial, *spin_capacidad, *spin_flot_sup, *spin_flot_inf;
                Gtk::Button  *btn_select_color, *dlg_select_color_ok, *dlg_select_color_cancel;
                Gtk::Entry *txt_cistern_name;
                Gtk::ColorSelectionDialog *color_select_dlg;
index 8ba4e4594a4940a80646281bcb3139a876d828ca..060f52457bb1aff2b4690014326e635f5c068350 100644 (file)
@@ -131,6 +131,8 @@ bool Cistern::on_button_press_event(GdkEventButton *event)
                cistern_pty_wnd->spin_capacidad->set_value( capacidad );
                cistern_pty_wnd->spin_inicial->set_value( contenido_inicial );
                cistern_pty_wnd->txt_cistern_name->set_text( name );
+               cistern_pty_wnd->spin_flot_inf->set_value ( flotante_inf );
+               cistern_pty_wnd->spin_flot_sup->set_value ( flotante_sup );
                cistern_pty_wnd->show();
        }               
        workplace->queue_draw();
@@ -168,6 +170,17 @@ void Cistern::set_contenido_inicial(double _ini)
        contenido_inicial = _ini;
 }
 
+
+void Cistern::set_flotante_sup(double _s)
+{
+       flotante_sup = _s;
+}
+
+void Cistern::set_flotante_inf(double _i)
+{
+       flotante_inf = _i;
+}
+
 double Cistern::get_capacidad()
 {
        return capacidad;
@@ -178,6 +191,16 @@ double Cistern::get_contenido_inicial()
        return contenido_inicial;
 }
 
+double Cistern::get_flotante_sup()
+{
+       return flotante_sup;
+}
+
+double Cistern::get_flotante_inf()
+{
+       return flotante_inf;
+}
+
 Gdk::Color Cistern::get_liquid_color()
 {
        return liquid_color;
index 495b0ef94a94bbaa577e53e6a604726cd340fe0d..d12595cd068e16245dae91f34bb39c1cd4909918 100644 (file)
@@ -8,6 +8,8 @@ CisternPtyWnd::CisternPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::
        refGlade->get_widget("txt_cistern_name", txt_cistern_name);
        refGlade->get_widget("btn_select_color", btn_select_color);             
        refGlade->get_widget("color_preview",color_preview);
+       refGlade->get_widget("spin_flot_inf", spin_flot_inf);
+       refGlade->get_widget("spin_flot_sup", spin_flot_sup);
        
        Glib::RefPtr<Gnome::Glade::Xml> ref = Gnome::Glade::Xml::create(PACKAGE_DATA_DIR"/plaqui-constructor/dialogs/constructor.glade", "color_select_dlg");
        ref->get_widget("color_select_dlg",color_select_dlg);
@@ -44,6 +46,8 @@ void CisternPtyWnd::on_btn_apply_clicked()
        cistern->set_capacidad( spin_capacidad->get_value() );
        cistern->set_contenido_inicial( spin_inicial->get_value() );
        cistern->set_name( txt_cistern_name->get_text() );
+       cistern->set_flotante_inf(spin_flot_inf->get_value() );
+       cistern->set_flotante_sup(spin_flot_sup->get_value() );
        color_select_dlg->get_colorsel()->set_current_color(cistern->get_liquid_color());
        if ( cistern->workplace->chek_name(txt_cistern_name->get_text(), cistern->get_id()) ) 
                dlg_name->show();