1 #ifndef _CONSTRUCTOR_H_
2 #define _CONSTRUCTOR_H_
5 #include <libglademm.h>
7 #include <gtkmm/window.h>
9 #include <gtkmm/button.h>
10 #include <gtkmm/fixed.h>
11 #include <gtkmm/scrolledwindow.h>
12 #include <gtkmm/checkbutton.h>
13 #include <gtkmm/fileselection.h>
14 #include <gtkmm/entry.h>
15 #include "workplace.h"
27 #include "libxml/parser.h"
29 class Constructor : public Gtk::Window {
31 Constructor(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
32 virtual ~Constructor();
37 // / defino los elementos de la ventana.
38 Gtk::Button *btn_canio, *btn_codo, *btn_y, *btn_tanque, *btn_bomba, *btn_exclusa, *btn_drain, *btn_file_ok, *btn_file_cancel, *btn_check, *btn_dlg_close,
39 *btn_and, *btn_or, *btn_not, *btn_open_ok, *btn_open_cancel;
40 Gtk::ImageMenuItem *main_menu_quit, *edit_menu_del, *main_menu_save, *main_menu_open;
41 Gtk::CheckButton *chk_btn_logica;
42 Gtk::FileSelection *file_selection, *file_open_selection;
43 Gtk::Entry *combo_entry;
44 Gtk::Dialog *dlg_connect;
45 Gtk::Label *dlg_label;
46 Glib::RefPtr<Gdk::Pixbuf> ico_canio, ico_y, ico_codo, ico_tanque, ico_bomba, ico_exclusa, ico_drain, ico_and, ico_or, ico_not;
47 Glib::RefPtr<Gdk::Pixbuf> ico_last;
48 std::list<Gtk::TargetEntry> listTargets;
49 std::list<CItem *> listaItems, lista_logic_Items;
52 bool can_drop(CItem *, int , int);
54 // /señales de control para los elementos de la ventana.
55 virtual void on_btn_canio_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
56 virtual void on_btn_y_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
57 virtual void on_btn_codo_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
58 virtual void on_btn_tanque_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
59 virtual void on_btn_bomba_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
60 virtual void on_btn_exclusa_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
61 virtual void on_btn_drain_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
62 virtual void on_btn_and_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
63 virtual void on_btn_or_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
64 virtual void on_btn_not_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
65 virtual void on_main_menu_quit();
66 virtual void on_main_menu_open();
67 virtual void on_main_menu_save();
68 virtual void on_edit_menu_del();
69 virtual void on_edit_menu_delete_all();
70 virtual void on_chk_btn_clicked();
71 virtual void on_btn_open_cancel_clicked();
72 virtual void on_btn_file_ok_clicked();
73 virtual void on_btn_file_cancel_clicked();
74 virtual void on_btn_check_clicked();
75 virtual void on_btn_dlg_connect_clicked();
76 virtual void on_load_from_xml();
78 // señales para cambiar el icono.
79 virtual void on_canio_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
80 virtual void on_y_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
81 virtual void on_codo_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
82 virtual void on_tanque_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
83 virtual void on_bomba_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
84 virtual void on_exclusa_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
85 virtual void on_drain_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
86 virtual void on_and_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
87 virtual void on_or_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
88 virtual void on_not_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
90 virtual void on_item_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context, CItem *);
91 virtual void on_item_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
93 virtual void on_item_drop_drag_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, GtkSelectionData* selection_data, guint info, guint time);
96 Pump *loadBomba(xmlNodePtr nodo);
97 Conduct *loadConduct(xmlNodePtr nodo);
98 Exclusa *loadExclusa(xmlNodePtr nodo);
99 Cistern *loadTank(xmlNodePtr nodo);
100 Union *loadUnion(xmlNodePtr nodo);
101 Drain *loadDrain(xmlNodePtr nodo);
102 Splitter *loadCodo(xmlNodePtr nodo);