COIN-OR::LEMON - Graph Library

source: lemon-0.x/gui/edit_win.cc @ 1469:104aab6e5d86

Last change on this file since 1469:104aab6e5d86 was 1469:104aab6e5d86, checked in by Hegyi Péter, 19 years ago

Sorry, forgot to commit two new files.

  • Property exe set to *
File size: 1.3 KB
Line 
1#include <edit_win.h>
2#include <set>
3
4bool EditWin::close_if_escape_is_pressed(GdkEventKey* e)
5{
6  if(e->keyval==GDK_Escape)
7  {
8    hide();
9  }
10  return true;
11}
12
13EditWin::EditWin(const std::string& title, GraphDisplayerCanvas & grdispc):gdc(grdispc),table(2, 2, true)
14{
15  set_title(title);
16  set_default_size(200, 50);
17
18  signal_key_press_event().connect(sigc::mem_fun(*this, &EditWin::close_if_escape_is_pressed));
19 
20  //New node button
21  button=new Gtk::Button("New Node");
22  button->signal_clicked().connect
23    (
24     sigc::bind
25     (
26      sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
27      1
28      )
29     );
30  table.attach(*button,0,1,0,1);
31
32  //New edge button
33  button=new Gtk::Button("New Edge");
34  button->signal_clicked().connect
35    (
36     sigc::bind
37     (
38      sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
39      2
40      )
41     );
42  table.attach(*button,1,2,0,1);
43   
44  //Move button
45  button=new Gtk::Button("Move");
46  button->signal_clicked().connect
47    (
48     sigc::bind
49     (
50      sigc::mem_fun(*this, &EditWin::makeEditorialToolChanged),
51      0
52      )
53     );
54  table.attach(*button,0,1,1,2);
55   
56  add(table);
57
58  show_all_children();
59
60}
61
62void EditWin::makeEditorialToolChanged(int newtool)
63{
64  gdc.changeEditorialTool(newtool);
65}
Note: See TracBrowser for help on using the repository browser.