#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);
+ refGlade->get_widget("color_preview",color_preview);
+
+ 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()
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_preview->modify_bg( Gtk::STATE_NORMAL , pump->get_liquid_color() );
+ color_select_dlg->hide();
}