]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
es precario pero se tiran los cablecitos, iupi
authorNicolás Dimov <ndimov@gmail.com>
Tue, 18 Nov 2003 04:19:35 +0000 (04:19 +0000)
committerNicolás Dimov <ndimov@gmail.com>
Tue, 18 Nov 2003 04:19:35 +0000 (04:19 +0000)
Constructor/and.cpp
Constructor/exclusa.cpp
Constructor/item.cpp
Constructor/not.cpp
Constructor/or.cpp
Constructor/or.h
Constructor/pump.cpp

index 01f8ac023fcc9ae70026a81ac72f454fd7f2b9f9..801cfd52ff54dac899164b87597a67525590c528 100644 (file)
@@ -11,6 +11,7 @@ And::And()
        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()
index f615e4de0ada37a269ab2cae145ae6d366ae7d81..0ffb1a6afebfcd6a4c852d58a2fc65000fe2d973 100644 (file)
@@ -28,9 +28,18 @@ Exclusa::~Exclusa()
 
 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; 
@@ -44,8 +53,7 @@ bool Exclusa::on_button_press_event(GdkEventButton *event)
                                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)){
index 77eefda2ec7478d92461a98c936a57ebb2a3d507..bab22b431f640f741997eda7ad6d3f4e27f21a9e 100644 (file)
@@ -62,6 +62,8 @@ void CItem::on_menu_popup_eliminar()
 
 void CItem::on_menu_popup_conectar()
 {
+       CItem::logic_connect = true;
+       CItem::quien = ID;      
 }
 
 int CItem::get_position_x()
index 04e8ffc6f702d37baa8c2d3606c3e49edd0ce9d8..187ccc311983302c341a20bd2b61f79ea3561cee 100644 (file)
@@ -11,6 +11,7 @@ Not::Not()
        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()
index 0c0631b29ef780b885514e9c40f75b61566381b2..cf4fe97cb58319246f41ea12c4f83ebf471e5aa8 100644 (file)
@@ -20,10 +20,8 @@ Or::~Or()
 
 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;   
@@ -61,12 +59,6 @@ void Or::on_menu_popup_rotar()
        Or::on_button_press_event(&event);
 }
 
-void Or::on_menu_popup_conectar()
-{
-       CItem::logic_connect = true;
-       CItem::quien = ID;      
-}
-
 void Or::save(FILE *archivo)
 {
 
index 10b9234d3ba2ef70c1883f2cc34141ec5623be17..9da1cd2a0f429bfe34f17f8b74ddac626f2a6be9 100644 (file)
@@ -9,10 +9,8 @@ class Or : public CItem {
                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
index b26cda1b73160586b5d102f33d840c0e4959b99d..664b55d094a712e825b2da5a5b0ec4b39cf58836 100644 (file)
@@ -27,8 +27,18 @@ Pump::~Pump()
 
 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;