]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blob - Client/src/item_drain.cpp
subo el workplace.h y decime si asi esta bien puesto el comentario
[z.facultad/75.42/plaqui.git] / Client / src / item_drain.cpp
1
2 #include "item_drain.h"
3 #include <iostream>
4
5 ViewDrain::ViewDrain(Glib::ustring _name, int orientacion):ViewItem(_name)
6 {
7         switch (orientacion) {
8                 case 0:
9                         image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/drain_n.png");
10                 break;
11                 case 1:
12                         image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/drain_e.png");
13                 break;
14                 case 2:
15                         image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/drain_s.png");
16                 break;
17                 case 3:
18                         image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/drain_o.png");
19         }
20         image.show();
21         set_size_request();
22 }
23
24 ViewDrain::~ViewDrain()
25 {
26 }
27
28 bool ViewDrain::on_image_expose_event(GdkEventExpose *e)
29 {
30         Glib::RefPtr<Gdk::Colormap> colormap = Gtk::Widget::get_default_colormap();
31         colormap->alloc_color(color);
32         gc->set_foreground(color);
33         gc->set_background(color);
34         gc->set_line_attributes(6, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER);
35         int w,h;
36         w = image.get_width();
37         h = image.get_height();
38         // TODO : hacer que dibuje arcos en el sentido del codo!
39         if (actual_flow == 0) return true;
40         image.get_window()->draw_arc(gc, 1, 8, 8, 16, 16, 0, 360*64);
41         return true;
42 }