1 #include "cisternptywnd.h"
4 CisternPtyWnd::CisternPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade):PropertyWnd(cobject, refGlade)
6 refGlade->get_widget("spin_capacidad", spin_capacidad);
7 refGlade->get_widget("spin_inicial", spin_inicial);
8 refGlade->get_widget("txt_cistern_name", txt_cistern_name);
9 refGlade->get_widget("btn_select_color", btn_select_color);
10 Glib::RefPtr<Gnome::Glade::Xml> ref = Gnome::Glade::Xml::create("constructor.glade", "color_select_dlg");
11 ref->get_widget("color_select_dlg",color_select_dlg);
12 ref->get_widget("dlg_select_color_cancel",dlg_select_color_cancel);
13 ref->get_widget("dlg_select_color_ok",dlg_select_color_ok);
15 btn_select_color->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_btn_select_color_clicked));
16 dlg_select_color_cancel->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_dlg_select_color_cancel_clicked));
17 dlg_select_color_ok->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_dlg_select_color_ok_clicked));
20 CisternPtyWnd::~CisternPtyWnd()
24 void CisternPtyWnd::on_btn_accept_clicked()
26 CisternPtyWnd::on_btn_apply_clicked();
30 void CisternPtyWnd::on_btn_apply_clicked()
32 cistern->set_capacidad( spin_capacidad->get_value() );
33 cistern->set_contenido_inicial( spin_inicial->get_value() );
34 cistern->set_name( txt_cistern_name->get_text() );
35 color_select_dlg->get_colorsel()->set_current_color(cistern->get_liquid_color());
38 void CisternPtyWnd::on_btn_select_color_clicked()
40 color_select_dlg->get_colorsel()->set_current_color(cistern->get_liquid_color());
41 color_select_dlg->show();
44 void CisternPtyWnd::on_dlg_select_color_cancel_clicked()
46 color_select_dlg->hide();
49 void CisternPtyWnd::on_dlg_select_color_ok_clicked()
51 cistern->set_liquid_color( color_select_dlg->get_colorsel()->get_current_color() );
52 color_select_dlg->hide();