]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blob - Client/src/item_exclusa.cpp
Hago que se desconecte el cliente antes de salir y agrego handler para el evento
[z.facultad/75.42/plaqui.git] / Client / src / item_exclusa.cpp
1
2 #include "item_exclusa.h"
3
4 ViewExclusa::ViewExclusa(Glib::ustring _name, int orientacion):ViewItem(_name)
5 {
6         switch (orientacion) {
7                 case 0:
8                         image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/exclusa_h.png");
9                         in_x = 32;
10                         in_y = 0;
11                         out_x = 32;
12                         out_y = 32;
13                         offset_x = 0;
14                         offset_y = 0;
15                         item_offset_x = 0;
16                         item_offset_y = -15;
17                 break;
18                 case 1:
19                         image.set(PACKAGE_DATA_DIR"/plaqui-client/pixmaps/exclusa_s.png");
20                         in_x = 32;
21                         in_y = 32;
22                         out_x = 0;
23                         out_y = 32;
24                         offset_x = 0;
25                         offset_y = 0;
26                         item_offset_x = 0;
27                         item_offset_y = 15;
28         }
29         m_or = orientacion;
30         image.show();
31         set_size_request();
32 }
33
34 ViewExclusa::~ViewExclusa()
35 {
36 }
37
38 bool ViewExclusa::on_image_expose_event(GdkEventExpose *e)
39 {
40         Glib::RefPtr<Gdk::Colormap> colormap = image.get_colormap();
41         colormap->alloc_color(color);
42         gc->set_foreground(color);
43         gc->set_background(color);
44         int w,h;
45         w = image.get_width();
46         h = image.get_height();
47         switch (m_or) {
48                 case 1: // Vertical
49                         image.get_window()->draw_rectangle(gc, 1, w/2-2, 0, 4, h);
50                 break;
51                 case 0: // Horizontal
52                         image.get_window()->draw_rectangle(gc, 1, 0, h/2-2, w, 4);
53         }
54 }
55