2 #include "cisternptywnd.h"
6 imageE = Gdk::Pixbuf::create_from_file("tanque_e.png");
7 imageO = Gdk::Pixbuf::create_from_file("tanque_o.png");
8 null = Gdk::Pixbuf::create_from_file("tanque_null.png");
11 set_size_request(image->get_width(), image->get_height());
13 Glib::RefPtr<Gnome::Glade::Xml> ref = Gnome::Glade::Xml::create("constructor.glade", "cistern_pty_wnd");
14 ref->get_widget_derived("cistern_pty_wnd",cistern_pty_wnd);
15 cistern_pty_wnd->cistern = this;
16 cistern_pty_wnd->set_title("Propiedades del Tanque");
23 bool Cistern::on_button_press_event(GdkEventButton *event)
25 if ((event->type == GDK_BUTTON_PRESS) && ( event->button ==2)){
27 image->render_to_drawable(get_window(),get_style()->get_black_gc(),0,0,0,0,image->get_width(),image->get_height(),Gdk::RGB_DITHER_NONE,0,0);
37 set_size_request(image->get_width(),image->get_height());
38 image->render_to_drawable(get_window(),get_style()->get_black_gc(),0,0,0,0,image->get_width(),image->get_height(),Gdk::RGB_DITHER_NONE,0,0);
41 if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 3)){
42 menu_popup.popup(event->button, event->time);
43 return true; //It has been handled.
46 if ((event->type == GDK_2BUTTON_PRESS) && (event->button ==1)){
47 cistern_pty_wnd->spin_capacidad->set_value( capacidad );
48 cistern_pty_wnd->spin_inicial->set_value( contenido_inicial );
49 cistern_pty_wnd->txt_cistern_name->set_text( name );
50 cistern_pty_wnd->show();
55 void Cistern::on_menu_popup_rotar()
58 event.type = GDK_BUTTON_PRESS;
60 Cistern::on_button_press_event(&event);
63 void Cistern::on_menu_popup_propiedades()
66 event.type = GDK_2BUTTON_PRESS;
68 Cistern::on_button_press_event(&event);
71 void Cistern::set_capacidad(double _cap)
76 double Cistern::get_capacidad()
81 void Cistern::set_contenido_inicial(double _ini)
83 contenido_inicial = _ini;
86 double Cistern::get_contenido_inicial()
88 return contenido_inicial;