Removed this extra widget thing, because it is now developed in my private branch.
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
19 #include <design_win.h>
21 bool DesignWin::closeIfEscapeIsPressed(GdkEventKey* e)
23 if(e->keyval==GDK_Escape)
30 DesignWin::DesignWin(const std::string& title, double attraction_v, double propulsation_v, int iterations_v, NoteBookTab & mw):mytab(mw)
34 mytab.signal_title_ch().connect(sigc::mem_fun(*this, &DesignWin::set_title));
36 signal_key_press_event().connect(sigc::mem_fun(*this, &DesignWin::closeIfEscapeIsPressed));
38 Gtk::VBox * vbox=new Gtk::VBox();
41 Gtk::Label * attraction_label=new Gtk::Label("Edge elasticity: ");
42 Gtk::Label * propulsation_label=new Gtk::Label("Node propulsation: ");
43 Gtk::Label * iteration_label=new Gtk::Label("Iteration number: ");
45 Gtk::Adjustment * attraction_adjustment=new Gtk::Adjustment(attraction_v, 0,1,0.01,0.1);
46 Gtk::Adjustment * propulsation_adjustment=new Gtk::Adjustment(propulsation_v,0,1000000,1000,10000);
47 Gtk::Adjustment * iteration_adjustment=new Gtk::Adjustment(iterations_v,1,20000,5,10);
49 attraction = new Gtk::SpinButton(*attraction_adjustment,5,3);
50 propulsation = new Gtk::SpinButton(*propulsation_adjustment,5,0);
51 iteration = new Gtk::SpinButton(*iteration_adjustment,5,0);
53 close_button=new Gtk::Button("Redesign");
55 attraction->signal_value_changed().connect(sigc::mem_fun(*this, &DesignWin::emit_attraction));
56 propulsation->signal_value_changed().connect(sigc::mem_fun(*this, &DesignWin::emit_propulsation));
57 iteration->signal_value_changed().connect(sigc::mem_fun(*this, &DesignWin::emit_iteration));
58 close_button->signal_pressed().connect(sigc::mem_fun(*this, &DesignWin::emit_closerun));
60 table.attach(*attraction_label,0,1,0,1);
61 table.attach(*propulsation_label,0,1,1,2);
62 table.attach(*iteration_label,0,1,2,3);
63 table.attach(*attraction,1,2,0,1);
64 table.attach(*propulsation,1,2,1,2);
65 table.attach(*iteration,1,2,2,3);
66 table.attach(*close_button,0,2,3,4);
73 void DesignWin::emit_attraction()
75 signal_attraction_ch.emit(attraction->get_value());
78 void DesignWin::emit_propulsation()
80 signal_propulsation_ch.emit(propulsation->get_value());
83 void DesignWin::emit_iteration()
85 signal_iteration_ch.emit((int)iteration->get_value());
88 void DesignWin::set_title(std::string tabname)
90 Gtk::Window::set_title("Design Setup - "+tabname);
93 void DesignWin::set_data(double attr, double propuls, int it)
95 attraction->set_value(attr);
96 propulsation->set_value(propuls);
97 iteration->set_value(it);