]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blob - Client/src/item_codo.cpp
621262747bb5c8ad3bc77d956a0cb04eefc4e324
[z.facultad/75.42/plaqui.git] / Client / src / item_codo.cpp
1
2 #include "item_codo.h"
3
4 ViewCodo::ViewCodo(Glib::ustring _name, int orientacion):ViewItem(_name)
5 {
6         switch (orientacion) {
7                 case 0:
8                         image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/codo_o.png");
9                 break;
10                 case 1:
11                         image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/codo_n.png");
12                 break;
13                 case 2:
14                         image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/codo_e.png");
15                 break;
16                 case 3:
17                         image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/codo_s.png");
18         }
19         m_or = orientacion;
20         image.show();
21         set_size_request();
22 }
23
24 ViewCodo::~ViewCodo()
25 {
26 }
27
28 bool ViewCodo::on_image_expose_event(GdkEventExpose *e)
29 {
30         Glib::RefPtr<Gdk::Colormap> colormap = image.get_colormap();
31         colormap->alloc_color(color);
32         gc->set_foreground(color);
33         gc->set_background(color);
34         int w,h;
35         w = image.get_width();
36         h = image.get_height();
37         // TODO : hacer que dibuje arcos en el sentido del codo!
38         image.get_window()->draw_rectangle(gc, 1, w/2-5, h/2-5, 10, 10);
39 /*      switch (orientacion) {
40                 case 0:
41                         image.get_window()->draw_rectangle(gc, 1, w/2-4, 0, 4, h);
42                 break;
43                 case 1:
44                         image.get_window()->draw_rectangle(gc, 1, w/2-4, 0, 4, h);
45                 break;
46                 case 2:
47                         image.get_window()->draw_rectangle(gc, 1, w/2-4, 0, 4, h);
48                 break;
49                 case 3:
50                         image.get_window()->draw_rectangle(gc, 1, w/2-4, 0, 4, h);
51         }*/
52 }
53