]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blob - Constructor/pumpptywnd.cpp
-ahi borre lo que se me escapo
[z.facultad/75.42/plaqui.git] / Constructor / pumpptywnd.cpp
1 #include "pumpptywnd.h"
2 #include "pump.h"
3
4 PumpPtyWnd::PumpPtyWnd(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade):PropertyWnd(cobject, refGlade)
5 {
6         refGlade->get_widget("btn_select_color",btn_select_color);
7         refGlade->get_widget("spin_fluid",spin_fluid);
8         refGlade->get_widget("txt_pump_name",txt_pump_name);
9         
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);
14
15         btn_select_color->signal_clicked().connect(SigC::slot(*this,&PumpPtyWnd::on_btn_select_color_clicked));
16         dlg_select_color_cancel->signal_clicked().connect(SigC::slot(*this,&PumpPtyWnd::on_dlg_select_color_cancel_clicked));
17         dlg_select_color_ok->signal_clicked().connect(SigC::slot(*this,&PumpPtyWnd::on_dlg_select_color_ok_clicked));
18 }
19
20 PumpPtyWnd::~PumpPtyWnd()
21 {
22 }
23  
24 void PumpPtyWnd::on_btn_accept_clicked()
25 {
26         PumpPtyWnd::on_btn_apply_clicked();
27         hide();
28 }
29
30 void PumpPtyWnd::on_btn_apply_clicked()
31 {
32         pump->set_entrega( spin_fluid->get_value() );
33         pump->set_name( txt_pump_name->get_text() );
34         color_select_dlg->get_colorsel()->set_current_color(pump->get_liquid_color());
35 }
36
37 void PumpPtyWnd::on_btn_select_color_clicked()
38 {
39         // poner un preview del color seleccionado
40         color_select_dlg->get_colorsel()->set_current_color(pump->get_liquid_color());
41         color_select_dlg->show();
42 }
43
44 void PumpPtyWnd::on_dlg_select_color_cancel_clicked()
45 {
46         color_select_dlg->hide();
47 }
48
49 void PumpPtyWnd::on_dlg_select_color_ok_clicked()
50 {
51         pump->set_liquid_color( color_select_dlg->get_colorsel()->get_current_color() );
52         color_select_dlg->hide();
53 }