1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/gui/edit_win.cc Fri Jun 10 12:11:50 2005 +0000
1.3 @@ -0,0 +1,65 @@
1.4 +#include <edit_win.h>
1.5 +#include <set>
1.6 +
1.7 +bool EditWin::close_if_escape_is_pressed(GdkEventKey* e)
1.8 +{
1.9 + if(e->keyval==GDK_Escape)
1.10 + {
1.11 + hide();
1.12 + }
1.13 + return true;
1.14 +}
1.15 +
1.16 +EditWin::EditWin(const std::string& title, GraphDisplayerCanvas & grdispc):gdc(grdispc),table(2, 2, true)
1.17 +{
1.18 + set_title(title);
1.19 + set_default_size(200, 50);
1.20 +
1.21 + signal_key_press_event().connect(sigc::mem_fun(*this, &EditWin::close_if_escape_is_pressed));
1.22 +
1.23 + //New node button
1.24 + button=new Gtk::Button("New Node");
1.25 + button->signal_clicked().connect
1.26 + (
1.27 + sigc::bind
1.28 + (
1.29 + sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
1.30 + 1
1.31 + )
1.32 + );
1.33 + table.attach(*button,0,1,0,1);
1.34 +
1.35 + //New edge button
1.36 + button=new Gtk::Button("New Edge");
1.37 + button->signal_clicked().connect
1.38 + (
1.39 + sigc::bind
1.40 + (
1.41 + sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
1.42 + 2
1.43 + )
1.44 + );
1.45 + table.attach(*button,1,2,0,1);
1.46 +
1.47 + //Move button
1.48 + button=new Gtk::Button("Move");
1.49 + button->signal_clicked().connect
1.50 + (
1.51 + sigc::bind
1.52 + (
1.53 + sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
1.54 + 0
1.55 + )
1.56 + );
1.57 + table.attach(*button,0,1,1,2);
1.58 +
1.59 + add(table);
1.60 +
1.61 + show_all_children();
1.62 +
1.63 +}
1.64 +
1.65 +void EditWin::makeEditorialToolChanged(int newtool)
1.66 +{
1.67 + gdc.changeEditorialTool(newtool);
1.68 +}