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
22 bool EpsWin::closeIfEscapeIsPressed(GdkEventKey* e)
24 if(e->keyval==GDK_Escape)
31 EpsWin::EpsWin(const std::string& title, NoteBookTab & mw):Gtk::Dialog(title, true, true),mytab(mw)
33 set_default_size(200, 50);
37 signal_key_press_event().connect(sigc::mem_fun(*this, &EpsWin::closeIfEscapeIsPressed));
39 mytab.signal_title_ch().connect(sigc::mem_fun(*this, &EpsWin::set_title));
41 table=new Gtk::Table(EPS_PROPERTY_NUM, 1, false);
43 std::vector<std::string> labels;
44 labels.resize(EPS_PROPERTY_NUM);
46 labels[N_MAPS]="Dump visualized nodemaps";
47 labels[E_MAPS]="Dump visualizes edgemaps";
48 labels[ARROWS]="Show arrows in directed graphs";
49 labels[PAR]="Indicate parallel edges";
51 options.resize(EPS_PROPERTY_NUM);
53 for(int i=0;i<EPS_PROPERTY_NUM;i++)
55 options[i]=new Gtk::CheckButton(labels[i]);
56 (*table).attach(*(options[i]),0,1,i,i+1,Gtk::FILL,Gtk::SHRINK,10,3);
59 hbox.pack_start(*(new Gtk::Label("Filename")));
60 hbox.pack_start(name);
62 Gtk::VBox * vbox=get_vbox();
64 vbox->pack_start(*table);
65 vbox->pack_start(hbox);
68 add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
69 add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
75 bool EpsWin::on_delete_event(GdkEventAny * event)
82 void EpsWin::on_response(int response_id)
84 if(response_id==Gtk::RESPONSE_OK)
86 std::vector <bool> values;
87 values.resize(EPS_PROPERTY_NUM);
88 for(int i=0;i<EPS_PROPERTY_NUM;i++)
90 values[i]=options[i]->get_active();
92 mytab.exportGraphToEPS(values, name.get_text());
94 on_delete_event(NULL);