X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/33cdbee1bf8051f1a4c9174aa518107793709fdd..796708eefb056b936274da15c7af2c7d709c9249:/Constructor/cisternptywnd.cpp diff --git a/Constructor/cisternptywnd.cpp b/Constructor/cisternptywnd.cpp index dcd4758..12617e2 100644 --- a/Constructor/cisternptywnd.cpp +++ b/Constructor/cisternptywnd.cpp @@ -6,6 +6,17 @@ CisternPtyWnd::CisternPtyWnd(BaseObjectType* cobject, const Glib::RefPtrget_widget("spin_capacidad", spin_capacidad); refGlade->get_widget("spin_inicial", spin_inicial); 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); + + 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,&CisternPtyWnd::on_btn_select_color_clicked)); + dlg_select_color_cancel->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_dlg_select_color_cancel_clicked)); + dlg_select_color_ok->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_dlg_select_color_ok_clicked)); } CisternPtyWnd::~CisternPtyWnd() @@ -14,9 +25,7 @@ CisternPtyWnd::~CisternPtyWnd() void CisternPtyWnd::on_btn_accept_clicked() { - cistern->set_capacidad( spin_capacidad->get_value() ); - cistern->set_contenido_inicial( spin_inicial->get_value() ); - cistern->set_name( txt_cistern_name->get_text() ); + CisternPtyWnd::on_btn_apply_clicked(); hide(); } @@ -25,4 +34,23 @@ 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() ); + color_select_dlg->get_colorsel()->set_current_color(cistern->get_liquid_color()); +} + +void CisternPtyWnd::on_btn_select_color_clicked() +{ + color_select_dlg->get_colorsel()->set_current_color(cistern->get_liquid_color()); + color_select_dlg->show(); +} + +void CisternPtyWnd::on_dlg_select_color_cancel_clicked() +{ + color_select_dlg->hide(); +} + +void CisternPtyWnd::on_dlg_select_color_ok_clicked() +{ + cistern->set_liquid_color( color_select_dlg->get_colorsel()->get_current_color() ); + color_preview->modify_bg( Gtk::STATE_NORMAL , cistern->get_liquid_color() ); + color_select_dlg->hide(); }