X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/663eccb7e27110aba6c79648c38254a7a5737bca..f1f01b21410b676a9c35c93251d5739bb65c711d:/Constructor/src/or.cpp?ds=inline diff --git a/Constructor/src/or.cpp b/Constructor/src/or.cpp index 4fdf2f2..4cbd535 100644 --- a/Constructor/src/or.cpp +++ b/Constructor/src/or.cpp @@ -1,19 +1,45 @@ #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) ) ) ;