]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blob - Client/src/item_conduct.cpp
- Se agrega una version basica de la respuesta XML.
[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         switch (m_or) {
34                 case 0: // Vertical
35                         image.get_window()->draw_rectangle(gc, 1, w/2-2, 0, 4, h-1);
36                         gc->set_foreground(blanco);
37                         image.get_window()->draw_rectangle(gc, 0, w/2-3, 0, 6, h-1);
38                 break;
39                 case 1: // Horizontal
40                         image.get_window()->draw_rectangle(gc, 1, 0, h/2-2, w-1, 4);
41                         gc->set_foreground(blanco);
42                         image.get_window()->draw_rectangle(gc, 0, 0, h/2-3, w-1, 6);
43         }
44 }
45