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
23 bool EpsWin::closeIfEscapeIsPressed(GdkEventKey* e)
25 if(e->keyval==GDK_Escape)
32 EpsWin::EpsWin(const std::string& title, NoteBookTab & mw):Gtk::Dialog(title, true, true),mytab(mw)
34 set_default_size(200, 50);
38 signal_key_press_event().connect(sigc::mem_fun(*this, &EpsWin::closeIfEscapeIsPressed));
40 mytab.signal_title_ch().connect(sigc::mem_fun(*this, &EpsWin::set_title));
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 edgemaps";
49 labels[ARROWS]="Show arrows in directed graphs";
50 labels[PAR]="Indicate parallel edges";
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 hbox.pack_start(*(new Gtk::Label("Filename")));
61 hbox.pack_start(name);
63 Gtk::VBox * vbox=get_vbox();
65 vbox->pack_start(*table);
66 vbox->pack_start(hbox);
69 add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
70 add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
76 bool EpsWin::on_delete_event(GdkEventAny * event)
83 void EpsWin::on_response(int response_id)
85 if(response_id==Gtk::RESPONSE_OK)
87 std::vector <bool> values;
88 values.resize(EPS_PROPERTY_NUM);
89 for(int i=0;i<EPS_PROPERTY_NUM;i++)
91 values[i]=options[i]->get_active();
93 mytab.exportGraphToEPS(values, name.get_text());
95 on_delete_event(NULL);