1 #ifndef FILE_IMPORT_DIALOG
2 #define FILE_IMPORT_DIALOG
4 #include <gtkmm/dialog.h>
5 #include <gtkmm/radiobutton.h>
6 #include <gtkmm/comboboxtext.h>
7 #include <gtkmm/sizegroup.h>
8 #include <gtkmm/treemodel.h>
9 #include <gtkmm/liststore.h>
10 #include <gtkmm/treeview.h>
11 #include <gtkmm/scrolledwindow.h>
13 class FileImportDialog : public Gtk::Dialog
19 const std::vector<std::string>& _node_map_names,
20 const std::vector<std::string>& _arc_map_names);
24 std::vector<std::string> node_map_names;
25 std::vector<std::string> arc_map_names;
27 std::vector<std::string> xy_node_map_names;
28 std::vector<std::string> xy_arc_map_names;
31 const std::vector<std::string>& vec,
32 const std::string& str);
34 std::string node_coord_one_map_name;
35 std::string node_coord_two_maps_1_name;
36 std::string node_coord_two_maps_2_name;
37 std::string arrow_coord_one_map_name;
38 std::string arrow_coord_two_maps_1_name;
39 std::string arrow_coord_two_maps_2_name;
41 enum ReadOpts { ONE_MAP, TWO_MAPS, DONT_READ };
42 ReadOpts node_coord_load_from;
43 ReadOpts arrow_coord_load_from;
45 bool isXYNodeMap(const std::string& name);
46 bool isXYArcMap(const std::string& name);
47 bool isNodeMap(const std::string& name);
48 bool isArcMap(const std::string& name);
50 std::vector<std::string> numeric_node_map_names;
51 std::vector<std::string> string_node_map_names;
52 std::vector<std::string> numeric_arc_map_names;
53 std::vector<std::string> string_arc_map_names;
58 Gtk::RadioButton rblueCoordNone;
59 Gtk::RadioButton rblueCoordOneMap;
60 Gtk::RadioButton rblueCoordTwoMaps;
62 Gtk::RadioButton rbArrowCoordNone;
63 Gtk::RadioButton rbArrowCoordOneMap;
64 Gtk::RadioButton rbArrowCoordTwoMaps;
66 Gtk::ComboBoxText cblueCoordOneMap;
67 Gtk::ComboBoxText cblueCoordTwoMaps1;
68 Gtk::ComboBoxText cblueCoordTwoMaps2;
70 Gtk::ComboBoxText cbArrowCoordOneMap;
71 Gtk::ComboBoxText cbArrowCoordTwoMaps1;
72 Gtk::ComboBoxText cbArrowCoordTwoMaps2;
74 void onNodeCoordMapNumToggled();
75 void onArrowCoordMapNumToggled();
77 void onResponse(int id);
79 void onNodeCoordOneMapChanged();
80 void onNodeCoordTwoMaps1Changed();
81 void onNodeCoordTwoMaps2Changed();
83 void onArrowCoordOneMapChanged();
84 void onArrowCoordTwoMaps1Changed();
85 void onArrowCoordTwoMaps2Changed();
87 struct MapModelColumns : public Gtk::TreeModel::ColumnRecord
92 add(colReadAsNumeric);
95 Gtk::TreeModelColumn<Glib::ustring> colName;
96 Gtk::TreeModelColumn<bool> colReadAsNumeric;
97 Gtk::TreeModelColumn<bool> colReadAsString;
100 Gtk::TreeView twNodeMaps;
101 MapModelColumns NodeMapColumns;
102 Glib::RefPtr<Gtk::ListStore> refNodeMapStore;
103 void onNodeMapNumericToggled(const Glib::ustring& path);
104 void onNodeMapStringToggled(const Glib::ustring& path);
106 Gtk::TreeView twArcMaps;
107 MapModelColumns ArcMapColumns;
108 Glib::RefPtr<Gtk::ListStore> refArcMapStore;
109 void onArcMapNumericToggled(const Glib::ustring& path);
110 void onArcMapStringToggled(const Glib::ustring& path);
112 struct tree_view_record
114 tree_view_record(const std::string& _name, bool _numeric, bool _string,
126 std::vector<tree_view_record> node_tree_view_records;
127 void update_node_tree_view();
129 std::vector<tree_view_record> arc_tree_view_records;
130 void update_arc_tree_view();
133 FileImportDialog(ImportData* d);