]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
Creo que esto va a ser presentable para maniana. Luca si podes dale esto a Gonzalo...
authorNicolás Dimov <ndimov@gmail.com>
Wed, 29 Oct 2003 16:06:22 +0000 (16:06 +0000)
committerNicolás Dimov <ndimov@gmail.com>
Wed, 29 Oct 2003 16:06:22 +0000 (16:06 +0000)
Constructor/cistern.cpp
Constructor/cistern.h
Constructor/cisternptywnd.cpp [new file with mode: 0644]
Constructor/cisternptywnd.h [new file with mode: 0644]
Constructor/conduct.cpp
Constructor/constructor.glade
Constructor/item.cpp
Constructor/item.h
Constructor/propertywnd.cpp
Constructor/propertywnd.h

index 0cd46d8b13869edbb668e3e552fc6f490c3d5832..1764a406c7e3cc8a9c90d2c097766be980d5b7f9 100644 (file)
@@ -2,6 +2,8 @@
 
 Cistern::Cistern()
 {
+       caudal = 56;
+       fluido_max = 23;
        imageE = Gdk::Pixbuf::create_from_file("tanque_e.png");
        imageO = Gdk::Pixbuf::create_from_file("tanque_o.png");
        null = Gdk::Pixbuf::create_from_file("tanque_null.png");
@@ -16,7 +18,7 @@ Cistern::Cistern()
        catch(const Gnome::Glade::XmlError &ex) {
                std::cerr << ex.what() << std::endl;
        }
-       ref->get_widget_derived("cistern_pty_wnd",property_wnd);
+       ref->get_widget_derived("cistern_pty_wnd",cistern_pty_wnd);
 }
 
 Cistern::~Cistern()
@@ -47,7 +49,7 @@ bool Cistern::on_button_press_event(GdkEventButton *event)
        }
        
        if ((event->type == GDK_2BUTTON_PRESS) && (event->button ==1)){
-               property_wnd->show();
+               cistern_pty_wnd->show();
        }               
        return true;
 }
@@ -62,6 +64,8 @@ void Cistern::on_menu_popup_rotar()
 
 void Cistern::on_menu_popup_propiedades()
 {
+       cistern_pty_wnd->spin_caudal->set_value(caudal);
+       cistern_pty_wnd->spin_fluido_max->set_value(fluido_max);
        GdkEventButton event; 
                event.type = GDK_2BUTTON_PRESS;
                event.button = 1;
index bad3ff1a2fd01d7c37569a73445456315f1f5650..52efbae8a882105847f3016684b5fb7947985d52 100644 (file)
@@ -3,6 +3,7 @@
 #define _CISTERN_H_
 
 #include "item.h"
+#include "cisternptywnd.h"
 
 class Cistern : public CItem {
        public:
@@ -11,11 +12,13 @@ class Cistern : public CItem {
                virtual bool on_button_press_event(GdkEventButton *event);
                virtual void on_menu_popup_rotar();
                virtual void on_menu_popup_propiedades();
-       private:
+       protected:
+               double caudal, fluido_max;
                int imgActual;  
-       
                Glib::RefPtr<Gdk::Pixbuf> imageE; // 0 
                Glib::RefPtr<Gdk::Pixbuf> imageO; // 1
                Glib::RefPtr<Gdk::Pixbuf> null; 
+       
+               CisternPtyWnd *cistern_pty_wnd;
 };
 #endif
diff --git a/Constructor/cisternptywnd.cpp b/Constructor/cisternptywnd.cpp
new file mode 100644 (file)
index 0000000..5ef0ec1
--- /dev/null
@@ -0,0 +1,16 @@
+#include "cisternptywnd.h"
+
+CisternPtyWnd::CisternPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade):PropertyWnd(cobject,refGlade)
+{
+       refGlade->get_widget("spin_caudal", spin_caudal);
+       refGlade->get_widget("spin_fluido_max", spin_fluido_max);
+}
+
+CisternPtyWnd::~CisternPtyWnd()
+{
+}
+
+void CisternPtyWnd::on_btn_accept_clicked()
+{
+       hide();
+}
diff --git a/Constructor/cisternptywnd.h b/Constructor/cisternptywnd.h
new file mode 100644 (file)
index 0000000..e910ac7
--- /dev/null
@@ -0,0 +1,17 @@
+//cisternptywnd.h
+#ifndef _CISTERNPTYWND_H_
+#define _CISTERNPTYWND_H_
+
+#include "propertywnd.h"
+
+class CisternPtyWnd : public PropertyWnd {
+       public:
+               CisternPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
+               virtual ~CisternPtyWnd();
+       //protected:
+               Gtk::SpinButton *spin_caudal, *spin_fluido_max;
+               virtual void on_btn_accept_clicked();
+};
+       
+
+#endif
index d10c0c542d02bfe2b7d0e5f788ef15cd9df8736d..a28aa7923b1303a053f729f00792598218b89852 100644 (file)
@@ -16,7 +16,6 @@ Conduct::Conduct()
        catch(const Gnome::Glade::XmlError &ex) {
                std::cerr << ex.what() << std::endl;
        }
-       //tengo que crear una clase para esta ventana..!!!
        ref->get_widget_derived("conduct_pty_wnd",property_wnd);
 }
 
