image = imageE;
set_size_request(image->get_width(), image->get_height());
name = "and";
+ menulist.push_back( Gtk::Menu_Helpers::ImageMenuElem("Conectar", menu_image_linea,SigC::slot(*this, &CItem::on_menu_popup_conectar) ) ) ;
}
And::~And()
bool Exclusa::on_button_press_event(GdkEventButton *event)
{
- int w, h;
- if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 1))
+ GdkEventExpose e;
+ t_line tmp_line;
+ if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 1)) {
combo_entry->set_text(name);
+ if (CItem::logic_connect) {
+ tmp_line.logic = workplace->get_logic_item(CItem::quien);
+ tmp_line.store = this;
+ workplace->lista_lineas.push_back(tmp_line);
+ workplace->on_expose_event(&e);
+ }
+ CItem::logic_connect = false;
+ }
if ((event->type == GDK_BUTTON_PRESS) && ( event->button ==2)){
image = null;
imgActual = 0;
image = imageN;
}
- get_size_request(w, h);
- set_size_request(h, w);
+ set_size_request(image->get_width(),image->get_height());
image->render_to_drawable(get_window(),get_style()->get_black_gc(),0,0,0,0,image->get_width(),image->get_height(),Gdk::RGB_DITHER_NONE,0,0);
}
if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 3)){
void CItem::on_menu_popup_conectar()
{
+ CItem::logic_connect = true;
+ CItem::quien = ID;
}
int CItem::get_position_x()
image = imageE;
set_size_request(image->get_width(), image->get_height());
name = "not";
+ menulist.push_back( Gtk::Menu_Helpers::ImageMenuElem("Conectar", menu_image_linea,SigC::slot(*this, &CItem::on_menu_popup_conectar) ) ) ;
}
Not::~Not()
bool Or::on_button_press_event(GdkEventButton *event)
{
- if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 1)) {
- std::cout<<ID<<std::endl;
+ if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 1))
combo_entry->set_text(name);
- }
if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 2)){
image = null;
Or::on_button_press_event(&event);
}
-void Or::on_menu_popup_conectar()
-{
- CItem::logic_connect = true;
- CItem::quien = ID;
-}
-
void Or::save(FILE *archivo)
{
virtual ~Or();
virtual bool on_button_press_event(GdkEventButton *event);
virtual void on_menu_popup_rotar();
- virtual void on_menu_popup_conectar();
virtual void save(FILE *archivo);
virtual bool check_connection();
- std::list<int> connected_items;
private:
Glib::RefPtr<Gdk::Pixbuf> imageN; // 0
Glib::RefPtr<Gdk::Pixbuf> imageS; // 1
bool Pump::on_button_press_event(GdkEventButton *event)
{
- if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 1))
+ GdkEventExpose e;
+ t_line tmp_line;
+ if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 1)) {
combo_entry->set_text(name);
+ if (CItem::logic_connect) {
+ tmp_line.logic = workplace->get_logic_item(CItem::quien);
+ tmp_line.store = this;
+ workplace->lista_lineas.push_back(tmp_line);
+ workplace->on_expose_event(&e);
+ }
+ CItem::logic_connect = false;
+ }
if ((event->type == GDK_BUTTON_PRESS) && ( event->button ==2)){
image = null;