7 imageE = Gdk::Pixbuf::create_from_file("tanque_e.png");
8 imageO = Gdk::Pixbuf::create_from_file("tanque_o.png");
9 null = Gdk::Pixbuf::create_from_file("tanque_null.png");
12 set_size_request(image->get_width(), image->get_height());
14 Glib::RefPtr<Gnome::Glade::Xml> ref;
16 ref = Gnome::Glade::Xml::create("constructor.glade", "cistern_pty_wnd");
18 catch(const Gnome::Glade::XmlError &ex) {
19 std::cerr << ex.what() << std::endl;
21 ref->get_widget_derived("cistern_pty_wnd",cistern_pty_wnd);
28 bool Cistern::on_button_press_event(GdkEventButton *event)
30 if ((event->type == GDK_BUTTON_PRESS) && ( event->button ==2)){
32 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);
42 set_size_request(image->get_width(),image->get_height());
43 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);
46 if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 3)){
47 menu_popup.popup(event->button, event->time);
48 return true; //It has been handled.
51 if ((event->type == GDK_2BUTTON_PRESS) && (event->button ==1)){
52 cistern_pty_wnd->show();
57 void Cistern::on_menu_popup_rotar()
60 event.type = GDK_BUTTON_PRESS;
62 Cistern::on_button_press_event(&event);
65 void Cistern::on_menu_popup_propiedades()
67 cistern_pty_wnd->spin_caudal->set_value(caudal);
68 cistern_pty_wnd->spin_fluido_max->set_value(fluido_max);
70 event.type = GDK_2BUTTON_PRESS;
72 Cistern::on_button_press_event(&event);