]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blob - Client/src/item_exclusa.cpp
Se corrige el bug en la union (del modelo) que probablemente era el error
[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 = Gtk::Widget::get_default_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         if (actual_flow == 0) return true;
48         switch (m_or) {
49                 case 1: // Vertical
50                         image.get_window()->draw_rectangle(gc, 1, w/2-3, 0, 6, h);
51                 break;
52                 case 0: // Horizontal
53                         image.get_window()->draw_rectangle(gc, 1, 0, h/2-3, w, 6);
54         }
55         return true;
56 }
57