bool And::on_button_press_event(GdkEventButton *event)
{
if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 1)) {
- if (CItem::logic_connect)
- CItem::gate_id = ID;
+ CItem::logic_connect = true;
+ CItem::gate_id = ID;
combo_entry->set_text(name);
WorkPlace::pointed = ID;
}
tmp_line.store = this;
workplace->lista_lineas_in.push_back(tmp_line);
workplace->queue_draw();
- } else {
+ } else if (detect_click_position(event->x, event->y) == OUT) {
tmp_line.logic = workplace->get_logic_item(CItem::gate_id);
tmp_line.store = this;
workplace->lista_lineas_out.push_back(tmp_line);
cistern_pty_wnd->txt_cistern_name->set_text( name );
cistern_pty_wnd->show();
}
+ CItem::logic_connect =false;
workplace->queue_draw();
return true;
}
tmp_line.store = this;
workplace->lista_lineas_in.push_back(tmp_line);
workplace->queue_draw();
- } else {
+ } else if (detect_click_position(event->x, event->y) == OUT) {
tmp_line.logic = workplace->get_logic_item(CItem::gate_id);
tmp_line.store = this;
workplace->lista_lineas_out.push_back(tmp_line);
if (estado) exclusa_pty_wnd->rd_btn_open->set_active(true);
exclusa_pty_wnd->show();
}
+ CItem::logic_connect =false;
workplace->queue_draw();
return true;
}
bool Not::on_button_press_event(GdkEventButton *event)
{
+
if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 1)) {
- if (CItem::logic_connect)
- CItem::gate_id = ID;
+ CItem::logic_connect = true;
+ CItem::gate_id = ID;
combo_entry->set_text(name);
WorkPlace::pointed = ID;
}
bool Or::on_button_press_event(GdkEventButton *event)
{
if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 1)) {
- if (CItem::logic_connect)
- CItem::gate_id = ID;
+ CItem::logic_connect = true;
+ CItem::gate_id = ID;
+ //if ( detect_click_position(event->x, event->y) == IN ) {
combo_entry->set_text(name);
WorkPlace::pointed = ID;
}
tmp_line.store = this;
workplace->lista_lineas_in.push_back(tmp_line);
workplace->queue_draw();
- } else {
+ } else if (detect_click_position(event->x, event->y) == OUT) {
tmp_line.logic = workplace->get_logic_item(CItem::gate_id);
tmp_line.store = this;
workplace->lista_lineas_out.push_back(tmp_line);
pump_pty_wnd->txt_pump_name->set_text( name );
pump_pty_wnd->show();
}
+ CItem::logic_connect =false;
workplace->queue_draw();
return true;
}
{
std::list<t_line>::iterator i = lista_lineas_in.begin();
while ( i != lista_lineas_in.end() ){
- if ( (*i).store->get_id() == _id || (*i).logic->get_id() == _id ) {
+ if ( (*i).store->get_id() == _id ) {
lista_lineas_in.erase(i);
i = lista_lineas_in.begin();
}
i++;
}
+
+ i = lista_lineas_in.begin();
+ while ( i != lista_lineas_in.end() ){
+ if ( (*i).logic->get_id() == _id ) {
+ lista_lineas_in.erase(i);
+ i = lista_lineas_in.begin();
+ }
+ i++;
+ }
+
i = lista_lineas_out.begin();
while ( i != lista_lineas_out.end() ){
- if ( (*i).store->get_id() == _id || (*i).logic->get_id() == _id ) {
+ if ( (*i).store->get_id() == _id ) {
lista_lineas_out.erase(i);
i = lista_lineas_out.begin();
}
i++;
}
+ i = lista_lineas_out.begin();
+ while ( i != lista_lineas_out.end() ){
+ if ( (*i).logic->get_id() == _id ) {
+ lista_lineas_out.erase(i);
+ i = lista_lineas_out.begin();
+ }
+ i++;
+ }
+
}
void WorkPlace::update_logic_position()