index 9e96c17444addc094be9690dacc34ced0ba67e90..9703aa672e30707d5afde72491032577ea9f765c 100644 (file)
@@ -583,16 +583,16 @@ Empalme</property>
          <property name="column_spacing">0</property>
 
          <child>
-           <widget class="GtkSpinButton" id="spinbutton7">
+           <widget class="GtkSpinButton" id="spin_caudal">
              <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="digits">1</property>
+             <property name="numeric">True</property>
              <property name="update_policy">GTK_UPDATE_ALWAYS</property>
              <property name="snap_to_ticks">False</property>
              <property name="wrap">False</property>
-             <property name="adjustment">1 0 100 1 10 10</property>
+             <property name="adjustment">0 0 100 0.1 10 10</property>
            </widget>
            <packing>
              <property name="left_attach">1</property>
@@ -604,16 +604,16 @@ Empalme</property>
          </child>
 
          <child>
-           <widget class="GtkSpinButton" id="spinbutton8">
+           <widget class="GtkSpinButton" id="spin_fluido_max">
              <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="digits">1</property>
+             <property name="numeric">True</property>
              <property name="update_policy">GTK_UPDATE_ALWAYS</property>
              <property name="snap_to_ticks">False</property>
              <property name="wrap">False</property>
-             <property name="adjustment">1 0 100 1 10 10</property>
+             <property name="adjustment">0 0 100 0.1 10 10</property>
            </widget>
            <packing>
              <property name="left_attach">1</property>
@@ -629,12 +629,12 @@ Empalme</property>
              <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="digits">1</property>
+             <property name="numeric">True</property>
              <property name="update_policy">GTK_UPDATE_ALWAYS</property>
              <property name="snap_to_ticks">False</property>
              <property name="wrap">False</property>
-             <property name="adjustment">1 0 100 1 10 10</property>
+             <property name="adjustment">0 0 100 0.1 10 10</property>
            </widget>
            <packing>
              <property name="left_attach">1</property>
@@ -806,12 +806,12 @@ Empalme</property>
              <property name="visible">True</property>
              <property name="can_focus">True</property>
              <property name="climb_rate">1</property>
-             <property name="digits">0</property>
+             <property name="digits">1</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">1 0 100 1 10 10</property>
+             <property name="adjustment">0 0 100 0.1 10 10</property>
            </widget>
            <packing>
              <property name="left_attach">1</property>
@@ -851,12 +851,12 @@ Empalme</property>
              <property name="visible">True</property>
              <property name="can_focus">True</property>
              <property name="climb_rate">1</property>
-             <property name="digits">0</property>
+             <property name="digits">1</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">1 0 100 1 10 10</property>
+             <property name="adjustment">0 0 100 0.1 10 10</property>
            </widget>
            <packing>
              <property name="left_attach">1</property>
@@ -872,12 +872,12 @@ Empalme</property>
              <property name="visible">True</property>
              <property name="can_focus">True</property>
              <property name="climb_rate">1</property>
-             <property name="digits">0</property>
+             <property name="digits">1</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">1 0 100 1 10 10</property>
+             <property name="adjustment">0 0 100 0.1 10 10</property>
            </widget>
            <packing>
              <property name="left_attach">1</property>
