Forgot the meat.
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
20 #include <kruskalbox.h>
21 #include <dijkstrabox.h>
23 sigc::signal<void, AlgoWin *> AlgoWin::signal_closing()
28 sigc::signal<void, AlgoWin *, std::string> AlgoWin::signal_maplist_needed()
30 return signal_maplist_need;
33 bool AlgoWin::closeIfEscapeIsPressed(GdkEventKey* e)
35 if(e->keyval==GDK_Escape)
42 AlgoWin::AlgoWin(int algoid, std::vector<std::string> tabnames)
44 signal_key_press_event().connect(sigc::mem_fun(*this, &AlgoWin::closeIfEscapeIsPressed));
46 Gtk::VBox * vbox=new Gtk::VBox();
49 Gtk::Label * label=new Gtk::Label("Select graph:");
54 ab=new AlgoBox(tabnames);
55 set_title("Algo Win Demo");
58 ab=new KruskalBox(tabnames);
59 set_title("Kruskal Algorithm");
62 ab=new DijkstraBox(tabnames);
63 set_title("Dijkstra Algorithm");
66 ab=new SuurballeBox(tabnames);
67 set_title("Suurballe Algorithm");
72 ab->signal_maplist_needed().connect(sigc::mem_fun(*this, &AlgoWin::emit_tab_change));
73 ab->signal_newmapwin_needed().connect(sigc::mem_fun(*this, &AlgoWin::emit_new_map_signal));
75 runbutton=new Gtk::Button("Run");
76 runbutton->signal_released().connect(sigc::mem_fun(*ab,&AlgoBox::run));
77 runbutton->signal_activate().connect(sigc::mem_fun(*ab,&AlgoBox::run));
79 closebutton=new Gtk::Button("Close");
80 closebutton->signal_released().connect(sigc::mem_fun(*this,&AlgoWin::on_hide));
81 closebutton->signal_activate().connect(sigc::mem_fun(*this,&AlgoWin::on_hide));
83 Gtk::HBox * hbox=new Gtk::HBox();
85 hbox->pack_start(*runbutton);
86 hbox->pack_start(*closebutton);
88 vbox->pack_start(*label);
89 vbox->pack_start(*ab);
90 vbox->pack_start(*hbox);
97 void AlgoWin::update_tablist(std::vector<std::string> tabnames)
99 ab->update_tablist(tabnames);
102 void AlgoWin::update_maplist(MapStorage * mapstorage)
104 ab->update_maplist(mapstorage);
107 void AlgoWin::on_hide()
109 signal_closed.emit(this);
110 Gtk::Window::on_hide();
113 void AlgoWin::emit_tab_change(std::string newtab)
115 signal_maplist_need.emit(this, newtab);