X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/ed55685399f3dd28a22f229c9f384facbed4d48d..6fcc8fcf6b98f413f813904fe0f078d2782fb9d5:/Constructor/src/item.cpp diff --git a/Constructor/src/item.cpp b/Constructor/src/item.cpp index aa15a33..0bbf005 100644 --- a/Constructor/src/item.cpp +++ b/Constructor/src/item.cpp @@ -17,7 +17,7 @@ CItem::CItem() Glib::RefPtr ref; ref = Gnome::Glade::Xml::create(PACKAGE_DATA_DIR"/plaqui-constructor/dialogs/constructor.glade", "item_pty_wnd"); ref->get_widget_derived("item_pty_wnd",property_wnd); - caudal_max = 0.0; + caudal_max = 10.0; is_union = true; is_connected = false; is_logic =false; @@ -61,6 +61,9 @@ bool CItem::on_expose_event(GdkEventExpose* event) // XXX Esto no deberia ser necesario! en todo caso devolves false en // vez de true para que siga llamando a los otros handlers :) //Gtk::DrawingArea::on_expose_event(event); + if (CItem::logic_connect) { + draw_connectors(); + } return true; } @@ -144,6 +147,14 @@ void CItem::set_name(Glib::ustring _name) name = _name; } +void CItem::set_out_connected(bool _o) +{ +} + +void CItem::set_in_connected(bool _o) +{ +} + bool CItem::is_occupied_area(int _a, int _b) { if ( ( _a >= x ) && ( _a < x+image->get_width()) && (_b >= y) && (_b < y+image->get_height()) ) @@ -186,6 +197,26 @@ void CItem::get_out_logic_connect_position(int& _a, int& _b) _b = y; } +bool CItem::get_out_logic_connect() +{ + return false; +} + void CItem::update_logic_position() { } + +void CItem::draw_connectors() +{ + if ( in_x != -1 ) { + Glib::RefPtr window = get_window(); + + gc->set_foreground(red); + gc->set_background(red); + window->draw_rectangle(gc, 1, in_x-5-x, in_y-y, 10, 10); + gc->set_foreground(blue); + gc->set_background(blue); + window->draw_rectangle(gc, 1, out_x-5-x, out_y-y-10, 10, 10); + queue_draw(); + } +}