X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/cd508589aa50ba1a706b8b9f07c9f4c8d6daee4c..954b8556b4bf52226085867069af83e63614a7c6:/Client/src/item_pump.cpp diff --git a/Client/src/item_pump.cpp b/Client/src/item_pump.cpp index abb1b0c..70201be 100644 --- a/Client/src/item_pump.cpp +++ b/Client/src/item_pump.cpp @@ -26,6 +26,7 @@ ViewPump::ViewPump(Glib::ustring _name, int orientacion):ViewItem(_name) item_offset_x = 0; item_offset_y = -15; } + m_or = orientacion; image.show(); set_size_request(); } @@ -34,3 +35,25 @@ ViewPump::~ViewPump() { } +bool ViewPump::on_image_expose_event(GdkEventExpose *e) +{ + Glib::RefPtr colormap = Gtk::Widget::get_default_colormap(); + if (!colormap->alloc_color(color, true, true)) { + std::cout << name << ": Error alocando color!" << std::endl; + } + + gc->set_foreground(color); + gc->set_background(color); + gc->set_line_attributes(6, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER); + if (actual_flow == 0) return true; + switch (m_or) { + case 0: + image.get_window()->draw_arc(gc, 1, 8, 8, 16, 16, 0, 360*64); + image.get_window()->draw_line(gc, 16, 16, 96, 16); + break; + case 1: + image.get_window()->draw_arc(gc, 1, 72, 8, 16, 16, 0, 360*64); + image.get_window()->draw_line(gc, 80, 16, 0, 16); + } + return true; +}