From: Nicolás Dimov Date: Thu, 13 Nov 2003 17:57:15 +0000 (+0000) Subject: agrego las compuertas pero todavia no hacen nada, ademas tengo un conflicto con el... X-Git-Tag: svn_import~300 X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/commitdiff_plain/d53ded00c10a30a17c7f0aad90acca933a7f4db9 agrego las compuertas pero todavia no hacen nada, ademas tengo un conflicto con el conexionado del tubo y no encuentro la falla, pero deberia estar en Conduct::check_connection() --- diff --git a/Constructor/and.cpp b/Constructor/and.cpp new file mode 100644 index 0000000..debe5f5 --- /dev/null +++ b/Constructor/and.cpp @@ -0,0 +1,110 @@ +#include "and.h" + +And::And() +{ + imageN = Gdk::Pixbuf::create_from_file("and_n.png"); + imageS = Gdk::Pixbuf::create_from_file("and_s.png"); + imageE = Gdk::Pixbuf::create_from_file("and_e.png"); + imageO = Gdk::Pixbuf::create_from_file("and_o.png"); + null = Gdk::Pixbuf::create_from_file("null.png"); + imgActual = 0; + image = imageE; + set_size_request(image->get_width(), image->get_height()); + name = "and"; +} + +And::~And() +{ +} + +bool And::on_button_press_event(GdkEventButton *event) +{ + 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; + 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); + imgActual++; + switch (imgActual) { + case 1: + image = imageS; + break; + case 2: + image = imageO; + break; + case 3: + image = imageN; + break; + default: + imgActual = 0; + image = imageE; + } + 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)){ + menu_popup.popup(event->button, event->time); + return true; //It has been handled. + } + return true; +} +void And::on_menu_popup_rotar() +{ + GdkEventButton event; + event.type = GDK_BUTTON_PRESS; + event.button = 2; + And::on_button_press_event(&event); +} + +void And::save(FILE *archivo) +{ + +} + + +// CAMBIAR TODO ESTO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +bool And::check_connection() +{ + switch (get_img_actual()) { + case 0: + if ( is_other_connection_area( get_position_x()-5, get_position_y()+16) && + is_other_connection_area( get_position_x()+get_image()->get_width()-16, +get_position_y()+get_image()->get_height() + 5) ) + return true; + break; + case 1: + if ( is_other_connection_area( get_position_x()+get_image()->get_width() - 16, get_position_y() -5) && + is_other_connection_area( get_position_x()-5, get_position_y()+get_image()->get_height()-16) ) + return true; + break; + case 2: + if ( is_other_connection_area( get_position_x() + 16, get_position_y() -5) && + is_other_connection_area( get_position_x()+get_image()->get_width()+5, get_position_y()+get_image()->get_height()-16) ) + return true; + break; + case 3: + if ( is_other_connection_area( get_position_x()+get_image()->get_width()+5, get_position_y() +16) && + is_other_connection_area( get_position_x() + 16, get_position_y()+get_image()->get_height() + 5) ) + return true; + } + return false; +} + +bool And::is_connection_area(int _a, int _b) +{ + switch (imgActual) { + case 0: if ( ( (_a <= x+10)&&(_a > x) && (_b <=y+22)&&(_b>=y+10) ) || + ( (_a <= x+image->get_width()-10)&&(_a>=x+image->get_width()-22)&&(_b<=y+image->get_height()-1)&&(_b>=y+image->get_height()-10) ) ) + return true; + case 1: if ( ( (_a <= x+image->get_width()-10)&&(_a >= x+image->get_width()-22) && (_b <=y+10)&&(_b > y) ) || + ( (_a <= x+10)&&(_a > x)&&(_b<=y+image->get_height()-10)&&(_b>=y+image->get_height()-22) ) ) + return true; + case 2: if ( ( (_a <= x+22)&&(_a >= x+10) && (_b <=y+10)&&(_b > y) ) || + ( (_a <= x+image->get_width()-1)&&(_a>=x+image->get_width()-10)&&(_b<=y+image->get_height()-10)&&(_b>=y+image->get_height()-22) ) ) + return true; + case 3: if ( ( (_a <= x+image->get_width()-1)&&(_a >= x+image->get_width()-10) && (_b <=y+22)&&(_b>=y+10) ) || + ( (_a <= x+22)&&(_a>=x+10)&&(_b<=y+image->get_height()-1)&&(_b>=y+image->get_height()-10) ) ) + return true; + } + return false; +} diff --git a/Constructor/and.h b/Constructor/and.h new file mode 100644 index 0000000..cca48a1 --- /dev/null +++ b/Constructor/and.h @@ -0,0 +1,22 @@ +#ifndef _AND_H_ +#define _AND_H_ + +#include "item.h" + +class And : public CItem { + public: + And(); + virtual ~And(); + virtual bool on_button_press_event(GdkEventButton *event); + virtual void on_menu_popup_rotar(); + virtual void save(FILE *archivo); + virtual bool check_connection(); + virtual bool is_connection_area(int _a, int _b); + private: + Glib::RefPtr imageN; // 0 + Glib::RefPtr imageS; // 1 + Glib::RefPtr imageE; // 2 + Glib::RefPtr imageO; // 3 + Glib::RefPtr null; +}; +#endif diff --git a/Constructor/and.o b/Constructor/and.o new file mode 100644 index 0000000..bdfe85c Binary files /dev/null and b/Constructor/and.o differ diff --git a/Constructor/and_e.png b/Constructor/and_e.png new file mode 100644 index 0000000..0ae0826 Binary files /dev/null and b/Constructor/and_e.png differ diff --git a/Constructor/and_n.png b/Constructor/and_n.png new file mode 100644 index 0000000..8abc931 Binary files /dev/null and b/Constructor/and_n.png differ diff --git a/Constructor/and_o.png b/Constructor/and_o.png new file mode 100644 index 0000000..dcd5136 Binary files /dev/null and b/Constructor/and_o.png differ diff --git a/Constructor/and_s.png b/Constructor/and_s.png new file mode 100644 index 0000000..bbb3bf9 Binary files /dev/null and b/Constructor/and_s.png differ diff --git a/Constructor/cistern.cpp b/Constructor/cistern.cpp index 02bbbcb..88eae2d 100644 --- a/Constructor/cistern.cpp +++ b/Constructor/cistern.cpp @@ -77,9 +77,9 @@ void Cistern::set_capacidad(double _cap) capacidad = _cap; } -double Cistern::get_capacidad() +void Cistern::set_liquid_color(Gdk::Color _color) { - return capacidad; + liquid_color = _color; } void Cistern::set_contenido_inicial(double _ini) @@ -87,14 +87,27 @@ void Cistern::set_contenido_inicial(double _ini) contenido_inicial = _ini; } +double Cistern::get_capacidad() +{ + return capacidad; +} + double Cistern::get_contenido_inicial() { return contenido_inicial; } +Gdk::Color Cistern::get_liquid_color() +{ + return liquid_color; +} + void Cistern::save(FILE *archivo) { - char c_id[50], c_cap[50], c_x[50], c_y[50], c_img[50], c_ini[50]; + char c_id[50], c_cap[50], c_x[50], c_y[50], c_img[50], c_ini[50], c_red[50], c_green[50], c_blue[50]; + sprintf(c_red,"\t\t\t%d\n",liquid_color.get_red()); + sprintf(c_green,"\t\t\t%d\n",liquid_color.get_green()); + sprintf(c_blue,"\t\t\t%d\n",liquid_color.get_blue()); sprintf(c_x,"\t\t%d\n",x); sprintf(c_y,"\t\t%d\n",y); sprintf(c_id,"%d",ID); @@ -107,6 +120,11 @@ void Cistern::save(FILE *archivo) dato += "\">\n"; dato += c_cap; dato += c_ini; + dato += "\t\n"; + dato += c_red; + dato += c_green; + dato += c_blue; + dato += "\t\n"; dato += c_img; dato += c_x; dato += c_y; diff --git a/Constructor/cistern.h b/Constructor/cistern.h index c2d0f3c..0065554 100644 --- a/Constructor/cistern.h +++ b/Constructor/cistern.h @@ -15,8 +15,10 @@ class Cistern : public CItem { virtual void on_menu_popup_propiedades(); void set_capacidad(double _cap); void set_contenido_inicial(double _ini); + void set_liquid_color(Gdk::Color _color); double get_contenido_inicial(); double get_capacidad(); + Gdk::Color get_liquid_color(); virtual void save(FILE *archivo); virtual bool check_connection(); virtual bool is_connection_area(int _a, int _b); @@ -25,6 +27,7 @@ class Cistern : public CItem { Glib::RefPtr imageE; // 0 Glib::RefPtr imageO; // 1 Glib::RefPtr null; + Gdk::Color liquid_color; CisternPtyWnd *cistern_pty_wnd; }; #endif diff --git a/Constructor/cisternptywnd.cpp b/Constructor/cisternptywnd.cpp index dcd4758..e5ca32d 100644 --- a/Constructor/cisternptywnd.cpp +++ b/Constructor/cisternptywnd.cpp @@ -6,6 +6,15 @@ CisternPtyWnd::CisternPtyWnd(BaseObjectType* cobject, const Glib::RefPtrget_widget("spin_capacidad", spin_capacidad); refGlade->get_widget("spin_inicial", spin_inicial); refGlade->get_widget("txt_cistern_name", txt_cistern_name); + refGlade->get_widget("btn_select_color", btn_select_color); + Glib::RefPtr ref = Gnome::Glade::Xml::create("constructor.glade", "color_select_dlg"); + ref->get_widget("color_select_dlg",color_select_dlg); + ref->get_widget("dlg_select_color_cancel",dlg_select_color_cancel); + ref->get_widget("dlg_select_color_ok",dlg_select_color_ok); + + btn_select_color->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_btn_select_color_clicked)); + dlg_select_color_cancel->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_dlg_select_color_cancel_clicked)); + dlg_select_color_ok->signal_clicked().connect(SigC::slot(*this,&CisternPtyWnd::on_dlg_select_color_ok_clicked)); } CisternPtyWnd::~CisternPtyWnd() @@ -14,9 +23,7 @@ CisternPtyWnd::~CisternPtyWnd() void CisternPtyWnd::on_btn_accept_clicked() { - cistern->set_capacidad( spin_capacidad->get_value() ); - cistern->set_contenido_inicial( spin_inicial->get_value() ); - cistern->set_name( txt_cistern_name->get_text() ); + CisternPtyWnd::on_btn_apply_clicked(); hide(); } @@ -25,4 +32,22 @@ void CisternPtyWnd::on_btn_apply_clicked() cistern->set_capacidad( spin_capacidad->get_value() ); cistern->set_contenido_inicial( spin_inicial->get_value() ); cistern->set_name( txt_cistern_name->get_text() ); + color_select_dlg->get_colorsel()->set_current_color(cistern->get_liquid_color()); +} + +void CisternPtyWnd::on_btn_select_color_clicked() +{ + color_select_dlg->get_colorsel()->set_current_color(cistern->get_liquid_color()); + color_select_dlg->show(); +} + +void CisternPtyWnd::on_dlg_select_color_cancel_clicked() +{ + color_select_dlg->hide(); +} + +void CisternPtyWnd::on_dlg_select_color_ok_clicked() +{ + cistern->set_liquid_color( color_select_dlg->get_colorsel()->get_current_color() ); + color_select_dlg->hide(); } diff --git a/Constructor/cisternptywnd.h b/Constructor/cisternptywnd.h index 16e51ad..81af75c 100644 --- a/Constructor/cisternptywnd.h +++ b/Constructor/cisternptywnd.h @@ -11,9 +11,14 @@ class CisternPtyWnd : public PropertyWnd { virtual ~CisternPtyWnd(); Cistern *cistern; Gtk::SpinButton *spin_inicial, *spin_capacidad; + Gtk::Button *btn_select_color, *dlg_select_color_ok, *dlg_select_color_cancel; Gtk::Entry *txt_cistern_name; + Gtk::ColorSelectionDialog *color_select_dlg; virtual void on_btn_accept_clicked(); virtual void on_btn_apply_clicked(); + virtual void on_btn_select_color_clicked(); + virtual void on_dlg_select_color_cancel_clicked(); + virtual void on_dlg_select_color_ok_clicked(); }; #endif diff --git a/Constructor/conduct.cpp b/Constructor/conduct.cpp index 1a75aef..9b2e31f 100644 --- a/Constructor/conduct.cpp +++ b/Constructor/conduct.cpp @@ -94,11 +94,10 @@ bool Conduct::check_connection() if ( is_other_connection_area( get_position_x()+16, get_position_y()-5) && is_other_connection_area( get_position_x()+16, get_position_y()+get_image()->get_height() +5) ) return true; - break; case 1: if ( is_other_connection_area( get_position_x()-5, get_position_y()+16) && is_other_connection_area( get_position_x()+get_image()->get_width()+5, get_position_y()+16) ) - return true; + return true; } return false; } diff --git a/Constructor/constructor.cpp b/Constructor/constructor.cpp index 81a9c37..0278ec0 100644 --- a/Constructor/constructor.cpp +++ b/Constructor/constructor.cpp @@ -12,6 +12,9 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtrget_widget("btn_canio", btn_canio); refGlade->get_widget("btn_codo", btn_codo); @@ -19,6 +22,9 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtrget_widget("btn_tanque",btn_tanque); refGlade->get_widget("btn_bomba", btn_bomba); refGlade->get_widget("btn_exclusa", btn_exclusa); + refGlade->get_widget("btn_and", btn_and); + refGlade->get_widget("btn_or", btn_or); + refGlade->get_widget("btn_not", btn_not); refGlade->get_widget("main_menu_quit",main_menu_quit); refGlade->get_widget("main_menu_save",main_menu_save); refGlade->get_widget("edit_menu_del",edit_menu_del); @@ -44,6 +50,9 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtrdrag_source_set(listTargets); btn_bomba->drag_source_set(listTargets); btn_exclusa->drag_source_set(listTargets); + btn_and->drag_source_set(listTargets); + btn_or->drag_source_set(listTargets); + btn_not->drag_source_set(listTargets); btn_canio->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_canio_drag_get)); btn_bomba->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_bomba_drag_get)); @@ -51,6 +60,9 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtrsignal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_y_drag_get)); btn_codo->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_codo_drag_get)); btn_tanque->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_tanque_drag_get)); + btn_and->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_and_drag_get)); + btn_or->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_or_drag_get)); + btn_not->signal_drag_data_get().connect( SigC::slot(*this, &Constructor::on_btn_not_drag_get)); btn_check->signal_clicked().connect(SigC::slot(*this,&Constructor::on_btn_check_clicked)); btn_dlg_close->signal_clicked().connect(SigC::slot(*this,&Constructor::on_btn_dlg_connect_clicked)); chk_btn_logica->signal_clicked().connect(SigC::slot(*this, &Constructor::on_chk_btn_clicked)); @@ -71,7 +83,9 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtrsignal_drag_begin().connect( SigC::slot(*this, &Constructor::on_tanque_drag_begin)); btn_bomba->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_bomba_drag_begin)); btn_exclusa->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_exclusa_drag_begin)); - + btn_and->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_and_drag_begin)); + btn_or->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_or_drag_begin)); + btn_not->signal_drag_begin().connect( SigC::slot(*this, &Constructor::on_not_drag_begin)); workplace->drag_dest_set(listTargets); workplace->signal_drag_data_received().connect( SigC::slot(*this, &Constructor::on_item_drop_drag_received) ); workplace->listaItems = &listaItems; @@ -81,11 +95,9 @@ Constructor::Constructor(BaseObjectType* cobject, const Glib::RefPtr::iterator i = listaItems.begin(); - std::cout << "ok" << std::endl; while ( i != listaItems.end() ){ CItem *temp = *i; listaItems.erase(i); - std::cout << "Elimnando ... " << std::endl; delete temp; i = listaItems.begin(); } @@ -121,6 +133,22 @@ void Constructor::on_btn_exclusa_drag_get(const Glib::RefPtr& gtk_selection_data_set(selection_data, selection_data->target, 8,(const guchar*)"exclusa_h.png",15); } +void Constructor::on_btn_and_drag_get(const Glib::RefPtr& context, GtkSelectionData* selection_data, guint info, guint time) +{ + gtk_selection_data_set(selection_data, selection_data->target, 8,(const guchar*)"and_e.png",9); +} + +void Constructor::on_btn_or_drag_get(const Glib::RefPtr& context, GtkSelectionData* selection_data, guint info, guint time) +{ + gtk_selection_data_set(selection_data, selection_data->target, 8,(const guchar*)"or_e.png",8); +} + +void Constructor::on_btn_not_drag_get(const Glib::RefPtr& context, GtkSelectionData* selection_data, guint info, guint time) +{ + gtk_selection_data_set(selection_data, selection_data->target, 8,(const guchar*)"not_e.png",9); +} + + void Constructor::on_main_menu_quit() { delete this; @@ -201,6 +229,21 @@ void Constructor::on_exclusa_drag_begin(const Glib::RefPtr& co context->set_icon(ico_exclusa, 5, 5); } +void Constructor::on_and_drag_begin(const Glib::RefPtr& context) +{ + context->set_icon(ico_and, 5, 5); +} + +void Constructor::on_or_drag_begin(const Glib::RefPtr& context) +{ + context->set_icon(ico_or, 5, 5); +} + +void Constructor::on_not_drag_begin(const Glib::RefPtr& context) +{ + context->set_icon(ico_not, 5, 5); +} + void Constructor::on_item_drag_begin(const Glib::RefPtr& context, CItem *item) { context->set_icon(item->get_image(), 5, 5); @@ -261,7 +304,12 @@ void Constructor::on_item_drop_drag_received(const Glib::RefPtrdata, "exclusa_h.png")==0) a = new Exclusa(); - + else if (strcmp((const char *)selection_data->data, "and_e.png")==0) + a = new And(); + else if (strcmp((const char *)selection_data->data, "or_e.png")==0) + a = new Or(); + else if (strcmp((const char *)selection_data->data, "not_e.png")==0) + a = new Not(); char char_id[10]; sprintf(char_id," %d",id); diff --git a/Constructor/constructor.glade b/Constructor/constructor.glade index 28c0ac4..4d57058 100644 --- a/Constructor/constructor.glade +++ b/Constructor/constructor.glade @@ -7,7 +7,7 @@ 640 573 True - window1 + Constuctor GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER False @@ -462,7 +462,7 @@ 0 True - True + False @@ -509,35 +509,131 @@ 5 - + True True True - AND - True GTK_RELIEF_NORMAL + + + + True + 0.5 + 0.5 + 0 + 0 + + + + True + False + 2 + + + + True + and_e.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + - + True True True - OR - True GTK_RELIEF_NORMAL + + + + True + 0.5 + 0.5 + 0 + 0 + + + + True + False + 2 + + + + True + or_e.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + - + True True True - NOT - True GTK_RELIEF_NORMAL + + + + True + 0.5 + 0.5 + 0 + 0 + + + + True + False + 2 + + + + True + not_e.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + @@ -562,8 +658,8 @@ - 289 - 143 + 272 + 182 Propiedades del Tanque GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER @@ -630,56 +726,88 @@ True - 3 + 4 2 True 0 0 - + True - Contenido Inicial - False - False - GTK_JUSTIFY_LEFT + True + True + True + 0 + + True + * + False + + + 1 + 2 + 2 + 3 + + + + + + + True + True + 1 + 1 + False + GTK_UPDATE_ALWAYS + False False - False - 0 - 0.5 - 0 - 0 + 0 0 100 0.1 10 10 - 0 - 1 + 1 + 2 + 1 + 2 + + + + + + + True + True + 1 + 1 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 0.1 10 10 + + + 1 + 2 0 1 - fill - + True - Capacidad Máxima - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 + gtk-select-color + True + GTK_RELIEF_NORMAL 0 1 - 1 - 2 - fill + 3 + 4 + @@ -703,70 +831,55 @@ 1 2 3 - fill - - - - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 2 - 2 - 3 + - + True - True - 1 - 1 - False - GTK_UPDATE_ALWAYS - False + Capacidad Máxima + False + False + GTK_JUSTIFY_LEFT False - 0 0 100 0.1 10 10 + False + 0 + 0.5 + 0 + 0 - 1 - 2 + 0 + 1 1 2 + - + True - True - 1 - 1 - False - GTK_UPDATE_ALWAYS - False + Contenido Inicial + False + False + GTK_JUSTIFY_LEFT False - 0 0 100 0.1 10 10 + False + 0 + 0.5 + 0 + 0 - 1 - 2 + 0 + 1 0 1 + @@ -783,6 +896,8 @@ + 287 + 103 Propiedades del GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER @@ -800,7 +915,7 @@ True - GTK_BUTTONBOX_END + GTK_BUTTONBOX_SPREAD @@ -877,25 +992,22 @@ - + True - Flujo Máximo - False - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 + True + True + True + 0 + + True + * + False - 0 - 1 - 0 - 1 - fill + 1 + 2 + 1 + 2 @@ -919,28 +1031,31 @@ 1 1 2 - fill + - + True - True - True - True - 0 - - True - * - False + Flujo Máximo + False + False + GTK_JUSTIFY_CENTER + False + False + 0 + 0.5 + 0 + 0 - 1 - 2 - 1 - 2 + 0 + 1 + 0 + 1 + @@ -1051,7 +1166,7 @@ - 273 + 267 143 Propiedades de la Exclusa GTK_WINDOW_TOPLEVEL @@ -1126,55 +1241,7 @@ 0 - - True - Capacidad Máxima - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Estado - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - + True False 0 @@ -1226,6 +1293,54 @@ + + + True + Estado + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 1 + 0 + 1 + + + + + + + + True + Nombre + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 1 + 1 + 2 + + + + + True @@ -1258,4 +1373,245 @@ + + Seleccionar Color + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + False + False + + + + True + True + True + GTK_RELIEF_NORMAL + + + + + + True + True + True + GTK_RELIEF_NORMAL + + + + + + True + True + True + gtk-help + True + GTK_RELIEF_NORMAL + + + + + + True + False + False + + + + + + 291 + 152 + Propiedades de la Bomba + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + False + False + True + + + + 320 + 158 + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + -6 + + + + + + True + True + True + gtk-apply + True + GTK_RELIEF_NORMAL + -10 + + + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + 3 + 2 + True + 0 + 0 + + + + True + True + 1 + 1 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 0.1 10 10 + + + 1 + 2 + 0 + 1 + + + + + + + True + gtk-select-color + True + GTK_RELIEF_NORMAL + + + 0 + 1 + 2 + 3 + expand + expand + + + + + + True + Nombre + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 1 + 1 + 2 + + + + + + + + True + Flujo Máximo + False + False + GTK_JUSTIFY_CENTER + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 1 + 0 + 1 + + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 1 + 2 + + + + + + 10 + True + False + GTK_PACK_END + + + + + + diff --git a/Constructor/constructor.h b/Constructor/constructor.h index 12e1712..b9297fb 100644 --- a/Constructor/constructor.h +++ b/Constructor/constructor.h @@ -21,6 +21,9 @@ #include "cistern.h" #include "exclusa.h" #include "pump.h" +#include "and.h" +#include "or.h" +#include "not.h" class Constructor : public Gtk::Window { public: @@ -31,14 +34,15 @@ class Constructor : public Gtk::Window { protected: int id; // / defino los elementos de la ventana. - Gtk::Button *btn_canio, *btn_codo, *btn_y, *btn_tanque, *btn_bomba, *btn_exclusa, *btn_file_ok, *btn_file_cancel, *btn_check, *btn_dlg_close; + Gtk::Button *btn_canio, *btn_codo, *btn_y, *btn_tanque, *btn_bomba, *btn_exclusa, *btn_file_ok, *btn_file_cancel, *btn_check, *btn_dlg_close, + *btn_and, *btn_or, *btn_not; Gtk::ImageMenuItem *main_menu_quit, *edit_menu_del, *main_menu_save; Gtk::CheckButton *chk_btn_logica; Gtk::FileSelection *file_selection; Gtk::Entry *combo_entry; Gtk::Dialog *dlg_connect; Gtk::Label *dlg_label; - Glib::RefPtr ico_canio, ico_y, ico_codo, ico_tanque, ico_bomba, ico_exclusa; + Glib::RefPtr ico_canio, ico_y, ico_codo, ico_tanque, ico_bomba, ico_exclusa, ico_and, ico_or, ico_not; Glib::RefPtr ico_last; std::list listTargets; std::list listaItems; @@ -53,6 +57,9 @@ class Constructor : public Gtk::Window { virtual void on_btn_tanque_drag_get(const Glib::RefPtr& context, GtkSelectionData* selection_data, guint info, guint time); virtual void on_btn_bomba_drag_get(const Glib::RefPtr& context, GtkSelectionData* selection_data, guint info, guint time); virtual void on_btn_exclusa_drag_get(const Glib::RefPtr& context, GtkSelectionData* selection_data, guint info, guint time); + virtual void on_btn_and_drag_get(const Glib::RefPtr& context, GtkSelectionData* selection_data, guint info, guint time); + virtual void on_btn_or_drag_get(const Glib::RefPtr& context, GtkSelectionData* selection_data, guint info, guint time); + virtual void on_btn_not_drag_get(const Glib::RefPtr& context, GtkSelectionData* selection_data, guint info, guint time); virtual void on_main_menu_quit(); virtual void on_main_menu_save(); virtual void on_edit_menu_del(); @@ -69,6 +76,9 @@ class Constructor : public Gtk::Window { virtual void on_tanque_drag_begin(const Glib::RefPtr& context); virtual void on_bomba_drag_begin(const Glib::RefPtr& context); virtual void on_exclusa_drag_begin(const Glib::RefPtr& context); + virtual void on_and_drag_begin(const Glib::RefPtr& context); + virtual void on_or_drag_begin(const Glib::RefPtr& context); + virtual void on_not_drag_begin(const Glib::RefPtr& context); virtual void on_item_drag_begin(const Glib::RefPtr& context, CItem *); virtual void on_item_drag_data_get(const Glib::RefPtr& context, GtkSelectionData* selection_data, guint info, guint time); diff --git a/Constructor/not.cpp b/Constructor/not.cpp new file mode 100644 index 0000000..1107030 --- /dev/null +++ b/Constructor/not.cpp @@ -0,0 +1,110 @@ +#include "not.h" + +Not::Not() +{ + imageN = Gdk::Pixbuf::create_from_file("not_n.png"); + imageS = Gdk::Pixbuf::create_from_file("not_s.png"); + imageE = Gdk::Pixbuf::create_from_file("not_e.png"); + imageO = Gdk::Pixbuf::create_from_file("not_o.png"); + null = Gdk::Pixbuf::create_from_file("null.png"); + imgActual = 0; + image = imageE; + set_size_request(image->get_width(), image->get_height()); + name = "not"; +} + +Not::~Not() +{ +} + +bool Not::on_button_press_event(GdkEventButton *event) +{ + 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; + 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); + imgActual++; + switch (imgActual) { + case 1: + image = imageS; + break; + case 2: + image = imageO; + break; + case 3: + image = imageN; + break; + default: + imgActual = 0; + image = imageE; + } + 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)){ + menu_popup.popup(event->button, event->time); + return true; //It has been handled. + } + return true; +} +void Not::on_menu_popup_rotar() +{ + GdkEventButton event; + event.type = GDK_BUTTON_PRESS; + event.button = 2; + Not::on_button_press_event(&event); +} + +void Not::save(FILE *archivo) +{ + +} + + +// CAMBIAR TODO ESTO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +bool Not::check_connection() +{ + switch (get_img_actual()) { + case 0: + if ( is_other_connection_area( get_position_x()-5, get_position_y()+16) && + is_other_connection_area( get_position_x()+get_image()->get_width()-16, +get_position_y()+get_image()->get_height() + 5) ) + return true; + break; + case 1: + if ( is_other_connection_area( get_position_x()+get_image()->get_width() - 16, get_position_y() -5) && + is_other_connection_area( get_position_x()-5, get_position_y()+get_image()->get_height()-16) ) + return true; + break; + case 2: + if ( is_other_connection_area( get_position_x() + 16, get_position_y() -5) && + is_other_connection_area( get_position_x()+get_image()->get_width()+5, get_position_y()+get_image()->get_height()-16) ) + return true; + break; + case 3: + if ( is_other_connection_area( get_position_x()+get_image()->get_width()+5, get_position_y() +16) && + is_other_connection_area( get_position_x() + 16, get_position_y()+get_image()->get_height() + 5) ) + return true; + } + return false; +} + +bool Not::is_connection_area(int _a, int _b) +{ + switch (imgActual) { + case 0: if ( ( (_a <= x+10)&&(_a > x) && (_b <=y+22)&&(_b>=y+10) ) || + ( (_a <= x+image->get_width()-10)&&(_a>=x+image->get_width()-22)&&(_b<=y+image->get_height()-1)&&(_b>=y+image->get_height()-10) ) ) + return true; + case 1: if ( ( (_a <= x+image->get_width()-10)&&(_a >= x+image->get_width()-22) && (_b <=y+10)&&(_b > y) ) || + ( (_a <= x+10)&&(_a > x)&&(_b<=y+image->get_height()-10)&&(_b>=y+image->get_height()-22) ) ) + return true; + case 2: if ( ( (_a <= x+22)&&(_a >= x+10) && (_b <=y+10)&&(_b > y) ) || + ( (_a <= x+image->get_width()-1)&&(_a>=x+image->get_width()-10)&&(_b<=y+image->get_height()-10)&&(_b>=y+image->get_height()-22) ) ) + return true; + case 3: if ( ( (_a <= x+image->get_width()-1)&&(_a >= x+image->get_width()-10) && (_b <=y+22)&&(_b>=y+10) ) || + ( (_a <= x+22)&&(_a>=x+10)&&(_b<=y+image->get_height()-1)&&(_b>=y+image->get_height()-10) ) ) + return true; + } + return false; +} diff --git a/Constructor/not.h b/Constructor/not.h new file mode 100644 index 0000000..dd572fe --- /dev/null +++ b/Constructor/not.h @@ -0,0 +1,22 @@ +#ifndef _NOT_H_ +#define _NOT_H_ + +#include "item.h" + +class Not : public CItem { + public: + Not(); + virtual ~Not(); + virtual bool on_button_press_event(GdkEventButton *event); + virtual void on_menu_popup_rotar(); + virtual void save(FILE *archivo); + virtual bool check_connection(); + virtual bool is_connection_area(int _a, int _b); + private: + Glib::RefPtr imageN; // 0 + Glib::RefPtr imageS; // 1 + Glib::RefPtr imageE; // 2 + Glib::RefPtr imageO; // 3 + Glib::RefPtr null; +}; +#endif diff --git a/Constructor/not.o b/Constructor/not.o new file mode 100644 index 0000000..4491cbc Binary files /dev/null and b/Constructor/not.o differ diff --git a/Constructor/not_e.png b/Constructor/not_e.png new file mode 100644 index 0000000..ce39789 Binary files /dev/null and b/Constructor/not_e.png differ diff --git a/Constructor/not_n.png b/Constructor/not_n.png new file mode 100644 index 0000000..3b51716 Binary files /dev/null and b/Constructor/not_n.png differ diff --git a/Constructor/not_o.png b/Constructor/not_o.png new file mode 100644 index 0000000..7ee2125 Binary files /dev/null and b/Constructor/not_o.png differ diff --git a/Constructor/not_s.png b/Constructor/not_s.png new file mode 100644 index 0000000..cc8e708 Binary files /dev/null and b/Constructor/not_s.png differ diff --git a/Constructor/or.cpp b/Constructor/or.cpp new file mode 100644 index 0000000..d68dc6d --- /dev/null +++ b/Constructor/or.cpp @@ -0,0 +1,110 @@ +#include "or.h" + +Or::Or() +{ + imageN = Gdk::Pixbuf::create_from_file("or_n.png"); + imageS = Gdk::Pixbuf::create_from_file("or_s.png"); + imageE = Gdk::Pixbuf::create_from_file("or_e.png"); + imageO = Gdk::Pixbuf::create_from_file("or_o.png"); + null = Gdk::Pixbuf::create_from_file("null.png"); + imgActual = 0; + image = imageE; + set_size_request(image->get_width(), image->get_height()); + name = "or"; +} + +Or::~Or() +{ +} + +bool Or::on_button_press_event(GdkEventButton *event) +{ + 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; + 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); + imgActual++; + switch (imgActual) { + case 1: + image = imageS; + break; + case 2: + image = imageO; + break; + case 3: + image = imageN; + break; + default: + imgActual = 0; + image = imageE; + } + 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)){ + menu_popup.popup(event->button, event->time); + return true; //It has been handled. + } + return true; +} +void Or::on_menu_popup_rotar() +{ + GdkEventButton event; + event.type = GDK_BUTTON_PRESS; + event.button = 2; + Or::on_button_press_event(&event); +} + +void Or::save(FILE *archivo) +{ + +} + + +// CAMBIAR TODO ESTO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +bool Or::check_connection() +{ + switch (get_img_actual()) { + case 0: + if ( is_other_connection_area( get_position_x()-5, get_position_y()+16) && + is_other_connection_area( get_position_x()+get_image()->get_width()-16, +get_position_y()+get_image()->get_height() + 5) ) + return true; + break; + case 1: + if ( is_other_connection_area( get_position_x()+get_image()->get_width() - 16, get_position_y() -5) && + is_other_connection_area( get_position_x()-5, get_position_y()+get_image()->get_height()-16) ) + return true; + break; + case 2: + if ( is_other_connection_area( get_position_x() + 16, get_position_y() -5) && + is_other_connection_area( get_position_x()+get_image()->get_width()+5, get_position_y()+get_image()->get_height()-16) ) + return true; + break; + case 3: + if ( is_other_connection_area( get_position_x()+get_image()->get_width()+5, get_position_y() +16) && + is_other_connection_area( get_position_x() + 16, get_position_y()+get_image()->get_height() + 5) ) + return true; + } + return false; +} + +bool Or::is_connection_area(int _a, int _b) +{ + switch (imgActual) { + case 0: if ( ( (_a <= x+10)&&(_a > x) && (_b <=y+22)&&(_b>=y+10) ) || + ( (_a <= x+image->get_width()-10)&&(_a>=x+image->get_width()-22)&&(_b<=y+image->get_height()-1)&&(_b>=y+image->get_height()-10) ) ) + return true; + case 1: if ( ( (_a <= x+image->get_width()-10)&&(_a >= x+image->get_width()-22) && (_b <=y+10)&&(_b > y) ) || + ( (_a <= x+10)&&(_a > x)&&(_b<=y+image->get_height()-10)&&(_b>=y+image->get_height()-22) ) ) + return true; + case 2: if ( ( (_a <= x+22)&&(_a >= x+10) && (_b <=y+10)&&(_b > y) ) || + ( (_a <= x+image->get_width()-1)&&(_a>=x+image->get_width()-10)&&(_b<=y+image->get_height()-10)&&(_b>=y+image->get_height()-22) ) ) + return true; + case 3: if ( ( (_a <= x+image->get_width()-1)&&(_a >= x+image->get_width()-10) && (_b <=y+22)&&(_b>=y+10) ) || + ( (_a <= x+22)&&(_a>=x+10)&&(_b<=y+image->get_height()-1)&&(_b>=y+image->get_height()-10) ) ) + return true; + } + return false; +} diff --git a/Constructor/or.h b/Constructor/or.h new file mode 100644 index 0000000..b0de3da --- /dev/null +++ b/Constructor/or.h @@ -0,0 +1,22 @@ +#ifndef _OR_H_ +#define _OR_H_ + +#include "item.h" + +class Or : public CItem { + public: + Or(); + virtual ~Or(); + virtual bool on_button_press_event(GdkEventButton *event); + virtual void on_menu_popup_rotar(); + virtual void save(FILE *archivo); + virtual bool check_connection(); + virtual bool is_connection_area(int _a, int _b); + private: + Glib::RefPtr imageN; // 0 + Glib::RefPtr imageS; // 1 + Glib::RefPtr imageE; // 2 + Glib::RefPtr imageO; // 3 + Glib::RefPtr null; +}; +#endif diff --git a/Constructor/or.o b/Constructor/or.o new file mode 100644 index 0000000..6ff0b0c Binary files /dev/null and b/Constructor/or.o differ diff --git a/Constructor/or_e.png b/Constructor/or_e.png new file mode 100644 index 0000000..d177791 Binary files /dev/null and b/Constructor/or_e.png differ diff --git a/Constructor/or_n.png b/Constructor/or_n.png new file mode 100644 index 0000000..cdf6610 Binary files /dev/null and b/Constructor/or_n.png differ diff --git a/Constructor/or_o.png b/Constructor/or_o.png new file mode 100644 index 0000000..d86a398 Binary files /dev/null and b/Constructor/or_o.png differ diff --git a/Constructor/or_s.png b/Constructor/or_s.png new file mode 100644 index 0000000..82eff98 Binary files /dev/null and b/Constructor/or_s.png differ diff --git a/Constructor/propertywnd.h b/Constructor/propertywnd.h index 3c5062c..383552b 100644 --- a/Constructor/propertywnd.h +++ b/Constructor/propertywnd.h @@ -5,6 +5,8 @@ #include #include #include +#include +#include #include class CItem; diff --git a/Constructor/pump.cpp b/Constructor/pump.cpp index 719a1f9..c2f2edb 100644 --- a/Constructor/pump.cpp +++ b/Constructor/pump.cpp @@ -10,10 +10,9 @@ Pump::Pump() image = imageE; set_size_request(image->get_width(), image->get_height()); - Glib::RefPtr ref = Gnome::Glade::Xml::create("constructor.glade", "item_pty_wnd"); - ref->get_widget_derived("item_pty_wnd",pump_pty_wnd); + Glib::RefPtr ref = Gnome::Glade::Xml::create("constructor.glade", "pump_pty_wnd"); + ref->get_widget_derived("pump_pty_wnd",pump_pty_wnd); pump_pty_wnd->pump = this; - pump_pty_wnd->set_title("Propiedades de la Bomba"); name = "bomba"; } @@ -48,8 +47,8 @@ bool Pump::on_button_press_event(GdkEventButton *event) } if ((event->type == GDK_2BUTTON_PRESS) && (event->button ==1)){ - pump_pty_wnd->spin_caudal->set_value( entrega ); - pump_pty_wnd->txt_item_name->set_text( name ); + pump_pty_wnd->spin_fluid->set_value( entrega ); + pump_pty_wnd->txt_pump_name->set_text( name ); pump_pty_wnd->show(); } return true; @@ -76,14 +75,27 @@ void Pump::set_entrega(double _ent) entrega = _ent; } +void Pump::set_liquid_color(Gdk::Color _color) +{ + liquid_color = _color; +} + double Pump::get_entrega() { return entrega; } +Gdk::Color Pump::get_liquid_color() +{ + return liquid_color; +} + void Pump::save(FILE *archivo) { - char c_id[50], c_entrega[50], c_x[50], c_y[50], c_img[50]; + char c_id[50], c_entrega[50], c_x[50], c_y[50], c_img[50], c_red[50], c_green[50], c_blue[50]; + sprintf(c_red,"\t\t\t%d\n",liquid_color.get_red()); + sprintf(c_green,"\t\t\t%d\n",liquid_color.get_green()); + sprintf(c_blue,"\t\t\t%d\n",liquid_color.get_blue()); sprintf(c_x,"\t\t%d\n",x); sprintf(c_y,"\t\t%d\n",y); sprintf(c_id,"%d",ID); @@ -94,6 +106,11 @@ void Pump::save(FILE *archivo) dato += c_id; dato += "\">\n"; dato += c_entrega; + dato += "\t\n"; + dato += c_red; + dato += c_green; + dato += c_blue; + dato += "\t\n"; dato += c_img; dato += c_x; dato += c_y; diff --git a/Constructor/pump.h b/Constructor/pump.h index 17a4748..0fd2d07 100644 --- a/Constructor/pump.h +++ b/Constructor/pump.h @@ -14,7 +14,9 @@ class Pump : public CItem { virtual void on_menu_popup_rotar(); virtual void on_menu_popup_propiedades(); void set_entrega(double _cap); + void set_liquid_color(Gdk::Color _color); double get_entrega(); + Gdk::Color get_liquid_color(); virtual void save(FILE *archivo); virtual bool check_connection(); virtual bool is_connection_area(int _a, int _b); @@ -23,6 +25,7 @@ class Pump : public CItem { Glib::RefPtr imageE; // 0 Glib::RefPtr imageO; // 1 Glib::RefPtr null; + Gdk::Color liquid_color; PumpPtyWnd *pump_pty_wnd; }; #endif diff --git a/Constructor/pumpptywnd.cpp b/Constructor/pumpptywnd.cpp index 7b150d1..d4510f3 100644 --- a/Constructor/pumpptywnd.cpp +++ b/Constructor/pumpptywnd.cpp @@ -1,11 +1,20 @@ #include "pumpptywnd.h" #include "pump.h" -PumpPtyWnd::PumpPtyWnd(BaseObjectType* cobject, const Glib::RefPtr& refGlade):ItemPtyWnd(cobject, refGlade) +PumpPtyWnd::PumpPtyWnd(BaseObjectType* cobject, const Glib::RefPtr& refGlade):PropertyWnd(cobject, refGlade) { - refGlade->get_widget("lbl_property", lbl_property); - refGlade->get_widget("txt_item_name", txt_item_name); - lbl_property->set_text("Entrega Maxima"); + refGlade->get_widget("btn_select_color",btn_select_color); + refGlade->get_widget("spin_fluid",spin_fluid); + refGlade->get_widget("txt_pump_name",txt_pump_name); + + Glib::RefPtr ref = Gnome::Glade::Xml::create("constructor.glade", "color_select_dlg"); + ref->get_widget("color_select_dlg",color_select_dlg); + ref->get_widget("dlg_select_color_cancel",dlg_select_color_cancel); + ref->get_widget("dlg_select_color_ok",dlg_select_color_ok); + + btn_select_color->signal_clicked().connect(SigC::slot(*this,&PumpPtyWnd::on_btn_select_color_clicked)); + dlg_select_color_cancel->signal_clicked().connect(SigC::slot(*this,&PumpPtyWnd::on_dlg_select_color_cancel_clicked)); + dlg_select_color_ok->signal_clicked().connect(SigC::slot(*this,&PumpPtyWnd::on_dlg_select_color_ok_clicked)); } PumpPtyWnd::~PumpPtyWnd() @@ -14,13 +23,31 @@ PumpPtyWnd::~PumpPtyWnd() void PumpPtyWnd::on_btn_accept_clicked() { - pump->set_entrega( spin_caudal->get_value() ); - pump->set_name( txt_item_name->get_text() ); + PumpPtyWnd::on_btn_apply_clicked(); hide(); } void PumpPtyWnd::on_btn_apply_clicked() { - pump->set_entrega( spin_caudal->get_value() ); - pump->set_name( txt_item_name->get_text() ); + pump->set_entrega( spin_fluid->get_value() ); + pump->set_name( txt_pump_name->get_text() ); + color_select_dlg->get_colorsel()->set_current_color(pump->get_liquid_color()); +} + +void PumpPtyWnd::on_btn_select_color_clicked() +{ + // poner un preview del color seleccionado + color_select_dlg->get_colorsel()->set_current_color(pump->get_liquid_color()); + color_select_dlg->show(); +} + +void PumpPtyWnd::on_dlg_select_color_cancel_clicked() +{ + color_select_dlg->hide(); +} + +void PumpPtyWnd::on_dlg_select_color_ok_clicked() +{ + pump->set_liquid_color( color_select_dlg->get_colorsel()->get_current_color() ); + color_select_dlg->hide(); } diff --git a/Constructor/pumpptywnd.h b/Constructor/pumpptywnd.h index 502240b..5ad59ab 100644 --- a/Constructor/pumpptywnd.h +++ b/Constructor/pumpptywnd.h @@ -1,18 +1,24 @@ #ifndef _PUMPPTYWND_H_ #define _PUMPPTYWND_H_ -#include "itemptywnd.h" +#include "propertywnd.h" class Pump; -class PumpPtyWnd : public ItemPtyWnd { +class PumpPtyWnd : public PropertyWnd{ public: PumpPtyWnd(BaseObjectType* cobject, const Glib::RefPtr& refGlade); virtual ~PumpPtyWnd(); Pump *pump; - Gtk::Label *lbl_property; + Gtk::SpinButton *spin_fluid; + Gtk::Entry *txt_pump_name; + Gtk::Button *btn_select_color, *dlg_select_color_cancel, *dlg_select_color_ok; + Gtk::ColorSelectionDialog *color_select_dlg; virtual void on_btn_accept_clicked(); virtual void on_btn_apply_clicked(); + virtual void on_btn_select_color_clicked(); + virtual void on_dlg_select_color_cancel_clicked(); + virtual void on_dlg_select_color_ok_clicked(); }; #endif