X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/7f099f6374e9606735fb9766b51b5e86d83de815..b0a202776ab7634c206b495b42e20cfe6492e035:/Constructor/pumpptywnd.cpp diff --git a/Constructor/pumpptywnd.cpp b/Constructor/pumpptywnd.cpp index 7b150d1..cc5adba 100644 --- a/Constructor/pumpptywnd.cpp +++ b/Constructor/pumpptywnd.cpp @@ -1,11 +1,21 @@ #include "pumpptywnd.h" #include "pump.h" -PumpPtyWnd::PumpPtyWnd(BaseObjectType* cobject, const Glib::RefPtr& refGlade):ItemPtyWnd(cobject, refGlade) +PumpPtyWnd::PumpPtyWnd(BaseObjectType* cobject, const Glib::RefPtr& 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 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 +24,32 @@ 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(); }