#include <gtkmm/scrolledwindow.h>
#include <gtkmm/checkbutton.h>
#include <gtkmm/fileselection.h>
-#include <gtkmm/entry.h>
+#include <gtkmm/combo.h>
#include "workplace.h"
#include "item.h"
#include "splitter.h"
#include "and.h"
#include "or.h"
#include "not.h"
+#include "libxml/parser.h"
class Constructor : public Gtk::Window {
public:
virtual ~Constructor();
private:
FILE *archivo;
+ bool saved;
+ std::string file_name;
protected:
int id;
// / defino los elementos de la ventana.
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,
- *btn_and, *btn_or, *btn_not;
- Gtk::ImageMenuItem *main_menu_quit, *edit_menu_del, *main_menu_save;
+ *btn_and, *btn_or, *btn_not, *btn_open_ok, *btn_open_cancel, *quick_btn_clear, *quick_btn_save, *quick_btn_open, *quick_btn_new, *btn_find;
+ Gtk::ImageMenuItem *main_menu_quit,*main_menu_new, *edit_menu_del, *edit_menu_delete_all, *main_menu_save, *main_menu_open;
Gtk::CheckButton *chk_btn_logica;
- Gtk::FileSelection *file_selection;
- Gtk::Entry *combo_entry;
+ Gtk::FileSelection *file_selection, *file_open_selection;
+ Gtk::Combo *combo_entry;
Gtk::Dialog *dlg_connect;
Gtk::Label *dlg_label;
+ Gtk::Statusbar *status_bar;
Glib::RefPtr<Gdk::Pixbuf> ico_canio, ico_y, ico_codo, ico_tanque, ico_bomba, ico_exclusa, ico_drain, ico_and, ico_or, ico_not;
Glib::RefPtr<Gdk::Pixbuf> ico_last;
std::list<Gtk::TargetEntry> listTargets;
std::list<CItem *> listaItems, lista_logic_Items;
+ std::list<Glib::ustring> list_pointed;
WorkPlace *workplace;
bool logica;
bool can_drop(CItem *, int , int);
+
// /señales de control para los elementos de la ventana.
-
virtual void on_btn_canio_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
virtual void on_btn_y_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
virtual void on_btn_codo_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
virtual void on_btn_or_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
virtual void on_btn_not_drag_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
virtual void on_main_menu_quit();
+ virtual void on_main_menu_open();
virtual void on_main_menu_save();
virtual void on_edit_menu_del();
- virtual void on_chk_btn_clicked();
+ virtual void on_edit_menu_delete_all();
+ virtual void on_chk_btn_logica_clicked();
+ virtual void on_btn_open_cancel_clicked();
virtual void on_btn_file_ok_clicked();
virtual void on_btn_file_cancel_clicked();
virtual void on_btn_check_clicked();
virtual void on_btn_dlg_connect_clicked();
-
+ virtual void on_load_from_xml();
+ virtual void on_quick_btn_delete_all_clicked();
+ virtual void on_quick_btn_save_clicked();
+ virtual void on_quick_btn_new_clicked();
+ virtual void on_btn_find_clicked();
+
+ bool check_connection(Glib::ustring& name);
+
// señales para cambiar el icono.
virtual void on_canio_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
virtual void on_y_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
virtual void on_item_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
virtual void on_item_drop_drag_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, GtkSelectionData* selection_data, guint info, guint time);
+
+ // Carga desde un XML
+ void create_lines(xmlNodePtr nodo);
+ void create_line(xmlNodePtr nodo, int logic_id);
+ Pump *loadBomba(xmlNodePtr nodo);
+ Conduct *loadConduct(xmlNodePtr nodo);
+ Exclusa *loadExclusa(xmlNodePtr nodo);
+ Cistern *loadTank(xmlNodePtr nodo);
+ Union *loadUnion(xmlNodePtr nodo);
+ Drain *loadDrain(xmlNodePtr nodo);
+ Splitter *loadCodo(xmlNodePtr nodo);
+ And *loadAnd(xmlNodePtr nodo);
+ Not *loadNot(xmlNodePtr nodo);
+ Or *loadOr(xmlNodePtr nodo);
};
#endif