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->spin_caudal->set_value((double)x);
53 cistern_pty_wnd->spin_fluido_max->set_value((double)y);
54 cistern_pty_wnd->show();
59 void Cistern::on_menu_popup_rotar()
62 event.type = GDK_BUTTON_PRESS;
64 Cistern::on_button_press_event(&event);
67 void Cistern::on_menu_popup_propiedades()
69 // cistern_pty_wnd->spin_caudal->set_value(caudal);
70 // cistern_pty_wnd->spin_fluido_max->set_value(fluido_max);
71 std::cout<< "posicion = "<< x <<" "<< y <<std::endl;
73 event.type = GDK_2BUTTON_PRESS;
75 Cistern::on_button_press_event(&event);