index 4caba43a99c813250b93af2a966d32d831e2db27..e17038bf79e14cade2b18828566f94213ede1988 100644 (file)
@@ -5,16 +5,16 @@ CItem::CItem(const char *filename):Gtk::DrawingArea()
 {
        image = Gdk::Pixbuf::create_from_file(filename);
        set_size_request(image->get_width(), image->get_height());
-
 }
 
 CItem::CItem()
 {
+       menu_image_propiedades.set(Gtk::Stock::PREFERENCES, Gtk::ICON_SIZE_MENU);
        menu_image_delete.set(Gtk::Stock::CANCEL, Gtk::ICON_SIZE_MENU);
        menu_image_rotar.set(Gtk::Stock::REFRESH, Gtk::ICON_SIZE_MENU);
        Gtk::Menu::MenuList& menulist = menu_popup.items();
-    menulist.push_back( Gtk::Menu_Helpers::MenuElem("Propiedades", SigC::slot(*this, &CItem::on_menu_popup_propiedades) ) );
-    menulist.push_back( Gtk::Menu_Helpers::ImageMenuElem("Rotar",Gtk::Menu::AccelKey("<control>r"), menu_image_rotar ,SigC::slot(*this, &CItem::on_menu_popup_rotar) ) );
+    menulist.push_back( Gtk::Menu_Helpers::ImageMenuElem("Propiedades",menu_image_propiedades, SigC::slot(*this, &CItem::on_menu_popup_propiedades) ) );
+    menulist.push_back( Gtk::Menu_Helpers::ImageMenuElem("Rotar", menu_image_rotar ,SigC::slot(*this, &CItem::on_menu_popup_rotar) ) );
     menulist.push_back( Gtk::Menu_Helpers::ImageMenuElem("Eliminar", menu_image_delete,SigC::slot(*this, &CItem::on_menu_popup_eliminar) ) ) ;
        menu_popup.accelerate(*this);
 }
index 900e335271b89298efa9d1db7c775f9745878759..7a4bd3105876d3cea4c906ee4f886046c3c450fa 100644 (file)
@@ -3,12 +3,14 @@
 
 #include <iostream>
 #include <gtkmm/drawingarea.h>
+#include <gtkmm/spinbutton.h>
 #include <gtkmm/stock.h>
 #include <gtkmm.h>
 #include <gdkmm.h>
 #include <libglademm.h>
 #include "propertywnd.h"
 
+
 class CItem:public Gtk::DrawingArea {
 public:
        CItem();
@@ -21,7 +23,7 @@ public:
        Glib::RefPtr<Gdk::Pixbuf> get_image() { return image; }
 protected:
        Gtk::Menu menu_popup;
-       Gtk::Image menu_image_delete, menu_image_rotar;
+       Gtk::Image menu_image_delete, menu_image_rotar, menu_image_propiedades;
        Glib::RefPtr<Gdk::Pixbuf> image;
        PropertyWnd *property_wnd;
 };
index 06b2cd6ee407056aefe328e6e822d63fb45f77cf..7c0c00003bc62f8d97a23ff0ef10b50ad7c79d98 100644 (file)
@@ -3,7 +3,7 @@
 #include "propertywnd.h"
 
 PropertyWnd::PropertyWnd()
-{
+{      
 }
 
 PropertyWnd::PropertyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade): Gtk::Window(cobject)
@@ -13,6 +13,7 @@ PropertyWnd::PropertyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
        refGlade->get_widget("btn_accept", btn_accept);
                
        btn_cancel->signal_clicked().connect(SigC::slot(*this, &PropertyWnd::on_btn_cancel_clicked));
+       btn_accept->signal_clicked().connect(SigC::slot(*this, &PropertyWnd::on_btn_accept_clicked));
 }
 
 PropertyWnd::~PropertyWnd()
@@ -24,3 +25,7 @@ void PropertyWnd::on_btn_cancel_clicked()
        hide();
        //oculto la ventana, tengo que ver como hago para cerrarla del todo.
 }
+
+void PropertyWnd::on_btn_accept_clicked()
+{
+}
index c9783705f85906af3067c7c1f90ca7e5e77819c8..2c068a8486cb9c5c1993caf2a970c0be9abd9ee2 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <gtkmm/window.h>
 #include <gtkmm/button.h>
+#include <gtkmm/spinbutton.h>
 #include <libglademm.h>
 
 class PropertyWnd : public Gtk::Window{
@@ -15,6 +16,7 @@ class PropertyWnd : public Gtk::Window{
        protected:
                Gtk::Button *btn_cancel, *btn_accept, *btn_apply;
                virtual void on_btn_cancel_clicked();
+               virtual void on_btn_accept_clicked();
        
        
 };