#include "or.h"
-Or::Or()
+Or::Or(int orientacion)
{
+ is_logic = true;
out_connected = false;
- in_x = x;
- in_y = y+16;
- out_x = x+32;
- out_y = y+16;
imageN = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-constructor/pixmaps/or_n.png");
imageS = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-constructor/pixmaps/or_s.png");
imageE = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-constructor/pixmaps/or_e.png");
imageO = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-constructor/pixmaps/or_o.png");
null = Gdk::Pixbuf::create_from_file(PACKAGE_DATA_DIR"/plaqui-constructor/pixmaps/null.png");
- imgActual = 0;
- image = imageE;
+ imgActual = orientacion;
+ switch (imgActual) {
+ case 1:
+ image = imageS;
+ in_x = x +16;
+ in_y = y;
+ out_x = x+16;
+ out_y = y+32;
+ break;
+ case 2:
+ image = imageO;
+ in_x = x+32;
+ in_y = y+16;
+ out_x = x;
+ out_y = y+16;
+ break;
+ case 3:
+ image = imageN;
+ in_x = x+16;
+ in_y = y+32;
+ out_x = x+16;
+ out_y = y;
+ break;
+ default:
+ imgActual = 0;
+ image = imageE;
+ in_x = x;
+ in_y = y+16;
+ out_x = x+32;
+ out_y = y+16;
+ }
set_size_request(image->get_width(), image->get_height());
name = "or";
menulist.push_back( Gtk::Menu_Helpers::ImageMenuElem("Conectar", menu_image_linea,SigC::slot(*this, &CItem::on_menu_popup_conectar) ) ) ;