]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blob - Client/src/item_conduct.cpp
Se liberan los caños como GPL :-)
[z.facultad/75.42/plaqui.git] / Client / src / item_conduct.cpp
1
2 #include "item_conduct.h"
3
4 ViewConduct::ViewConduct(Glib::ustring _name, int orientacion):ViewItem(_name)
5 {
6         switch (orientacion) {
7                 case 0: // Caño vertical
8                         image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/canio_n.png");
9                 break;
10                 case 1: // Caño horizontal
11                         image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/canio_s.png");
12         }
13         m_or = orientacion;
14         image.show();
15         set_size_request();
16 }
17
18 ViewConduct::~ViewConduct()
19 {
20 }
21
22 bool ViewConduct::on_image_expose_event(GdkEventExpose *e)
23 {
24         Glib::RefPtr<Gdk::Colormap> colormap = image.get_colormap();
25         Gdk::Color blanco = Gdk::Color("white");
26         colormap->alloc_color(blanco);
27         colormap->alloc_color(color);
28         gc->set_foreground(color);
29         gc->set_background(color);
30         int w,h;
31         w = image.get_width();
32         h = image.get_height();
33         if (actual_flow == 0) return true;
34         switch (m_or) {
35                 case 0: // Vertical
36                         image.get_window()->draw_rectangle(gc, 1, w/2-3, 0, 6, h);
37                 break;
38                 case 1: // Horizontal
39                         image.get_window()->draw_rectangle(gc, 1, 0, h/2-3, w, 6);
40         }
41         return true;
42 }
43
44