diff -r af2ed974ab68 -r 9d7489e8921e eps_win.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/eps_win.cc Tue Feb 27 17:23:55 2007 +0000 @@ -0,0 +1,95 @@ +/* -*- C++ -*- + * + * This file is a part of LEMON, a generic C++ optimization library + * + * Copyright (C) 2003-2006 + * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport + * (Egervary Research Group on Combinatorial Optimization, EGRES). + * + * Permission to use, modify and distribute this software is granted + * provided that this copyright notice appears in all copies. For + * precise terms see the accompanying LICENSE file. + * + * This software is provided "AS IS" with no warranty of any kind, + * express or implied, and with no claim as to its suitability for any + * purpose. + * + */ + +#include "eps_win.h" +#include + +bool EpsWin::closeIfEscapeIsPressed(GdkEventKey* e) +{ + if(e->keyval==GDK_Escape) + { + hide(); + } + return true; +} + +EpsWin::EpsWin(const std::string& title, NoteBookTab & mw):Gtk::Dialog(title, true, true),mytab(mw) +{ + set_default_size(200, 50); + + set_resizable(false); + + signal_key_press_event().connect(sigc::mem_fun(*this, &EpsWin::closeIfEscapeIsPressed)); + + mytab.signal_title_ch().connect(sigc::mem_fun(*this, &EpsWin::set_title)); + + table=new Gtk::Table(EPS_PROPERTY_NUM, 1, false); + + std::vector labels; + labels.resize(EPS_PROPERTY_NUM); + + labels[N_MAPS]="Dump visualized nodemaps"; + labels[E_MAPS]="Dump visualizes edgemaps"; + labels[ARROWS]="Show arrows in directed graphs"; + labels[PAR]="Indicate parallel edges"; + + options.resize(EPS_PROPERTY_NUM); + + for(int i=0;ipack_start(*table); + vbox->pack_start(hbox); + + //OK button + add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK); + + show_all_children(); + +} + +bool EpsWin::on_delete_event(GdkEventAny * event) +{ + event=event; + mytab.closeEpsWin(); + return true; +} + +void EpsWin::on_response(int response_id) +{ + if(response_id==Gtk::RESPONSE_OK) + { + std::vector values; + values.resize(EPS_PROPERTY_NUM); + for(int i=0;iget_active(); + } + mytab.exportGraphToEPS(values, name.get_text()); + } + on_delete_event(NULL); +}