]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Constructor/pumpptywnd.cpp
* Cliente carga todos los widgets (falta exclusa!)
[z.facultad/75.42/plaqui.git] / Constructor / pumpptywnd.cpp
index 7b150d14b2ab183e610ea9eb410f85ffe86f60bf..d4510f348e5783af3f371ca4353557f0388dfe44 100644 (file)
@@ -1,11 +1,20 @@
 #include "pumpptywnd.h"
 #include "pump.h"
 
-PumpPtyWnd::PumpPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade):ItemPtyWnd(cobject, refGlade)
+PumpPtyWnd::PumpPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade):PropertyWnd(cobject, refGlade)
 {
-       refGlade->get_widget("lbl_property", lbl_property);
-       refGlade->get_widget("txt_item_name", txt_item_name);
-       lbl_property->set_text("Entrega Maxima");
+       refGlade->get_widget("btn_select_color",btn_select_color);
+       refGlade->get_widget("spin_fluid",spin_fluid);
+       refGlade->get_widget("txt_pump_name",txt_pump_name);
+       
+       Glib::RefPtr<Gnome::Glade::Xml> ref = Gnome::Glade::Xml::create("constructor.glade", "color_select_dlg");
+       ref->get_widget("color_select_dlg",color_select_dlg);
+       ref->get_widget("dlg_select_color_cancel",dlg_select_color_cancel);
+       ref->get_widget("dlg_select_color_ok",dlg_select_color_ok);
+
+       btn_select_color->signal_clicked().connect(SigC::slot(*this,&PumpPtyWnd::on_btn_select_color_clicked));
+       dlg_select_color_cancel->signal_clicked().connect(SigC::slot(*this,&PumpPtyWnd::on_dlg_select_color_cancel_clicked));
+       dlg_select_color_ok->signal_clicked().connect(SigC::slot(*this,&PumpPtyWnd::on_dlg_select_color_ok_clicked));
 }
 
 PumpPtyWnd::~PumpPtyWnd()
@@ -14,13 +23,31 @@ PumpPtyWnd::~PumpPtyWnd()
  
 void PumpPtyWnd::on_btn_accept_clicked()
 {
-       pump->set_entrega( spin_caudal->get_value() );
-       pump->set_name( txt_item_name->get_text() );
+       PumpPtyWnd::on_btn_apply_clicked();
        hide();
 }
 
 void PumpPtyWnd::on_btn_apply_clicked()
 {
-       pump->set_entrega( spin_caudal->get_value() );
-       pump->set_name( txt_item_name->get_text() );
+       pump->set_entrega( spin_fluid->get_value() );
+       pump->set_name( txt_pump_name->get_text() );
+       color_select_dlg->get_colorsel()->set_current_color(pump->get_liquid_color());
+}
+
+void PumpPtyWnd::on_btn_select_color_clicked()
+{
+       // poner un preview del color seleccionado
+       color_select_dlg->get_colorsel()->set_current_color(pump->get_liquid_color());
+       color_select_dlg->show();
+}
+
+void PumpPtyWnd::on_dlg_select_color_cancel_clicked()
+{
+       color_select_dlg->hide();
+}
+
+void PumpPtyWnd::on_dlg_select_color_ok_clicked()
+{
+       pump->set_liquid_color( color_select_dlg->get_colorsel()->get_current_color() );
+       color_select_dlg->hide();
 }