Use hg changeset hash instead of svn revision.
3 * This file is a part of LEMON, a generic C++ optimization library
5 * Copyright (C) 2003-2006
6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 * (Egervary Research Group on Combinatorial Optimization, EGRES).
9 * Permission to use, modify and distribute this software is granted
10 * provided that this copyright notice appears in all copies. For
11 * precise terms see the accompanying LICENSE file.
13 * This software is provided "AS IS" with no warranty of any kind,
14 * express or implied, and with no claim as to its suitability for any
21 #include <mapselector.h>
25 bool EpsWin::closeIfEscapeIsPressed(GdkEventKey* e)
27 if(e->keyval==GDK_Escape)
34 EpsWin::EpsWin(const std::string& title, std::vector<std::string> n_nml, std::vector<std::string> s_nml):Gtk::Dialog(title, true, true)
36 set_default_size(200, 50);
40 signal_key_press_event().connect(sigc::mem_fun(*this, &EpsWin::closeIfEscapeIsPressed));
42 table=new Gtk::Table(EPS_PROPERTY_NUM, 1, false);
44 std::vector<std::string> labels;
45 labels.resize(EPS_PROPERTY_NUM);
47 labels[N_MAPS]="Dump visualized nodemaps";
48 labels[E_MAPS]="Dump visualizes arcmaps";
49 labels[ARROWS]="Show arrows in directed digraphs";
50 labels[PAR]="Indicate parallel arcs";
52 options.resize(EPS_PROPERTY_NUM);
54 for(int i=0;i<EPS_PROPERTY_NUM;i++)
56 options[i]=new Gtk::CheckButton(labels[i]);
57 (*table).attach(*(options[i]),0,1,i,i+1,Gtk::FILL,Gtk::SHRINK,10,3);
60 mapselector=new MapSelector(n_nml, s_nml, "", "Nodeshapes", false, true, NUM);
61 mapselector->signal_newmapwin_needed().connect(sigc::mem_fun(*this, &EpsWin::newMapWinNeeded));
63 hbox.pack_start(*(new Gtk::Label("Filename")));
64 hbox.pack_start(name);
66 Gtk::VBox * vbox=get_vbox();
68 vbox->pack_start(*table);
69 vbox->pack_start(*mapselector);
70 vbox->pack_start(hbox);
73 add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
74 add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
80 bool EpsWin::on_delete_event(GdkEventAny * event)
83 signal_eps_close.emit();
87 void EpsWin::on_response(int response_id)
89 if(response_id==Gtk::RESPONSE_OK)
91 std::vector <bool> values;
92 values.resize(EPS_PROPERTY_NUM);
93 for(int i=0;i<EPS_PROPERTY_NUM;i++)
95 values[i]=options[i]->get_active();
97 signal_eps_details.emit(values, name.get_text(), mapselector->get_active_text());
99 on_delete_event(NULL);
102 void EpsWin::newMapWinNeeded(bool isitarc)
104 signal_new_map.emit(false);
107 void EpsWin::registerNewNodeMap(std::string newmapname, MapValue::Type type)
109 mapselector->append_text((Glib::ustring)newmapname, type);